{ netbootSystem, ... }: let # config.system.build.kernel and .netbootRamdisk are directories, not the # files themselves — nixpkgs' own system.build.kexecTree does the same # ${...}/ dereference for the same reason. inherit (netbootSystem.config.system.boot.loader) kernelFile; in { # Builds this flake's own installer netboot image (the same one # `nix build .#pxe` produces) and stages it where menu.ipxe's :nixos # entry expects it, so the pxe-boot host is self-contained — no manual # operator step to populate /srv/pxe/http/nixos after deploy. systemd.tmpfiles.rules = [ # Declared here too (not just in build-types/pxe-boot.nix) so this # module's C+ rules don't depend on cross-module list-merge ordering — # tmpfiles' C type needs the target directory to already exist. "d /srv/pxe/http/nixos 0755 root root -" "C+ /srv/pxe/http/nixos/${kernelFile} 0644 root root - ${netbootSystem.config.system.build.kernel}/${kernelFile}" "C+ /srv/pxe/http/nixos/initrd 0644 root root - ${netbootSystem.config.system.build.netbootRamdisk}/initrd" "C+ /srv/pxe/http/nixos/netboot.ipxe 0644 root root - ${netbootSystem.config.system.build.netbootIpxeScript}/netboot.ipxe" ]; }