summaryrefslogtreecommitdiff
path: root/hosts/vidhar/network/dhcp/default.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-10-31 15:15:00 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-10-31 15:15:00 +0100
commitf300ea69b66427bd2a5a92a4c4f0db0aa99392b0 (patch)
tree7cd983c26895bec9ad29f76990ece205a112f53e /hosts/vidhar/network/dhcp/default.nix
parent31832d598650eb17ba24a81680039b1973e80158 (diff)
downloadnixos-f300ea69b66427bd2a5a92a4c4f0db0aa99392b0.tar
nixos-f300ea69b66427bd2a5a92a4c4f0db0aa99392b0.tar.gz
nixos-f300ea69b66427bd2a5a92a4c4f0db0aa99392b0.tar.bz2
nixos-f300ea69b66427bd2a5a92a4c4f0db0aa99392b0.tar.xz
nixos-f300ea69b66427bd2a5a92a4c4f0db0aa99392b0.zip
...
Diffstat (limited to 'hosts/vidhar/network/dhcp/default.nix')
-rw-r--r--hosts/vidhar/network/dhcp/default.nix28
1 files changed, 26 insertions, 2 deletions
diff --git a/hosts/vidhar/network/dhcp/default.nix b/hosts/vidhar/network/dhcp/default.nix
index dfaa4c9f..d3407f1d 100644
--- a/hosts/vidhar/network/dhcp/default.nix
+++ b/hosts/vidhar/network/dhcp/default.nix
@@ -23,6 +23,12 @@ with lib;
23 }; 23 };
24 24
25 client-classes = [ 25 client-classes = [
26 { name = "eos-ipxe";
27 test = "hexstring(pkt4.mac, ':') == '00:d8:61:79:c5:40' and option[77].hex == 'iPXE'";
28 next-server = "10.141.0.1";
29 boot-file-name = "http://nfsroot.vidhar.yggdrasil/eos/netboot.ipxe";
30 only-if-required = true;
31 }
26 { name = "ipxe"; 32 { name = "ipxe";
27 test = "option[77].hex == 'iPXE'"; 33 test = "option[77].hex == 'iPXE'";
28 next-server = "10.141.0.1"; 34 next-server = "10.141.0.1";
@@ -85,7 +91,7 @@ with lib;
85 ddns-send-updates = true; 91 ddns-send-updates = true;
86 ddns-qualifying-suffix = "lan.yggdrasil"; 92 ddns-qualifying-suffix = "lan.yggdrasil";
87 pools = [ { pool = "10.141.0.128 - 10.141.0.254"; } ]; 93 pools = [ { pool = "10.141.0.128 - 10.141.0.254"; } ];
88 require-client-classes = ["ipxe" "uefi-64" "uefi-32" "legacy"]; 94 require-client-classes = map (cc: cc.name) config.services.kea.dhcp4.settings.client-classes;
89 reservations = [ 95 reservations = [
90 { hostname = "sif"; 96 { hostname = "sif";
91 hw-address = "3c:e1:a1:52:24:35"; 97 hw-address = "3c:e1:a1:52:24:35";
@@ -258,7 +264,25 @@ with lib;
258 ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration 264 ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration
259 '') 265 '')
260 ) ["x86_64-linux"] 266 ) ["x86_64-linux"]
261 ); 267 ) ++ [
268 (let
269 eosBuild = (flake.nixosConfigurations.eos.extendModules {
270 modules = [
271 ({ ... }: {
272 config.nfsroot.storeDevice = "10.141.0.1:nix-store";
273 config.nfsroot.registrationUrl = "http://nfsroot.vidhar.yggdrasil/eos/registration";
274 })
275 ];
276 }).config.system.build;
277 in builtins.toPath (pkgs.runCommandLocal "eos" {} ''
278 mkdir -p $out/eos
279 install -m 0444 -t $out/eos \
280 ${eosBuild.initialRamdisk}/initrd \
281 ${eosBuild.kernel}/bzImage \
282 ${eosBuild.netbootIpxeScript}/netboot.ipxe \
283 ${pkgs.closureInfo { rootPaths = eosBuild.storeContents; }}/registration
284 ''))
285 ];
262 }; 286 };
263 }; 287 };
264 }; 288 };