summaryrefslogtreecommitdiff
path: root/hosts/vidhar/network
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2025-05-14 10:50:27 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2025-05-14 10:50:27 +0200
commit43c9825e49d25fbd2c19abcdeb8f73aee8be2a4c (patch)
treec1cc8a034395c9bb8188651f6835922b38887f32 /hosts/vidhar/network
parent03d49aa8ec6f51c8f51bfb628e614ac537cca8e0 (diff)
downloadnixos-43c9825e49d25fbd2c19abcdeb8f73aee8be2a4c.tar
nixos-43c9825e49d25fbd2c19abcdeb8f73aee8be2a4c.tar.gz
nixos-43c9825e49d25fbd2c19abcdeb8f73aee8be2a4c.tar.bz2
nixos-43c9825e49d25fbd2c19abcdeb8f73aee8be2a4c.tar.xz
nixos-43c9825e49d25fbd2c19abcdeb8f73aee8be2a4c.zip
...
Diffstat (limited to 'hosts/vidhar/network')
-rw-r--r--hosts/vidhar/network/dhcp/default.nix88
1 files changed, 42 insertions, 46 deletions
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 {
306 pkgs.symlinkJoin { 306 pkgs.symlinkJoin {
307 name = "installer-${system}"; 307 name = "installer-${system}";
308 paths = [ 308 paths = [
309 (let 309 (builtins.addErrorContext "while evaluating installer-${system}-nfsroot" (let
310 installerBuild = (flake.nixosConfigurations.${"installer-${system}-nfsroot"}.extendModules { 310 installerBuild' = (flake.nixosConfigurations.${"installer-${system}-nfsroot"}.extendModules {
311 modules = [ 311 modules = [
312 ({ ... }: { 312 ({ ... }: {
313 config.nfsroot.storeDevice = "${nfsIp}:nix-store"; 313 config.nfsroot.storeDevice = "${nfsIp}:nix-store";
314 config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/installer-${system}/registration"; 314 config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/installer-${system}/registration";
315 config.system.nixos.label = "installer-${system}";
315 }) 316 })
316 ]; 317 ];
317 }).config.system.build; 318 });
318 in builtins.toPath (pkgs.runCommandLocal "install-${system}" {} '' 319 installerBuild = installerBuild'.config.system.build;
320 in builtins.toPath (pkgs.runCommandLocal "installer-${system}" {} ''
319 mkdir -p $out/installer-${system} 321 mkdir -p $out/installer-${system}
320 install -m 0444 -t $out/installer-${system} \ 322 install -m 0444 -t $out/installer-${system} \
321 ${installerBuild.initialRamdisk}/initrd \ 323 ${installerBuild.initialRamdisk}/initrd \
322 ${installerBuild.kernel}/bzImage \ 324 ${installerBuild.kernel}/bzImage \
323 ${installerBuild.netbootIpxeScript}/netboot.ipxe \ 325 ${installerBuild.netbootIpxeScript}/netboot.ipxe \
324 ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration 326 ${pkgs.closureInfo { rootPaths = installerBuild.storeContents; }}/registration
325 '')) 327 install -m 0444 ${pkgs.writeText "installer-${system}.menu.ipxe" ''
326 (pkgs.writeTextFile {
327 name = "installer-${system}.menu.ipxe";
328 destination = "/installer-${system}.menu.ipxe";
329 text = ''
330 #!ipxe 328 #!ipxe
331 329
332 :start 330 :start
333 menu iPXE boot menu for installer-${system} 331 menu iPXE boot menu for installer-${system}
334 item installer installer-${system} 332 item installer ${with installerBuild'; "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"}
335 item memtest memtest86plus 333 item memtest memtest86plus
336 item netboot netboot.xyz 334 item netboot netboot.xyz
337 item shell iPXE shell 335 item shell iPXE shell
@@ -353,8 +351,8 @@ in {
353 :memtest 351 :memtest
354 iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin 352 iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin
355 goto start 353 goto start
356 ''; 354 ''} $out/installer-${system}.menu.ipxe
357 }) 355 '')))
358 ]; 356 ];
359 }) ["x86_64-linux"] 357 }) ["x86_64-linux"]
360 ) ++ [ 358 ) ++ [
@@ -366,15 +364,17 @@ in {
366 install -m 0444 ${sources.netbootxyz-efi.src} $out/netboot.xyz.efi 364 install -m 0444 ${sources.netbootxyz-efi.src} $out/netboot.xyz.efi
367 install -m 0444 ${sources.netbootxyz-lkrn.src} $out/netboot.xyz.lkrn 365 install -m 0444 ${sources.netbootxyz-lkrn.src} $out/netboot.xyz.lkrn
368 '') 366 '')
369 (let 367 (builtins.addErrorContext "while evaluating eostre" (let
370 eostreBuild = (flake.nixosConfigurations.eostre.extendModules { 368 eostreBuild' = (flake.nixosConfigurations.eostre.extendModules {
371 modules = [ 369 modules = [
372 ({ ... }: { 370 ({ ... }: {
373 config.nfsroot.storeDevice = "${nfsIp}:nix-store"; 371 config.nfsroot.storeDevice = "${nfsIp}:nix-store";
374 config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/eostre/registration"; 372 config.nfsroot.registrationUrl = "${nfsrootBaseUrl}/eostre/registration";
373 config.system.nixos.label = "eostre";
375 }) 374 })
376 ]; 375 ];
377 }).config.system.build; 376 });
377 eostreBuild = eostreBuild'.config.system.build;
378 in builtins.toPath (pkgs.runCommandLocal "eostre" {} '' 378 in builtins.toPath (pkgs.runCommandLocal "eostre" {} ''
379 mkdir -p $out/eostre 379 mkdir -p $out/eostre
380 install -m 0444 -t $out/eostre \ 380 install -m 0444 -t $out/eostre \
@@ -382,43 +382,39 @@ in {
382 ${eostreBuild.kernel}/bzImage \ 382 ${eostreBuild.kernel}/bzImage \
383 ${eostreBuild.netbootIpxeScript}/netboot.ipxe \ 383 ${eostreBuild.netbootIpxeScript}/netboot.ipxe \
384 ${pkgs.closureInfo { rootPaths = eostreBuild.storeContents; }}/registration 384 ${pkgs.closureInfo { rootPaths = eostreBuild.storeContents; }}/registration
385 '')) 385 install -m 0444 ${pkgs.writeText "eostre.menu.ipxe" ''
386 (pkgs.writeTextFile { 386 #!ipxe
387 name = "eostre.menu.ipxe";
388 destination = "/eostre.menu.ipxe";
389 text = ''
390 #!ipxe
391 387
392 set menu-timeout 5000 388 set menu-timeout 5000
393 389
394 :start 390 :start
395 menu iPXE boot menu for eostre 391 menu iPXE boot menu for eostre
396 item eostre eostre 392 item eostre ${with eostreBuild'; "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"}
397 item memtest memtest86plus 393 item memtest memtest86plus
398 item netboot netboot.xyz 394 item netboot netboot.xyz
399 item shell iPXE shell 395 item shell iPXE shell
400 choose --timeout ''${menu-timeout} --default eostre selected || goto shell 396 choose --timeout ''${menu-timeout} --default eostre selected || goto shell
401 set menu-timeout 0 397 set menu-timeout 0
402 goto ''${selected} 398 goto ''${selected}
403 399
404 :shell 400 :shell
405 set menu-timeout 0 401 set menu-timeout 0
406 shell 402 shell
407 goto start 403 goto start
408 404
409 :eostre 405 :eostre
410 chain eostre/netboot.ipxe 406 chain eostre/netboot.ipxe
411 goto start 407 goto start
412 408
413 :netboot 409 :netboot
414 iseq ''${platform} efi && chain --autofree netboot.xyz.efi || chain --autofree netboot.xyz.lkrn 410 iseq ''${platform} efi && chain --autofree netboot.xyz.efi || chain --autofree netboot.xyz.lkrn
415 goto start 411 goto start
416 412
417 :memtest 413 :memtest
418 iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin 414 iseq ''${platform} efi && chain --autofree memtest.efi || chain --autofree memtest.bin
419 goto start 415 goto start
420 ''; 416 ''} $out/eostre.menu.ipxe
421 }) 417 '')))
422 ]; 418 ];
423 }; 419 };
424 }; 420 };