this repo has no description
1{
2 description = "Nixie";
3
4 inputs = {
5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
6 gomod2nix = {
7 url = "github:nix-community/gomod2nix";
8 inputs.nixpkgs.follows = "nixpkgs";
9 };
10 };
11
12 outputs =
13 {
14 self,
15 nixpkgs,
16 gomod2nix,
17 }:
18 let
19 system = "x86_64-linux";
20
21 pkgs = import nixpkgs {
22 inherit system;
23 overlays = [
24 (import "${gomod2nix}/overlay.nix")
25 ];
26 };
27
28 app = pkgs.buildGoApplication {
29 pname = "nixie";
30 version = "0.1";
31 src = ./.;
32 modules = ./gomod2nix.toml;
33 };
34
35 goEnv = pkgs.mkGoEnv { pwd = ./.; };
36 in
37 {
38 packages.${system}.default = app;
39
40 nixosModules.nixie-agent =
41 {
42 config,
43 lib,
44 pkgs,
45 ...
46 }:
47 {
48 systemd.services.nixie-agent = {
49 description = "Nixie Agent";
50 wantedBy = [ "multi-user.target" ];
51 serviceConfig = {
52 # TODO we can probably refine the package to nixie-agent only,
53 # which should reduce ~12MB on the installer
54 ExecStart = "${self.packages.${system}.default}/bin/nixie-agent";
55 Restart = "on-failure";
56 };
57 };
58 };
59
60 devShells.${system}.default = pkgs.mkShell {
61 packages = [
62 goEnv
63 pkgs.gomod2nix
64 pkgs.gnumake
65 pkgs.nixfmt-tree
66 # TODO maybe embed this into the binary?
67 pkgs.nixos-anywhere
68 ];
69 };
70 };
71}