From 43c9825e49d25fbd2c19abcdeb8f73aee8be2a4c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 14 May 2025 10:50:27 +0200 Subject: ... --- hosts/vidhar/network/dhcp/default.nix | 88 +++++++++++++++++------------------ 1 file changed, 42 insertions(+), 46 deletions(-) (limited to 'hosts/vidhar/network/dhcp/default.nix') diff --git a/hosts/vidhar/network/dhcp/default.nix b/hosts/vidhar/network/dhcp/default.nix index 098d3061..11460393 100644 --- a/hosts/vidhar/network/dhcp/default.nix +++ b/hosts/vidhar/network/dhcp/default.nix @@ -306,32 +306,30 @@ in { pkgs.symlinkJoin { name = "installer-${system}"; paths = [ - (let - installerBuild = (flake.nixosConfigurations.${"installer-${system}-nfsroot"}.extendModules { + (builtins.addErrorContext "while evaluating installer-${system}-nfsroot" (let + installerBuild' = (flake.nixosConfigurations.${"installer-${system}-nfsroot"}.extendModules { modules = [ ({ ... }: { config.nfsroot.storeDevice = "${nfsIp}:nix-store"; config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/installer-${system}/registration"; + config.system.nixos.label = "installer-${system}"; }) ]; - }).config.system.build; - in builtins.toPath (pkgs.runCommandLocal "install-${system}" {} '' + }); + installerBuild = installerBuild'.config.system.build; + in builtins.toPath (pkgs.runCommandLocal "installer-${system}" {} '' mkdir -p $out/installer-${system} install -m 0444 -t $out/installer-${system} \ ${installerBuild.initialRamdisk}/initrd \ ${installerBuild.kernel}/bzImage \ ${installerBuild.netbootIpxeScript}/netboot.ipxe \ ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration - '')) - (pkgs.writeTextFile { - name = "installer-${system}.menu.ipxe"; - destination = "/installer-${system}.menu.ipxe"; - text = '' + install -m 0444 ${pkgs.writeText "installer-${system}.menu.ipxe" '' #!ipxe :start menu iPXE boot menu for installer-${system} - item installer installer-${system} + item installer ${with installerBuild'; "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"} item memtest memtest86plus item netboot netboot.xyz item shell iPXE shell @@ -353,8 +351,8 @@ in { :memtest iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin goto start - ''; - }) + ''} $out/installer-${system}.menu.ipxe + ''))) ]; }) ["x86_64-linux"] ) ++ [ @@ -366,15 +364,17 @@ in { install -m 0444 ${sources.netbootxyz-efi.src} $out/netboot.xyz.efi install -m 0444 ${sources.netbootxyz-lkrn.src} $out/netboot.xyz.lkrn '') - (let - eostreBuild = (flake.nixosConfigurations.eostre.extendModules { + (builtins.addErrorContext "while evaluating eostre" (let + eostreBuild' = (flake.nixosConfigurations.eostre.extendModules { modules = [ ({ ... }: { config.nfsroot.storeDevice = "${nfsIp}:nix-store"; config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/eostre/registration"; + config.system.nixos.label = "eostre"; }) ]; - }).config.system.build; + }); + eostreBuild = eostreBuild'.config.system.build; in builtins.toPath (pkgs.runCommandLocal "eostre" {} '' mkdir -p $out/eostre install -m 0444 -t $out/eostre \ @@ -382,43 +382,39 @@ in { ${eostreBuild.kernel}/bzImage \ ${eostreBuild.netbootIpxeScript}/netboot.ipxe \ ${pkgs.closureInfo { rootPaths = eostreBuild.storeContents; }}/registration - '')) - (pkgs.writeTextFile { - name = "eostre.menu.ipxe"; - destination = "/eostre.menu.ipxe"; - text = '' - #!ipxe + install -m 0444 ${pkgs.writeText "eostre.menu.ipxe" '' + #!ipxe - set menu-timeout 5000 + set menu-timeout 5000 - :start - menu iPXE boot menu for eostre - item eostre eostre - item memtest memtest86plus - item netboot netboot.xyz - item shell iPXE shell - choose --timeout ''${menu-timeout} --default eostre selected || goto shell - set menu-timeout 0 - goto ''${selected} + :start + menu iPXE boot menu for eostre + item eostre ${with eostreBuild'; "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"} + item memtest memtest86plus + item netboot netboot.xyz + item shell iPXE shell + choose --timeout ''${menu-timeout} --default eostre selected || goto shell + set menu-timeout 0 + goto ''${selected} - :shell - set menu-timeout 0 - shell - goto start + :shell + set menu-timeout 0 + shell + goto start - :eostre - chain eostre/netboot.ipxe - goto start + :eostre + chain eostre/netboot.ipxe + goto start - :netboot - iseq ''${platform} efi && chain --autofree netboot.xyz.efi || chain --autofree netboot.xyz.lkrn - goto start + :netboot + iseq ''${platform} efi && chain --autofree netboot.xyz.efi || chain --autofree netboot.xyz.lkrn + goto start - :memtest - iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin - goto start - ''; - }) + :memtest + iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin + goto start + ''} $out/eostre.menu.ipxe + ''))) ]; }; }; -- cgit v1.2.3