NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.13k forks source link

Documentation: How do I generate iPXE files of a flake? #284715

Open MrHamel opened 9 months ago

MrHamel commented 9 months ago

Problem

No documentation exists for taking a flake and turning it into a series of iPXE boot files. I run the below commands, and I get the iPXE script (modified for my environment of course), kernel, and initrd. Another issue entirely is on boot, it panics saying "VFS: Unable to mount root fs..." and don't know what I'm doing wrong.

nix build --impure .\#nixosConfigurations.pxe.config.system.build.kernel .\#nixosConfigurations.pxe.config.system.build.netbootRamdisk .\#nixosConfigurations.pxe.config.system.build.netbootIpxeScript

Add a :+1: reaction to issues you find important.

MrHamel commented 9 months ago

Noticing as I go further into this adventure, the initrd file is zstd compressed. I don't know if that impacts anything, but I still run into that kernel panic, whether it's the compressed or uncompressed version.

mweinelt commented 9 months ago

I think you are looking for https://github.com/DeterminateSystems/nix-netboot-serve, which allows serving a NixOS system closure as an initrd over http/https.

MrHamel commented 9 months ago

I've read that and it seems like an unnecessary number of steps for the process, compared to using something like nixos-generators for ISOs and Proxmox LXC files.