iPXE Bootable NixOS Images with GitLab CI and Chainloading
NixOS, especially config.system.build.* can feel pretty esoteric some times. I’ve had my share of tussles with the infrastructure, but I have enough of an understanding to provide working examples and advice here. This guide is intended to help the reader set up loading custom NixOS images through CI artifacts and iPXE with the minimum of local infrastructure. It requires good knowledge of NixOS, a GitLab account, a DHCP server, and a server you can use for TFTP.
What is iPXE iPXE, also referred to as netboot in the NixOS codebase, is a network-integrated bootloader. It is built on top of regular PXE, a common standard supported by most (wired) NICs.