summaryrefslogtreecommitdiff
path: root/system-profiles
diff options
context:
space:
mode:
Diffstat (limited to 'system-profiles')
-rw-r--r--system-profiles/bcachefs.nix7
-rw-r--r--system-profiles/build-server/clients/sif/private16
-rw-r--r--system-profiles/core/default.nix175
-rw-r--r--system-profiles/initrd-ssh/module.nix12
-rw-r--r--system-profiles/networkmanager.nix5
-rw-r--r--system-profiles/nfsroot.nix172
-rw-r--r--system-profiles/openssh/host-keys/sif.yaml34
-rw-r--r--system-profiles/openssh/host-moduli/sif16
-rw-r--r--system-profiles/rebuild-machines/ssh/sif/private16
-rw-r--r--system-profiles/tmpfs-root.nix2
-rw-r--r--system-profiles/zfs.nix2
11 files changed, 242 insertions, 215 deletions
diff --git a/system-profiles/bcachefs.nix b/system-profiles/bcachefs.nix
new file mode 100644
index 00000000..65de9f7e
--- /dev/null
+++ b/system-profiles/bcachefs.nix
@@ -0,0 +1,7 @@
1{ config, pkgs, ... } : {
2 config = {
3 boot.supportedFilesystems = [ "bcachefs" ];
4
5 environment.systemPackages = with pkgs; [ bcachefs-tools ];
6 };
7}
diff --git a/system-profiles/build-server/clients/sif/private b/system-profiles/build-server/clients/sif/private
index 11a4bcbc..b8414951 100644
--- a/system-profiles/build-server/clients/sif/private
+++ b/system-profiles/build-server/clients/sif/private
@@ -7,19 +7,17 @@
7 "hc_vault": null, 7 "hc_vault": null,
8 "age": [ 8 "age": [
9 { 9 {
10 "recipient": "age1ure0athvtnaqqw48pe0y3upqdzmkaen9h70yggd9va4hva6avd8qqm6s4d", 10 "recipient": "age1rmmhetcmllq0ahl5qznlr0eya2zdxwl9h6y5wnl97d2wtyx5t99sm2u866",
11 "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA1c2cveXlHRC80NitqUHAy\nTGpDZU1POXVqUVZGUENwaXA2UzNRUG5IdWpNCjl2Nnl6S3dqbzA4VGp5OUYzVnBP\nR21tVTRSMHdhUVdHUGZ5MzNVWGMyTGsKLS0tIDR6UW5rTjBqSXZieUpZd3NMSWNl\nWW1xTDRtbWpxQTdDSlVwcnJBUmtlb0kKY3ArjYsxohdmy+fJDY65jgvUea73ECdC\nmro/2A+vpSsFGijCKoHnXL7/gcwBk7mY7tai9sjNdvam1BvrmkdPJQ==\n-----END AGE ENCRYPTED FILE-----\n" 11 "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBxMjlsN3Uvbm9rUE1JZEtZ\ndmxiQVZsa3NmVUZiTXdVcm9tSmZ6ZHFvLzNVClRYL2g0bjJXbFJlaklaU1FKSXlE\nSmpteks2ZzZ4OGlvMlk3NFpUdjVDeFkKLS0tIE9JZkhYSVJSSXVOT3hpMjYxSDdx\nSE1lNDVtY2Nxd1h4aWloR3c5MmtwblUKmaWYEjW6S+SUS8bUK3ul6qhAXMYfar/P\nsm3BXbRJKrHa1AbUANnEivthA2vkE84GQceH+9TFvUDbjVbrqYIRUQ==\n-----END AGE ENCRYPTED FILE-----\n"
12 },
13 {
14 "recipient": "age1fj65apkhfkrwyv5tx6zcs9nkjg8267fy733qph30sc7zfn7vapjqkd5kne",
15 "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBXUWR5aVlzUzErdmJjS0M5\nWjFUSDJqQTV5bkxWbG1zZHQzQ0I3Vjk0QlU4CjBEem5UbkpOb3BLd1M0emV5VHV6\nR2Y5dlo4WW5qNy9mR0ZiWU45OXVQQlUKLS0tIFNlZ1VheFZzTTJUaUw4NG1NN2sy\nbWRmR2tva0Y2b2k4UktMZzBaSU8rSFkKRNn8s2OM3JtEPlGub5mUxfinx6fSlc6w\ndt7PThAt7yazz/YYpZEoju+4xwdzD+KzLrEGgPtkfekZPXmcmx6vjw==\n-----END AGE ENCRYPTED FILE-----\n"
12 } 16 }
13 ], 17 ],
14 "lastmodified": "2021-09-27T18:11:41Z", 18 "lastmodified": "2021-09-27T18:11:41Z",
15 "mac": "ENC[AES256_GCM,data:LeLaxKnUhMpXXlxiZaRw3pKnd8tzcd8I9CwO2SRuzvzo/Bi8cBHq7IrJUmG6PWrTHhwTEI2Ul4DEF4PygRZybjRYUEVLbnKqYGPf4P0nZPhBBH6Ogpdc0o2C1t7A+HIka99A75oXx81k0bEaj6WuqgtPpOA6JhirCyOCJ7xDQE0=,iv:5XNCFDirM1NzS56AVDiJxP+4IuSMComezM+1pD6rayc=,tag:8ECDILhztr3NAVl0RhiwfQ==,type:str]", 19 "mac": "ENC[AES256_GCM,data:LeLaxKnUhMpXXlxiZaRw3pKnd8tzcd8I9CwO2SRuzvzo/Bi8cBHq7IrJUmG6PWrTHhwTEI2Ul4DEF4PygRZybjRYUEVLbnKqYGPf4P0nZPhBBH6Ogpdc0o2C1t7A+HIka99A75oXx81k0bEaj6WuqgtPpOA6JhirCyOCJ7xDQE0=,iv:5XNCFDirM1NzS56AVDiJxP+4IuSMComezM+1pD6rayc=,tag:8ECDILhztr3NAVl0RhiwfQ==,type:str]",
16 "pgp": [ 20 "pgp": null,
17 {
18 "created_at": "2023-01-30T10:58:12Z",
19 "enc": "-----BEGIN PGP MESSAGE-----\n\nhF4DXxoViZlp6dISAQdAAIyaBar/+e4YSSPS9eelsVpjzXf5kBSh1W3EgOZjblAw\nuIKrr4Qds/bgFHSoKZtzC6U8fbMddn6ua+tlguj8m5GCihUF0PgvtMb7tvZO0mGV\n0l4BrRfRDAr7THk5C1JCF2pWOpgyMVZP3X4kBt7Adbtg7HBSP/VVnRqlUUdwGAom\nt5q7Q+jdGrFdhoVczocAwUkypWF3GhGmAxAwAr9WgQWo3ruWBAcqFsbOSFhC5EQE\n=bfnH\n-----END PGP MESSAGE-----\n",
20 "fp": "30D3453B8CD02FE2A3E7C78C0FB536FB87AE8F51"
21 }
22 ],
23 "unencrypted_suffix": "_unencrypted", 21 "unencrypted_suffix": "_unencrypted",
24 "version": "3.7.1" 22 "version": "3.7.1"
25 } 23 }
diff --git a/system-profiles/core/default.nix b/system-profiles/core/default.nix
index 0859d707..c2c821b7 100644
--- a/system-profiles/core/default.nix
+++ b/system-profiles/core/default.nix
@@ -74,7 +74,7 @@ in {
74 }; 74 };
75 in foldr (def: mergeConfig def.value) {}; 75 in foldr (def: mergeConfig def.value) {};
76 }; 76 };
77 description = mdDoc '' 77 description = ''
78 The configuration of the Nix Packages collection. (For 78 The configuration of the Nix Packages collection. (For
79 details, see the Nixpkgs documentation.) It allows you to set 79 details, see the Nixpkgs documentation.) It allows you to set
80 package configuration options. 80 package configuration options.
@@ -91,96 +91,113 @@ in {
91 }; 91 };
92 }; 92 };
93 93
94 config = { 94 config = foldr recursiveUpdate {} ([
95 networking.hostName = hostName; 95 {
96 system.configurationRevision = mkIf (flake ? rev) flake.rev; 96 networking.hostName = hostName;
97 system.configurationRevision = mkIf (flake ? rev) flake.rev;
97 98
98 nixpkgs.pkgs = import (flakeInputs.${config.nixpkgs.flakeInput}.outPath + "/pkgs/top-level") { 99 nixpkgs.pkgs = import (flakeInputs.${config.nixpkgs.flakeInput}.outPath + "/pkgs/top-level") {
99 overlays = attrValues flake.overlays; 100 overlays = attrValues flake.overlays;
100 config = config.nixpkgs.externalConfig; 101 config = config.nixpkgs.externalConfig;
101 localSystem = config.nixpkgs.system; 102 localSystem = config.nixpkgs.system;
102 }; 103 };
103 104
104 nix = { 105 nix = {
105 package = pkgs.nixUnstable; 106 package = if builtins.hasAttr "latest" pkgs.nixVersions then pkgs.nixVersions.latest else pkgs.nixUnstable;
106 settings = { 107 settings = {
107 sandbox = true; 108 sandbox = true;
108 allowed-users = [ "*" ]; 109 allowed-users = [ "*" ];
109 trusted-users = [ "root" "@wheel" ]; 110 trusted-users = [ "root" "@wheel" ];
110 111
111 experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "cgroups"]; 112 experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "cgroups"];
112 auto-allocate-uids = true; 113 auto-allocate-uids = true;
113 use-cgroups = true; 114 use-cgroups = true;
114 use-xdg-base-directories = true; 115 use-xdg-base-directories = true;
115 116
116 flake-registry = "${flakeInputs.flake-registry}/flake-registry.json"; 117 flake-registry = "${flakeInputs.flake-registry}/flake-registry.json";
118 };
119 nixPath = [
120 "nixpkgs=${pkgs.runCommand "nixpkgs" {} ''
121 mkdir $out
122 ln -s ${./nixpkgs.nix} $out/default.nix
123 ln -s /run/nixpkgs/lib $out/lib
124 ''}"
125 ];
126 registry =
127 let override = { self = "nixos"; };
128 in mapAttrs' (inpName: inpFlake: nameValuePair
129 (override.${inpName} or inpName)
130 { flake = inpFlake; } ) flakeInputs;
117 }; 131 };
118 nixPath = [ 132
119 "nixpkgs=${pkgs.runCommand "nixpkgs" {} '' 133 systemd.tmpfiles.rules = [
120 mkdir $out 134 "L+ /run/nixpkgs - - - - ${flakeInputs.nixpkgs.outPath}"
121 ln -s ${./nixpkgs.nix} $out/default.nix 135 "L+ /run/nixpkgs-overlays.nix - - - - ${pkgs.writeText "overlays.nix" ''
122 ln -s /run/nixpkgs/lib $out/lib 136 with builtins;
137
138 attrValues (import
139 (
140 let lock = fromJSON (readFile ${flake + "/flake.lock"}); in
141 fetchTarball {
142 url = "https://github.com/edolstra/flake-compat/archive/''${lock.nodes.flake-compat.locked.rev}.tar.gz";
143 sha256 = lock.nodes.flake-compat.locked.narHash;
144 }
145 )
146 { src = ${flake}; }
147 ).defaultNix.overlays
123 ''}" 148 ''}"
149 "L+ /etc/nixos - - - - ${flake}"
124 ]; 150 ];
125 registry =
126 let override = { self = "nixos"; };
127 in mapAttrs' (inpName: inpFlake: nameValuePair
128 (override.${inpName} or inpName)
129 { flake = inpFlake; } ) flakeInputs;
130 };
131
132 systemd.tmpfiles.rules = [
133 "L+ /run/nixpkgs - - - - ${flakeInputs.nixpkgs.outPath}"
134 "L+ /run/nixpkgs-overlays.nix - - - - ${pkgs.writeText "overlays.nix" ''
135 with builtins;
136
137 attrValues (import
138 (
139 let lock = fromJSON (readFile ${flake + "/flake.lock"}); in
140 fetchTarball {
141 url = "https://github.com/edolstra/flake-compat/archive/''${lock.nodes.flake-compat.locked.rev}.tar.gz";
142 sha256 = lock.nodes.flake-compat.locked.narHash;
143 }
144 )
145 { src = ${flake}; }
146 ).defaultNix.overlays
147 ''}"
148 ];
149
150 users.mutableUsers = false;
151 151
152 # documentation.nixos.includeAllModules = true; # incompatible with home-manager (build fails) 152 users.mutableUsers = false;
153 153
154 home-manager = { 154 documentation.nixos = {
155 useGlobalPkgs = true; # Otherwise home-manager would only work impurely 155 includeAllModules = true;
156 useUserPackages = false; 156 options.warningsAreErrors = false;
157 backupFileExtension = "bak"; 157 };
158 };
159 158
160 sops = mkIf hasSops { 159 home-manager = {
161 age = { 160 useGlobalPkgs = true; # Otherwise home-manager would only work impurely
162 keyFile = "/var/lib/sops-nix/key.txt"; 161 useUserPackages = false;
163 generateKey = false; 162 backupFileExtension = "bak";
164 sshKeyPaths = [];
165 }; 163 };
166 gnupg = { 164
167 home = null; 165 sops = mkIf hasSops {
168 sshKeyPaths = []; 166 age = {
167 keyFile = "/var/lib/sops-nix/key.txt";
168 generateKey = false;
169 sshKeyPaths = [];
170 };
171 gnupg = {
172 home = null;
173 sshKeyPaths = [];
174 };
169 }; 175 };
170 };
171 176
172 programs.git = { 177 programs.git = {
173 enable = true; 178 enable = true;
174 lfs.enable = true; 179 lfs.enable = true;
180 };
181 environment.systemPackages = with pkgs; [ git-annex scutiger ];
182 }
183 ] ++ (optional (options ? system.switch.enableNg) {
184 system.switch = lib.mkDefault {
185 enable = false;
186 enableNg = true;
175 }; 187 };
176 environment.systemPackages = with pkgs; [ git-annex scutiger ]; 188 })
177 189 ++ (optional (options ? system.etc) {
178 system.activationScripts.symlink-flake = '' 190 boot.initrd.systemd.enable = lib.mkDefault true;
179 if test -L /etc/nixos; then 191 system.etc.overlay.enable = lib.mkDefault true;
180 ln -nsf ${flake} /etc/nixos 192 systemd.sysusers.enable = lib.mkDefault true;
181 elif test -d /etc/nixos && rmdir --ignore-fail-on-non-empty /etc/nixos; then 193
182 ln -s ${flake} /etc/nixos 194 # Random perl remnants
183 fi 195 system.disableInstallerTools = lib.mkDefault true;
184 ''; 196 programs.less.lessopen = lib.mkDefault null;
185 }; 197 programs.command-not-found.enable = lib.mkDefault false;
198 boot.enableContainers = lib.mkDefault false;
199 boot.loader.grub.enable = lib.mkDefault false;
200 environment.defaultPackages = lib.mkDefault [ ];
201 documentation.info.enable = lib.mkDefault false;
202 }));
186} 203}
diff --git a/system-profiles/initrd-ssh/module.nix b/system-profiles/initrd-ssh/module.nix
index 2e75a8c4..db973b72 100644
--- a/system-profiles/initrd-ssh/module.nix
+++ b/system-profiles/initrd-ssh/module.nix
@@ -15,7 +15,7 @@ in
15 enable = mkOption { 15 enable = mkOption {
16 type = types.bool; 16 type = types.bool;
17 default = false; 17 default = false;
18 description = lib.mdDoc '' 18 description = ''
19 Start SSH service during initrd boot. It can be used to debug failing 19 Start SSH service during initrd boot. It can be used to debug failing
20 boot on a remote server, enter pasphrase for an encrypted partition etc. 20 boot on a remote server, enter pasphrase for an encrypted partition etc.
21 Service is killed when stage-1 boot is finished. 21 Service is killed when stage-1 boot is finished.
@@ -28,7 +28,7 @@ in
28 port = mkOption { 28 port = mkOption {
29 type = types.port; 29 type = types.port;
30 default = 22; 30 default = 22;
31 description = lib.mdDoc '' 31 description = ''
32 Port on which SSH initrd service should listen. 32 Port on which SSH initrd service should listen.
33 ''; 33 '';
34 }; 34 };
@@ -36,7 +36,7 @@ in
36 shell = mkOption { 36 shell = mkOption {
37 type = types.str; 37 type = types.str;
38 default = "/bin/ash"; 38 default = "/bin/ash";
39 description = lib.mdDoc '' 39 description = ''
40 Login shell of the remote user. Can be used to limit actions user can do. 40 Login shell of the remote user. Can be used to limit actions user can do.
41 ''; 41 '';
42 }; 42 };
@@ -48,7 +48,7 @@ in
48 "/etc/secrets/initrd/ssh_host_rsa_key" 48 "/etc/secrets/initrd/ssh_host_rsa_key"
49 "/etc/secrets/initrd/ssh_host_ed25519_key" 49 "/etc/secrets/initrd/ssh_host_ed25519_key"
50 ]; 50 ];
51 description = lib.mdDoc '' 51 description = ''
52 Specify SSH host keys to import into the initrd. 52 Specify SSH host keys to import into the initrd.
53 53
54 To generate keys, use 54 To generate keys, use
@@ -80,7 +80,7 @@ in
80 type = types.listOf types.str; 80 type = types.listOf types.str;
81 default = config.users.users.root.openssh.authorizedKeys.keys; 81 default = config.users.users.root.openssh.authorizedKeys.keys;
82 defaultText = literalExpression "config.users.users.root.openssh.authorizedKeys.keys"; 82 defaultText = literalExpression "config.users.users.root.openssh.authorizedKeys.keys";
83 description = lib.mdDoc '' 83 description = ''
84 Authorized keys for the root user on initrd. 84 Authorized keys for the root user on initrd.
85 ''; 85 '';
86 }; 86 };
@@ -88,7 +88,7 @@ in
88 extraConfig = mkOption { 88 extraConfig = mkOption {
89 type = types.lines; 89 type = types.lines;
90 default = ""; 90 default = "";
91 description = lib.mdDoc "Verbatim contents of {file}`sshd_config`."; 91 description = "Verbatim contents of {file}`sshd_config`.";
92 }; 92 };
93 }; 93 };
94 94
diff --git a/system-profiles/networkmanager.nix b/system-profiles/networkmanager.nix
index 0fc25619..bc5fd5ff 100644
--- a/system-profiles/networkmanager.nix
+++ b/system-profiles/networkmanager.nix
@@ -10,10 +10,7 @@ with lib;
10 dhcp = "internal"; 10 dhcp = "internal";
11 dns = mkForce "dnsmasq"; 11 dns = mkForce "dnsmasq";
12 logLevel = "INFO"; 12 logLevel = "INFO";
13 extraConfig = '' 13 settings.connectivity.url = "https://online.yggdrasil.li";
14 [connectivity]
15 uri=https://online.yggdrasil.li
16 '';
17 }; 14 };
18 }; 15 };
19 16
diff --git a/system-profiles/nfsroot.nix b/system-profiles/nfsroot.nix
index 4323765b..1cd930d9 100644
--- a/system-profiles/nfsroot.nix
+++ b/system-profiles/nfsroot.nix
@@ -1,4 +1,4 @@
1{ config, pkgs, lib, flake, flakeInputs, ... }: 1{ config, options, pkgs, lib, flake, flakeInputs, ... }:
2 2
3with lib; 3with lib;
4 4
@@ -14,99 +14,111 @@ in {
14 storeDevice = mkOption { 14 storeDevice = mkOption {
15 type = types.str; 15 type = types.str;
16 default = "nfsroot:nix-store"; 16 default = "nfsroot:nix-store";
17 description = "Nix store device";
17 }; 18 };
18 19
19 registrationUrl = mkOption { 20 registrationUrl = mkOption {
20 type = types.str; 21 type = types.str;
21 default = "http://nfsroot/nix-registration"; 22 default = "http://nfsroot/nix-registration";
23 description = "Url of nix store registrations";
22 }; 24 };
23 }; 25 };
24 26
25 system.build = { 27 system.build = {
26 storeContents = mkOption {}; 28 storeContents = mkOption {
29 description = "Contents of nix store";
30 };
27 }; 31 };
28 }; 32 };
29 33
30 config = { 34 config = foldr recursiveUpdate {} ([
31 # Don't build the GRUB menu builder script, since we don't need it 35 {
32 # here and it causes a cyclic dependency. 36 # Don't build the GRUB menu builder script, since we don't need it
33 boot.loader.grub.enable = false; 37 # here and it causes a cyclic dependency.
34 38 boot.loader.grub.enable = false;
35 # !!! Hack - attributes expected by other modules. 39
36 environment.systemPackages = [ pkgs.grub2_efi ] 40 # !!! Hack - attributes expected by other modules.
37 ++ (if pkgs.stdenv.hostPlatform.system == "aarch64-linux" 41 environment.systemPackages = [ pkgs.grub2_efi ]
38 then [] 42 ++ (if pkgs.stdenv.hostPlatform.system == "aarch64-linux"
39 else [ pkgs.grub2 pkgs.syslinux ]); 43 then []
40 44 else [ pkgs.grub2 pkgs.syslinux ]);
41 # In stage 1, mount a tmpfs on top of /nix/store (the squashfs 45
42 # image) to make this a live CD. 46 # In stage 1, mount a tmpfs on top of /nix/store (the squashfs
43 fileSystems."/nix/.ro-store" = mkImageMediaOverride 47 # image) to make this a live CD.
44 { fsType = "nfs4"; 48 fileSystems."/nix/.ro-store" = mkImageMediaOverride
45 device = cfg.storeDevice; 49 { fsType = "nfs4";
46 options = [ "ro" ]; 50 device = cfg.storeDevice;
47 neededForBoot = true; 51 options = [ "ro" ];
48 }; 52 neededForBoot = true;
53 };
54
55 fileSystems."/nix/.rw-store" = mkImageMediaOverride
56 { fsType = "tmpfs";
57 options = [ "mode=0755" ];
58 neededForBoot = true;
59 };
60
61 fileSystems."/nix/store" = mkImageMediaOverride
62 { fsType = "overlay";
63 device = "overlay";
64 options = [
65 "lowerdir=/nix/.ro-store"
66 "upperdir=/nix/.rw-store/store"
67 "workdir=/nix/.rw-store/work"
68 ];
69
70 depends = [
71 "/nix/.ro-store"
72 "/nix/.rw-store/store"
73 "/nix/.rw-store/work"
74 ];
75 };
76
77 nix.settings.use-sqlite-wal = false;
78
79 boot.initrd.availableKernelModules = [ "nfs" "nfsv4" "overlay" ];
80 boot.initrd.supportedFilesystems = [ "nfs" "nfsv4" "overlay" ];
81 services.rpcbind.enable = mkImageMediaOverride false;
82
83 boot.initrd.network.enable = true;
84 boot.initrd.network.flushBeforeStage2 = false; # otherwise nfs doesn't work
85 boot.initrd.postMountCommands = ''
86 mkdir -p /mnt-root/etc/
87 cp /etc/resolv.conf /mnt-root/etc/resolv.conf
88 '';
89 networking.useDHCP = true;
90 networking.resolvconf.enable = false;
91 networking.dhcpcd.persistent = true;
49 92
50 fileSystems."/nix/.rw-store" = mkImageMediaOverride
51 { fsType = "tmpfs";
52 options = [ "mode=0755" ];
53 neededForBoot = true;
54 };
55 93
56 fileSystems."/nix/store" = mkImageMediaOverride 94 system.build.storeContents = [config.system.build.toplevel];
57 { fsType = "overlay";
58 device = "overlay";
59 options = [
60 "lowerdir=/nix/.ro-store"
61 "upperdir=/nix/.rw-store/store"
62 "workdir=/nix/.rw-store/work"
63 ];
64
65 depends = [
66 "/nix/.ro-store"
67 "/nix/.rw-store/store"
68 "/nix/.rw-store/work"
69 ];
70 };
71 95
72 nix.settings.use-sqlite-wal = false; 96 system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
73 97 #!ipxe
74 boot.initrd.availableKernelModules = [ "nfs" "nfsv4" "overlay" ]; 98 # Use the cmdline variable to allow the user to specify custom kernel params
75 boot.initrd.supportedFilesystems = [ "nfs" "nfsv4" "overlay" ]; 99 # when chainloading this script from other iPXE scripts like netboot.xyz
76 services.rpcbind.enable = mkImageMediaOverride false; 100 kernel ${pkgs.stdenv.hostPlatform.linux-kernel.target} init=${config.system.build.toplevel}/init initrd=initrd ${toString config.boot.kernelParams} ''${cmdline}
77 101 initrd initrd
78 boot.initrd.network.enable = true; 102 boot
79 boot.initrd.network.flushBeforeStage2 = false; # otherwise nfs doesn't work
80 boot.initrd.postMountCommands = ''
81 mkdir -p /mnt-root/etc/
82 cp /etc/resolv.conf /mnt-root/etc/resolv.conf
83 '';
84 networking.useDHCP = true;
85 networking.resolvconf.enable = false;
86 networking.dhcpcd.persistent = true;
87
88
89 system.build.storeContents = [config.system.build.toplevel];
90
91 system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
92 #!ipxe
93 # Use the cmdline variable to allow the user to specify custom kernel params
94 # when chainloading this script from other iPXE scripts like netboot.xyz
95 kernel ${pkgs.stdenv.hostPlatform.linux-kernel.target} init=${config.system.build.toplevel}/init initrd=initrd ${toString config.boot.kernelParams} ''${cmdline}
96 initrd initrd
97 boot
98 '';
99
100 boot.postBootCommands =
101 ''
102 # After booting, register the contents of the Nix store on NFS
103 # in the Nix database in the tmpfs.
104 ${pkgs.curl}/bin/curl ${escapeShellArg cfg.registrationUrl} | ${config.nix.package.out}/bin/nix-store --load-db
105
106 # nixos-rebuild also requires a "system" profile and an
107 # /etc/NIXOS tag.
108 touch /etc/NIXOS
109 ${config.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
110 ''; 103 '';
111 }; 104
105 boot.postBootCommands =
106 ''
107 # After booting, register the contents of the Nix store on NFS
108 # in the Nix database in the tmpfs.
109 ${pkgs.curl}/bin/curl ${escapeShellArg cfg.registrationUrl} | ${config.nix.package.out}/bin/nix-store --load-db
110
111 # nixos-rebuild also requires a "system" profile and an
112 # /etc/NIXOS tag.
113 touch /etc/NIXOS
114 ${config.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system
115 '';
116
117 boot.initrd.systemd.enable = false;
118 }
119 ] ++ (optional (options ? system.etc) {
120 system.etc.overlay.enable = false;
121 }) ++ (optional (options ? system.sysusers) {
122 systemd.sysusers.enable = false;
123 }));
112} 124}
diff --git a/system-profiles/openssh/host-keys/sif.yaml b/system-profiles/openssh/host-keys/sif.yaml
index bc66c1a2..ca904535 100644
--- a/system-profiles/openssh/host-keys/sif.yaml
+++ b/system-profiles/openssh/host-keys/sif.yaml
@@ -6,28 +6,26 @@ sops:
6 azure_kv: [] 6 azure_kv: []
7 hc_vault: [] 7 hc_vault: []
8 age: 8 age:
9 - recipient: age1ure0athvtnaqqw48pe0y3upqdzmkaen9h70yggd9va4hva6avd8qqm6s4d 9 - recipient: age1rmmhetcmllq0ahl5qznlr0eya2zdxwl9h6y5wnl97d2wtyx5t99sm2u866
10 enc: | 10 enc: |
11 -----BEGIN AGE ENCRYPTED FILE----- 11 -----BEGIN AGE ENCRYPTED FILE-----
12 YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBsMzdPNTFsSmJtVzIrV2c3 12 YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBLL1N1YlVlaTRLblhNS2ZN
13 aG9HbVo0Y0F2ZkRaclhuTlR1b0prVnVpSDNzCkxweHkwYnVaVnFLQWJkVmw2cExD 13 TW5VTHhBTHVHN3RMWjFYQzhmRTNneVU1THhzCmlaWlhMTzNGVENsdG03TzVHM0s1
14 VEh2TU9NUzJkRzBlQnpUR09sUkY1RHMKLS0tIDhsWkh3OXRrY3JDaXR5b2ZzWWhN 14 K1lEcFBQZm8zTW9uelppRXd6dEJvZFkKLS0tIGVSem1nd1Y0VHdRWUc1UVEyZHc5
15 MWVzNlBTa0xkZDZrMWdsU0lvemVRb0kKbTUwFHMXZqbVdKqBWSa0B81ymVGqS7G3 15 UEVlc3BKVTFlbkhMZ2doZzhSOGNVZk0K+xn79UxArLoDo9+Ek0Hi/mUJf974OIIZ
16 ZhchZZpZdQcKMQ/I/rkvJqFstuOuEHYvUWeKz04zL3W2BuMp/TwOXQ== 16 g/hDK+e8ZtKyIhXYmH0CXYzZNpwhf2qegYoj7gZLOL2IIWxGdfytgg==
17 -----END AGE ENCRYPTED FILE-----
18 - recipient: age1fj65apkhfkrwyv5tx6zcs9nkjg8267fy733qph30sc7zfn7vapjqkd5kne
19 enc: |
20 -----BEGIN AGE ENCRYPTED FILE-----
21 YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBBWDFNWEpUV1cxbjlpOHBG
22 L010cW5tNXcrYXpoNUpYb1VuSFo5L2g2eVVVCkJCWFVtMW1zMlAvbEdXYVZoSnFF
23 dG1ucmgwdGtNVm1SL0ZJTUNUdWFXSVEKLS0tIER6bFRMK2lxZ0JRc1p1T09xOTVv
24 c2NKR0dyOGNpUUtTYlArd3hUbHk4T28KxHufhcZOHj94zoQANPvbYrprCSFZ9crx
25 IMA8NSi2i9evmxjaZwYQBJGMbmwgLmBTssY8sRl1vj17WqnwImyajA==
17 -----END AGE ENCRYPTED FILE----- 26 -----END AGE ENCRYPTED FILE-----
18 lastmodified: "2021-01-02T19:05:26Z" 27 lastmodified: "2021-01-02T19:05:26Z"
19 mac: ENC[AES256_GCM,data:yJGzs0W0R+b6WPkUaQc9cxeTBBEXot0ffUAG77Of88kREFsD5ams9qEDCs8LhPhMtLSH5L8bqMLF28n2w6d9gf41NDBl/oj+XTJE26c4D+MWF2A0fqTvwv1l3524TfavVU8iur0bCbytNfcHSZ3zCQAYElswOGupO+K0Y3hwKKI=,iv:jHSgQV6Jg2Yckp8G0Z23Ny74ZQxZ/+C/neXKrEWUVak=,tag:DhOr2cVhIq8i4JAO+fdXxA==,type:str] 28 mac: ENC[AES256_GCM,data:yJGzs0W0R+b6WPkUaQc9cxeTBBEXot0ffUAG77Of88kREFsD5ams9qEDCs8LhPhMtLSH5L8bqMLF28n2w6d9gf41NDBl/oj+XTJE26c4D+MWF2A0fqTvwv1l3524TfavVU8iur0bCbytNfcHSZ3zCQAYElswOGupO+K0Y3hwKKI=,iv:jHSgQV6Jg2Yckp8G0Z23Ny74ZQxZ/+C/neXKrEWUVak=,tag:DhOr2cVhIq8i4JAO+fdXxA==,type:str]
20 pgp: 29 pgp: []
21 - created_at: "2023-01-30T10:57:39Z"
22 enc: |
23 -----BEGIN PGP MESSAGE-----
24
25 hF4DXxoViZlp6dISAQdANv2DNGghv2Kh8xkNTxD7zLoo9CA0wg3QKJ6MHIFfDyMw
26 v6VzYeLDETRzJnqbmNrUD4iumJJfLUsbiBdCFNYsuiGgwrzRKLRyFYZ/vU6WGetm
27 0l4BK8qWw4Te7oRdHymqckpf9G6elyM+5z7ZDVqcFp8frmKJexP3e95UJU4I0rOj
28 MM6S/XcDsMVdxDo9hliZ1t6aTiBizqpBCK+YK6SrQ+OuoS5PSpSqfq2w5sLIDGiJ
29 =cLdo
30 -----END PGP MESSAGE-----
31 fp: 30D3453B8CD02FE2A3E7C78C0FB536FB87AE8F51
32 unencrypted_suffix: _unencrypted 30 unencrypted_suffix: _unencrypted
33 version: 3.6.1 31 version: 3.6.1
diff --git a/system-profiles/openssh/host-moduli/sif b/system-profiles/openssh/host-moduli/sif
index 334d23ff..4a3fb612 100644
--- a/system-profiles/openssh/host-moduli/sif
+++ b/system-profiles/openssh/host-moduli/sif
@@ -7,19 +7,17 @@
7 "hc_vault": null, 7 "hc_vault": null,
8 "age": [ 8 "age": [
9 { 9 {
10 "recipient": "age1ure0athvtnaqqw48pe0y3upqdzmkaen9h70yggd9va4hva6avd8qqm6s4d", 10 "recipient": "age1rmmhetcmllq0ahl5qznlr0eya2zdxwl9h6y5wnl97d2wtyx5t99sm2u866",
11 "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBacUpEWGR2Q3pwekRiYllz\nSWlsbG9rWjFCMlRZd2lXNkI5QmNZekFrRUhjCmxDamlwK09EMjFoaC9IR0hTZnFN\nOXJpYkg5clVvVDBabGQvSzhTRHZ2Z0kKLS0tIDYyTXJIRUV5TTdnbllTTUVhemV6\nVFlxaXBZUTYyNlUwRk9YWlA3NDZRakUKYHKZf7bYI4xm2plyI4QFGzMJMnQ1Nipu\nbR6jbSnHJTaYCJLUZTa0lVcrHBdbHK5gjV0tWOjAkG7z/PUXc8oInA==\n-----END AGE ENCRYPTED FILE-----\n" 11 "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBlUUJHZ3ptcXp2MEhSWHcv\nVERwVFU5Nm5qUzQ3MmVEUkZKVEcyODByRFhjCnFoUkgwZUN0TlRSeEpwdFFDbnZO\ndTNqQUt2ZEdUZ1phNGlUMEdwTmVsUE0KLS0tIGRWcWxDMEdiQTc5cytpU0pQWjFL\nd1RtUTJaWE1BNW12WmtHZUlIeDNIR0UKpzNAosrkXu79h2fbbttrfKu3d3mmmul7\nUM3Xk7A0CSq3AlcU8FLgig/Q0to9oAO21CAy93N6vUHGidQGBbJtMg==\n-----END AGE ENCRYPTED FILE-----\n"
12 },
13 {
14 "recipient": "age1fj65apkhfkrwyv5tx6zcs9nkjg8267fy733qph30sc7zfn7vapjqkd5kne",
15 "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBVMjJkMXRuWlhRdDRtV3BJ\nOHllRUZWdXhTakZrM3pVNHNSVEtMWXpQSmlrCmVjVWcrT1dsQW9yeXYvVG1ZTUVK\nRnRjd2ZhSEo5b01aSmlqeVA1bEYwa3MKLS0tIG1NNmJTWWFNUnE3TDlIcUtnbmZm\namd0R2ovcHBUQllpd2pTTXlZQm9mQjAK+gYUNtg0p0crA9+lCrsWzx+QA/faNavs\nNodfjmYsUiNArJVkHsdl5a5mPx2ZVs4mqinniVGJXxnM4IwWwMmrwA==\n-----END AGE ENCRYPTED FILE-----\n"
12 } 16 }
13 ], 17 ],
14 "lastmodified": "2021-12-15T15:25:47Z", 18 "lastmodified": "2021-12-15T15:25:47Z",
15 "mac": "ENC[AES256_GCM,data:21q8E/Ngod7Yp2eqtJXlXuYnxfDiWI4xvNGGX1kqVwj+4/7xUOHh9ieCBNrbJsF5q4HEHom9XIrMJBbDzqcNq0vlyw/KdYKP68bKUEQsaQh38tRgYpAnpRdXCOtzsfP8mTX2uIZasHM16HHLNkEo6K/poGxUMUdf1xrBnhOIwes=,iv:vFfGnkEkn6+UiFni1wGQexdB6I2VXmt7ZgMkXT1mDU4=,tag:f3f9PY8mF+CG2KnOL60n0g==,type:str]", 19 "mac": "ENC[AES256_GCM,data:21q8E/Ngod7Yp2eqtJXlXuYnxfDiWI4xvNGGX1kqVwj+4/7xUOHh9ieCBNrbJsF5q4HEHom9XIrMJBbDzqcNq0vlyw/KdYKP68bKUEQsaQh38tRgYpAnpRdXCOtzsfP8mTX2uIZasHM16HHLNkEo6K/poGxUMUdf1xrBnhOIwes=,iv:vFfGnkEkn6+UiFni1wGQexdB6I2VXmt7ZgMkXT1mDU4=,tag:f3f9PY8mF+CG2KnOL60n0g==,type:str]",
16 "pgp": [ 20 "pgp": null,
17 {
18 "created_at": "2023-01-30T10:58:08Z",
19 "enc": "-----BEGIN PGP MESSAGE-----\n\nhF4DXxoViZlp6dISAQdA6BH/4ATbobDju0iNWQyZrkXSAiXzj5JI+5rHFWCoJGkw\nmTl6Z+ztLz6lq/07WTDcmbwaxe9G9bvgiAy5/DBzLdBhBFpYb9CYK5zg4l5hBchA\n0l4B1gS8DB8WLlCwDECr9TwEvF/GE9IPU/tXL4/Gw8ELsiXFFfJbpQo67AfJFZyq\nBbzlLi22Wiqrs1TycFPDMBEb7s1uD5hRYgNxgrBiZN7HGI9AWAx0FIMIWnMddxBv\n=FTc3\n-----END PGP MESSAGE-----\n",
20 "fp": "30D3453B8CD02FE2A3E7C78C0FB536FB87AE8F51"
21 }
22 ],
23 "unencrypted_suffix": "_unencrypted", 21 "unencrypted_suffix": "_unencrypted",
24 "version": "3.7.1" 22 "version": "3.7.1"
25 } 23 }
diff --git a/system-profiles/rebuild-machines/ssh/sif/private b/system-profiles/rebuild-machines/ssh/sif/private
index 47c6f5e3..333d284d 100644
--- a/system-profiles/rebuild-machines/ssh/sif/private
+++ b/system-profiles/rebuild-machines/ssh/sif/private
@@ -7,19 +7,17 @@
7 "hc_vault": null, 7 "hc_vault": null,
8 "age": [ 8 "age": [
9 { 9 {
10 "recipient": "age1ure0athvtnaqqw48pe0y3upqdzmkaen9h70yggd9va4hva6avd8qqm6s4d", 10 "recipient": "age1rmmhetcmllq0ahl5qznlr0eya2zdxwl9h6y5wnl97d2wtyx5t99sm2u866",
11 "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBKeElJa2JFRHoxcy8zL24x\nYVdkRUVmb25ZYXBmaCtOZG52MzYybFcxUkNFCmJlU0swY0tTSFlPRnQyaTVjTDFW\ndTF1RE5wRDFXNDdOWnJWSWtOY3haYjQKLS0tIDZwU2xiSUttTHNGclN6YitiUmtE\na2hBTzJSWVJoYnhiUWpURVZQQ2ZFeU0KzftYJbiS284NdmxHpFSiqiZSem4qhAOU\nhdZKbLhtiuoZbTfDqcgyfjh8CZ+TULRGIFD5Jl7N18MXhGql+BY0qQ==\n-----END AGE ENCRYPTED FILE-----\n" 11 "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBTenRpcXYzYVBBYVBYdVl1\nWnJsc2NNSko5UlhuanM2MXJHbjM5Q3NvSmdFCndUK2lQYW1oRVI0cWlhK0cyTlVH\nZE4yVi8yMkRyaU5kUFNmZjV3dkFQOFUKLS0tIFRNaGp0aXFVVTRvek5LNWlldTM4\nbkE5dUQ1cGVxMFlzano2c2M5RkQrYWcKb2+b5c+D7UCFXPFKyU/Rx8HAQNAt7AQE\nTg8tKPOTdpEWp969BS5KQ4rhvJWjH1nUVo12eA6u/yAtGPTkdZLaqw==\n-----END AGE ENCRYPTED FILE-----\n"
12 },
13 {
14 "recipient": "age1fj65apkhfkrwyv5tx6zcs9nkjg8267fy733qph30sc7zfn7vapjqkd5kne",
15 "enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA5Q2c1emRxczBPS2p0bStr\nc1FWcHdCTU9FenRkZStvWTgySmg1Wm1GVVNvCkYzQjZyL09vbjd2bEVCNFhRUXBh\nekhVZkU3dmhaWFFUS0w4OVh3RjNINVUKLS0tIDF4Q0JHWmN1eUg4d0NxUjFSZmh5\nbUYvYlFpbXlUd2tOT0hrR2E4NzIrR0kKmtXSuM2+CI4hPQ1kqq2LFF9vMk9fQ5Iq\nTAT6UhiSMda7Av9ZL4MI+KQUxSbnSBm/RmDyZYuiz5giIoRAwWT/BQ==\n-----END AGE ENCRYPTED FILE-----\n"
12 } 16 }
13 ], 17 ],
14 "lastmodified": "2021-06-06T15:05:54Z", 18 "lastmodified": "2021-06-06T15:05:54Z",
15 "mac": "ENC[AES256_GCM,data:Cf8WbqV4bqkg+W84hRSjMsrqzV7QZqAJeU/DrlN94NRaLDbayXK/kbxz9gMWY6Eyv3D70ulc75EBojZF1SXfk/WpDHpVJ4DEizb28oIfE4x88MmQ7ZJuskqXQaFa4MohJVQ/7ukr9bTjNMm7RFtq+yNKkIy6mj2YBk6BYsPgwic=,iv:kq+FpwQEWJo18QEEqG1uZ3uJ1MpklqN7Oaj0fPw8/0k=,tag:FYHLHjzeD+28KHD7x5JwGA==,type:str]", 19 "mac": "ENC[AES256_GCM,data:Cf8WbqV4bqkg+W84hRSjMsrqzV7QZqAJeU/DrlN94NRaLDbayXK/kbxz9gMWY6Eyv3D70ulc75EBojZF1SXfk/WpDHpVJ4DEizb28oIfE4x88MmQ7ZJuskqXQaFa4MohJVQ/7ukr9bTjNMm7RFtq+yNKkIy6mj2YBk6BYsPgwic=,iv:kq+FpwQEWJo18QEEqG1uZ3uJ1MpklqN7Oaj0fPw8/0k=,tag:FYHLHjzeD+28KHD7x5JwGA==,type:str]",
16 "pgp": [ 20 "pgp": null,
17 {
18 "created_at": "2023-01-30T10:58:10Z",
19 "enc": "-----BEGIN PGP MESSAGE-----\n\nhF4DXxoViZlp6dISAQdAoV2p3twYsmVqs8zC/TxZzLuuPS3ElbJA+rIZdrZj5mUw\nc0Kzc9WxaJidh/1lx5FN3wNC7qe+jAhpOVmgrWt9oMVoFXutXGSXu+aFi2jk3AM4\n0l4Bz1nkRfku/MLer7zbJPFe+FrIiOxZOvakES7SnAci6nWUn/yaUNJl6R18tbLA\nJ71CF5TzpQaRYeR3a3EfAgQaZiTX8KJrlUSnCl9eNphgQVbgB05eRI74O40tQb7k\n=X6e2\n-----END PGP MESSAGE-----\n",
20 "fp": "30D3453B8CD02FE2A3E7C78C0FB536FB87AE8F51"
21 }
22 ],
23 "unencrypted_suffix": "_unencrypted", 21 "unencrypted_suffix": "_unencrypted",
24 "version": "3.7.1" 22 "version": "3.7.1"
25 } 23 }
diff --git a/system-profiles/tmpfs-root.nix b/system-profiles/tmpfs-root.nix
index d0b3be76..23939c2e 100644
--- a/system-profiles/tmpfs-root.nix
+++ b/system-profiles/tmpfs-root.nix
@@ -1,5 +1,7 @@
1{ ... }: { 1{ ... }: {
2 config = { 2 config = {
3 # system.etc.overlay.enable = true;
4
3 fileSystems."/" = { 5 fileSystems."/" = {
4 fsType = "tmpfs"; 6 fsType = "tmpfs";
5 options = [ "mode=0755" ]; 7 options = [ "mode=0755" ];
diff --git a/system-profiles/zfs.nix b/system-profiles/zfs.nix
index db742801..148cbb7b 100644
--- a/system-profiles/zfs.nix
+++ b/system-profiles/zfs.nix
@@ -3,7 +3,7 @@
3 boot = { 3 boot = {
4 kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; 4 kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
5 supportedFilesystems = [ "zfs" ]; 5 supportedFilesystems = [ "zfs" ];
6 zfs.enableUnstable = true; 6 zfs.package = pkgs.zfs_unstable;
7 }; 7 };
8 8
9 environment.systemPackages = with pkgs; [ httm ]; 9 environment.systemPackages = with pkgs; [ httm ];