From 0c70c633717d57e099fa829ade8a195258a10ebc Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Sun, 19 Jul 2026 14:12:38 +1000 Subject: [PATCH] Restructure build outputs into iso/lxc/pxe/all, fix broken LXC tarball MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit proxmox-lxc.nix was missing nixpkgs's own nixos/modules/virtualisation/proxmox-lxc.nix — the module that actually provides system.build.tarball — so nix build .#images (the old combined target) failed with "attribute 'tarball' missing" for the LXC half. Importing it (enabled by default) fixes this with no other config needed. flake.nix packages now expose exactly four targets instead of the previous ad-hoc netboot-ipxe/netboot-initrd/netboot-kernel/images: - iso — installer ISO/netboot image - lxc — Proxmox LXC installer tarball - pxe — the three netboot components, bundled - all — iso + lxc + pxe, bundled README updated to match (Build Targets section replaces the stale nixos-generators-based instructions). Co-Authored-By: Claude Sonnet 5 --- README.md | 36 ++++++++++-------------------------- flake.nix | 34 ++++++++++++++++------------------ proxmox-lxc.nix | 3 ++- 3 files changed, 28 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index ac2e577..8332954 100644 --- a/README.md +++ b/README.md @@ -71,35 +71,20 @@ The target machine requires: * A disk defined by its Disko configuration. * SSH access or local console access. -## Build The Installer ISO +## Build Targets -From the repository root: +Four packages, built directly from `nixosConfigurations.*` via +`system.build.*` (no `nixos-generators` dependency): ```sh -nix build +nix build .#iso # installer ISO/netboot image (nixosConfigurations.installer) +nix build .#lxc # Proxmox LXC installer tarball (nixosConfigurations.proxmox-lxc) +nix build .#pxe # netboot-ipxe + netboot-initrd + netboot-kernel, bundled +nix build .#all # all three of the above, bundled ``` -The generated installer ISO will be available through the `result` symlink. - -The ISO is generated using: - -```nix -nixos-generators.nixosGenerate { - format = "install-iso"; -} -``` - -## Build Netboot Components - -The flake also exposes netboot components: - -```sh -nix build .#netboot-ipxe -nix build .#netboot-initrd -nix build .#netboot-kernel -``` - -These can be used to PXE boot the installer environment. +Each one is available through the `result` symlink afterward (`result/iso/`, +`result/tarball/`, or the bundle's subdirectories for `pxe`/`all`). ## Use The Installer @@ -289,8 +274,7 @@ it as required unless you've specifically confirmed otherwise. will fail on first boot regardless of step 4 below. **4. Build and boot the installer image** on the target machine (ISO, - netboot, or Proxmox LXC — see "Build The Installer ISO" / "Build - Netboot Components" above). + netboot, or Proxmox LXC — see "Build Targets" above). **5. Copy the generated private key onto the live installer environment** once it's reachable over SSH: diff --git a/flake.nix b/flake.nix index 0eaa375..a23786b 100644 --- a/flake.nix +++ b/flake.nix @@ -84,28 +84,26 @@ # nix build .#name # - packages.${system} = { + packages.${system} = rec { - netboot-ipxe = - netbootSystem.config.system.build.netbootIpxeScript; + iso = + self.nixosConfigurations.installer.config.system.build.isoImage; + lxc = + self.nixosConfigurations.proxmox-lxc.config.system.build.tarball; - netboot-initrd = - netbootSystem.config.system.build.netbootRamdisk; + pxe = + pkgs.linkFarm "pxe" [ + { name = "netboot.ipxe"; path = netbootSystem.config.system.build.netbootIpxeScript; } + { name = "initrd"; path = netbootSystem.config.system.build.netbootRamdisk; } + { name = "kernel"; path = netbootSystem.config.system.build.kernel; } + ]; - - netboot-kernel = - netbootSystem.config.system.build.kernel; - images = - pkgs.linkFarm "images" [ - { - name = "installer-iso"; - path = self.nixosConfigurations.installer.config.system.build.isoImage; - } - { - name = "proxmox-lxc"; - path = self.nixosConfigurations.proxmox-lxc.config.system.build.tarball; - } + all = + pkgs.linkFarm "all" [ + { name = "iso"; path = iso; } + { name = "lxc"; path = lxc; } + { name = "pxe"; path = pxe; } ]; }; diff --git a/proxmox-lxc.nix b/proxmox-lxc.nix index 23c0884..305c286 100644 --- a/proxmox-lxc.nix +++ b/proxmox-lxc.nix @@ -1,8 +1,9 @@ -{ pkgs, ... }: +{ modulesPath, ... }: { imports = [ ./common.nix + (modulesPath + "/virtualisation/proxmox-lxc.nix") ];