From f300ea69b66427bd2a5a92a4c4f0db0aa99392b0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 31 Oct 2022 15:15:00 +0100 Subject: ... --- hosts/vidhar/network/dhcp/default.nix | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'hosts/vidhar/network/dhcp') 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; }; client-classes = [ + { name = "eos-ipxe"; + test = "hexstring(pkt4.mac, ':') == '00:d8:61:79:c5:40' and option[77].hex == 'iPXE'"; + next-server = "10.141.0.1"; + boot-file-name = "http://nfsroot.vidhar.yggdrasil/eos/netboot.ipxe"; + only-if-required = true; + } { name = "ipxe"; test = "option[77].hex == 'iPXE'"; next-server = "10.141.0.1"; @@ -85,7 +91,7 @@ with lib; ddns-send-updates = true; ddns-qualifying-suffix = "lan.yggdrasil"; pools = [ { pool = "10.141.0.128 - 10.141.0.254"; } ]; - require-client-classes = ["ipxe" "uefi-64" "uefi-32" "legacy"]; + require-client-classes = map (cc: cc.name) config.services.kea.dhcp4.settings.client-classes; reservations = [ { hostname = "sif"; hw-address = "3c:e1:a1:52:24:35"; @@ -258,7 +264,25 @@ with lib; ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration '') ) ["x86_64-linux"] - ); + ) ++ [ + (let + eosBuild = (flake.nixosConfigurations.eos.extendModules { + modules = [ + ({ ... }: { + config.nfsroot.storeDevice = "10.141.0.1:nix-store"; + config.nfsroot.registrationUrl = "http://nfsroot.vidhar.yggdrasil/eos/registration"; + }) + ]; + }).config.system.build; + in builtins.toPath (pkgs.runCommandLocal "eos" {} '' + mkdir -p $out/eos + install -m 0444 -t $out/eos \ + ${eosBuild.initialRamdisk}/initrd \ + ${eosBuild.kernel}/bzImage \ + ${eosBuild.netbootIpxeScript}/netboot.ipxe \ + ${pkgs.closureInfo { rootPaths = eosBuild.storeContents; }}/registration + '')) + ]; }; }; }; -- cgit v1.2.3