From 453c7b5513a2263be05287f439fe3a55fdcdf1a0 Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Tue, 21 Jul 2026 22:15:44 +0000 Subject: [PATCH] Fix PXE netboot installer hanging at boot (ISO/netboot module conflict) The netboot build composed ./modules/installer/iso.nix (which pulls in nixpkgs' installation-cd-minimal.nix) together with nixpkgs' netboot-minimal.nix. Both installation-cd-base.nix and netboot.nix set fileSystems."/" via the identical lib.mkImageMediaOverride (mkOverride 60) priority - genuinely conflicting root-filesystem strategies (ISO-by-label vs. netboot-tmpfs) at the same priority, and the ISO one was winning. Every netboot boot hung waiting for a device that can never exist outside a real CD/USB: A start job is running for /dev/disk/by-label/nixos-minimal-... Reproduced live: deployed a scratch lxc-pxe-boot on pve-test, pulled its built kernel/initrd, and booted them directly with QEMU to confirm the hang and capture full console output. netboot-minimal.nix's own chain (netboot-base.nix) already imports profiles/installation-device.nix independently, so common.nix's initialHashedPassword override still applies correctly with iso.nix removed from this composition. Rebuilt and re-booted the same way after the fix - full boot to a working shell with SSH up, no hang. --- flake.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 8e2587c..8549f40 100644 --- a/flake.nix +++ b/flake.nix @@ -119,10 +119,24 @@ # Same installer environment, built as netboot (kernel + initrd + # iPXE script) instead of an ISO — this is what packages.pxe bundles. + # + # Deliberately imports common.nix directly, NOT ./modules/installer/iso.nix + # (which pulls in nixpkgs' installation-cd-minimal.nix) -- confirmed live + # that composing the ISO module together with netboot-minimal.nix hangs + # every boot waiting for a device that can never exist on a netboot + # client ("A start job is running for /dev/disk/by-label/nixos-minimal-..."). + # Both installation-cd-base.nix and netboot.nix set fileSystems."/" via + # the identical lib.mkImageMediaOverride (mkOverride 60) priority -- + # genuinely conflicting root-filesystem strategies (ISO-by-label vs. + # netboot-tmpfs) at the same priority, and the ISO one was winning. + # netboot-minimal.nix's own chain (netboot-base.nix) already imports + # profiles/installation-device.nix independently, so common.nix's + # initialHashedPassword override (which assumes that profile is + # present) still applies correctly without iso.nix in the mix. netbootSystem = nixpkgs.lib.nixosSystem { inherit system; modules = [ - ./modules/installer/iso.nix + ./modules/installer/common.nix ({ modulesPath, ... }: { imports = [ (modulesPath + "/installer/netboot/netboot-minimal.nix")