@cryptotaxi247 / infra-1 / commits / 880bc20f

rfc39: switch to using a flake input

Pierre Bourdon committed Feb 9, 2024 at 00:34 UTC 880bc20fe076a962ca456bb4ea3172e1674e2a04
4 files changed +105 -36
delft/flake.lock
+56 -1
@@ -63,6 +63,24 @@
63 "type": "github"
64 }
65 },
66 + "flake-utils": {
67 + "inputs": {
68 + "systems": "systems_2"
69 + },
70 + "locked": {
71 + "lastModified": 1705309234,
72 + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
73 + "owner": "numtide",
74 + "repo": "flake-utils",
75 + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
76 + "type": "github"
77 + },
78 + "original": {
79 + "owner": "numtide",
80 + "repo": "flake-utils",
81 + "type": "github"
82 + }
83 + },
84 "home-manager": {
85 "inputs": {
86 "nixpkgs": [
@@ -150,11 +168,33 @@
168 "type": "indirect"
169 }
170 },
171 + "rfc39": {
172 + "inputs": {
173 + "flake-utils": "flake-utils",
174 + "nixpkgs": [
175 + "nixpkgs"
176 + ]
177 + },
178 + "locked": {
179 + "lastModified": 1707436234,
180 + "narHash": "sha256-m3oCC9tepu0ng1u8ljtETrgEuiCgtFEatUWZslZzHnQ=",
181 + "owner": "NixOS",
182 + "repo": "rfc39",
183 + "rev": "ab3b4ac953d011d2fae04c252718dc81727a5a5d",
184 + "type": "github"
185 + },
186 + "original": {
187 + "owner": "NixOS",
188 + "repo": "rfc39",
189 + "type": "github"
190 + }
191 + },
192 "root": {
193 "inputs": {
194 "agenix": "agenix",
195 "nix-netboot-serve": "nix-netboot-serve",
157 - "nixpkgs": "nixpkgs_3"
196 + "nixpkgs": "nixpkgs_3",
197 + "rfc39": "rfc39"
198 }
199 },
200 "systems": {
@@ -171,6 +211,21 @@
211 "repo": "default",
212 "type": "github"
213 }
214 + },
215 + "systems_2": {
216 + "locked": {
217 + "lastModified": 1681028828,
218 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
219 + "owner": "nix-systems",
220 + "repo": "default",
221 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
222 + "type": "github"
223 + },
224 + "original": {
225 + "owner": "nix-systems",
226 + "repo": "default",
227 + "type": "github"
228 + }
229 }
230 },
231 "root": "root",
delft/flake.nix
+47 -32
@@ -2,45 +2,60 @@
2 inputs.nixpkgs.url = "nixpkgs/nixos-23.05-small";
3 inputs.nix-netboot-serve.url = "github:DeterminateSystems/nix-netboot-serve";
4
5 + inputs.rfc39.url = "github:NixOS/rfc39";
6 + inputs.rfc39.inputs.nixpkgs.follows = "nixpkgs";
7 +
8 inputs.agenix = {
9 url = "github:ryantm/agenix";
10 inputs.nixpkgs.follows = "nixpkgs";
11 };
12
10 - outputs = flakes @ { self, agenix, nixpkgs, nix-netboot-serve }:
11 - let inherit (nixpkgs) lib;
12 - in {
13 - nixosConfigurations.eris = nixpkgs.lib.nixosSystem {
14 - system = "x86_64-linux";
15 -
16 - modules = [
17 - ./eris.nix
18 - ./eris-physical.nix
19 - agenix.nixosModules.age
20 - nix-netboot-serve.nixosModules.nix-netboot-serve
21 - ];
22 - };
13 + outputs = flakes @ { self, agenix, nixpkgs, nix-netboot-serve, rfc39 }:
14 + let
15 + inherit (nixpkgs) lib;
16
24 - nixosConfigurations.haumea = nixpkgs.lib.nixosSystem {
25 - system = "x86_64-linux";
17 + flakesModule = {
18 + imports = [
19 + agenix.nixosModules.age
20 + nix-netboot-serve.nixosModules.nix-netboot-serve
21 + ];
22
27 - modules = [
28 - ./haumea.nix
29 - ./haumea-physical.nix
30 - ];
31 - };
23 + nixpkgs.overlays = [
24 + rfc39.overlays.default
25 + ];
26 + };
27 + in {
28 + nixosConfigurations.eris = nixpkgs.lib.nixosSystem {
29 + system = "x86_64-linux";
30 +
31 + modules = [
32 + flakesModule
33 + ./eris.nix
34 + ./eris-physical.nix
35 + ];
36 + };
37
33 - nixopsConfigurations.default =
34 - { inherit nixpkgs; }
35 - // import ./network.nix flakes;
36 -
37 - # TODO: flake-utils.lib.eachDefaultSystem
38 - devShell.x86_64-linux = let
39 - pkgs = import nixpkgs { system = "x86_64-linux"; };
40 - in pkgs.mkShell {
41 - buildInputs = with pkgs; [
42 - agenix.packages.x86_64-linux.agenix
43 - ];
38 + nixosConfigurations.haumea = nixpkgs.lib.nixosSystem {
39 + system = "x86_64-linux";
40 +
41 + modules = [
42 + flakesModule
43 + ./haumea.nix
44 + ./haumea-physical.nix
45 + ];
46 + };
47 +
48 + nixopsConfigurations.default =
49 + { inherit nixpkgs; }
50 + // import ./network.nix flakes;
51 +
52 + # TODO: flake-utils.lib.eachDefaultSystem
53 + devShell.x86_64-linux = let
54 + pkgs = import nixpkgs { system = "x86_64-linux"; };
55 + in pkgs.mkShell {
56 + buildInputs = with pkgs; [
57 + agenix.packages.x86_64-linux.agenix
58 + ];
59 + };
60 };
45 - };
61 }
delft/network.nix
+1
@@ -7,6 +7,7 @@ in
7 imports = [
8 # flakes.dwarffs.nixosModules.dwarffs # broken by Nix 2.6
9 {
10 + nixpkgs.overlays = [ flakes.rfc39.overlays.default ];
11 }
12 ];
13 };
modules/rfc39.nix
+1 -3
@@ -1,8 +1,6 @@
1 # This module fetches nixpkgs master and syncs the GitHub maintainer team.
2 { config, pkgs, ... }:
3 let
4 - rfc39 = import /home/deploy/src/rfc39 { inherit pkgs; };
5 -
4 rfc39Secret = f: { file = f; owner = "rfc39"; };
5 in {
6 age.secrets.rfc39-credentials = rfc39Secret ../delft/secrets/rfc39-credentials.age;
@@ -24,7 +22,7 @@ in {
22
23 systemd.services.rfc39-sync = {
24 description = "Sync the Maintainer Team ";
27 - path = [ config.nix.package pkgs.git pkgs.openssh rfc39 ];
25 + path = [ config.nix.package pkgs.git pkgs.openssh pkgs.rfc39 ];
26 startAt = "*:0/30";
27 serviceConfig.User = "rfc39";
28 serviceConfig.Group = "keys";