Remove packages.all bundle and the installer's own proxmox-lxc target

Both existed only so the installer could boot as an LXC container and
nixos-install some other host from within it, but lxc-* targets are
already excluded from the install menu (nixos-install can't touch its
own running root filesystem), and now have their own direct tarball
path anyway. That left the installer's own LXC form with no real use
case, and packages.all with only two members worth bundling.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
This commit is contained in:
2026-07-20 08:04:08 +10:00
co-authored by Claude Sonnet 5
parent 288835db29
commit 2aa625d566
8 changed files with 42 additions and 64 deletions
+4 -4
View File
@@ -130,10 +130,10 @@ removing a host.
host be built as a standalone, `qm importdisk`-ready `.raw` image with no host be built as a standalone, `qm importdisk`-ready `.raw` image with no
install step — see `docs/proxmox-images.md`. install step — see `docs/proxmox-images.md`.
- `modules/boot/efi.nix` — systemd-boot + EFI vars, paired with the disko module. - `modules/boot/efi.nix` — systemd-boot + EFI vars, paired with the disko module.
- `modules/installer/` — the auto-installer environment (ISO/netboot/Proxmox - `modules/installer/` — the auto-installer environment (ISO, also served as
LXC): `common.nix` (shared config + the generated `auto-install.sh`), PXE netboot): `common.nix` (shared config + the generated
`iso.nix`/`proxmox-lxc.nix` (per-variant), `host-keys.nix` (optionally `auto-install.sh`), `iso.nix`, `host-keys.nix` (optionally bakes
bakes `host-keys/` into the image under `--impure`). See `host-keys/` into the image under `--impure`). See
`docs/auto-installer.md`. `docs/auto-installer.md`.
- `modules/pxe-boot/stage-installer-artifacts.nix` — builds the installer's - `modules/pxe-boot/stage-installer-artifacts.nix` — builds the installer's
netboot image and stages it on the `pxe-boot` host so its iPXE menu can netboot image and stages it on the `pxe-boot` host so its iPXE menu can
+1 -1
View File
@@ -53,7 +53,7 @@ nix eval --json .#nixosConfigurations --apply builtins.attrNames | jq -r '.[]'
| `modules/build-types/` | Build-type-specific config: what makes a system minimal/server/docker/gui/pxe-boot/nix-cache | | `modules/build-types/` | Build-type-specific config: what makes a system minimal/server/docker/gui/pxe-boot/nix-cache |
| `modules/common/` | Shared NixOS config, Home Manager, aliases imported by every host | | `modules/common/` | Shared NixOS config, Home Manager, aliases imported by every host |
| `modules/nix-cache/` | Binary cache and remote builder client/server modules | | `modules/nix-cache/` | Binary cache and remote builder client/server modules |
| `modules/installer/` | Auto-installer environment (ISO/netboot/Proxmox LXC) — see `docs/auto-installer.md` | | `modules/installer/` | Auto-installer environment (ISO, also served as PXE netboot) — see `docs/auto-installer.md` |
| `host-keys/` | Gitignored, locally-generated SSH host keys for the auto-installer — see `docs/auto-installer.md` | | `host-keys/` | Gitignored, locally-generated SSH host keys for the auto-installer — see `docs/auto-installer.md` |
| `docs/` | Operational notes for cache, builders, lock updates, boot services, the auto-installer, and Proxmox image builds | | `docs/` | Operational notes for cache, builders, lock updates, boot services, the auto-installer, and Proxmox image builds |
| `scripts/` | Codex setup, validation, and host-key-prep helpers | | `scripts/` | Codex setup, validation, and host-key-prep helpers |
+13 -10
View File
@@ -5,8 +5,9 @@ install any host exposed by its own `nixosConfigurations`. It was migrated
from a formerly-separate `nix-auto-installer` repo — everything it did now from a formerly-separate `nix-auto-installer` repo — everything it did now
lives here. lives here.
The installer provides a small NixOS install environment (ISO/netboot/Proxmox The installer provides a small NixOS install environment (ISO, or the same
LXC) with SSH access, Git support, and an interactive installation script. image netbooted via PXE) with SSH access, Git support, and an interactive
installation script.
Logging in as any user (root or `nixos`) runs `/etc/auto-install.sh`, Logging in as any user (root or `nixos`) runs `/etc/auto-install.sh`,
discovers available hosts from this same flake, lets the operator choose a discovers available hosts from this same flake, lets the operator choose a
target, applies that host's Disko storage configuration, installs NixOS, and target, applies that host's Disko storage configuration, installs NixOS, and
@@ -53,8 +54,6 @@ it does for the ISO/PXE installer images.
`installation-cd-minimal.nix` module plus `common.nix`. Also used, paired `installation-cd-minimal.nix` module plus `common.nix`. Also used, paired
with `netboot-minimal.nix`, to build the PXE netboot variant (see with `netboot-minimal.nix`, to build the PXE netboot variant (see
`docs/pxe-boot.md`). `docs/pxe-boot.md`).
- `modules/installer/proxmox-lxc.nix` — Proxmox LXC-specific: disables
bootloader options (containers don't need one) plus `common.nix`.
- `modules/installer/host-keys.nix` — optionally bakes pre-generated SSH - `modules/installer/host-keys.nix` — optionally bakes pre-generated SSH
host keys into the image; see "Host keys" below. host keys into the image; see "Host keys" below.
- `scripts/prepare-host-key.sh` — admin-workstation pre-flight tool, see - `scripts/prepare-host-key.sh` — admin-workstation pre-flight tool, see
@@ -63,22 +62,26 @@ it does for the ISO/PXE installer images.
Flake outputs: Flake outputs:
```nix ```nix
nixosConfigurations.installer # ISO/netboot installer image nixosConfigurations.installer # ISO/netboot installer image
nixosConfigurations.proxmox-lxc # Proxmox LXC-based installer image
packages.x86_64-linux.iso # installer ISO/netboot image packages.x86_64-linux.iso # installer ISO/netboot image
packages.x86_64-linux.lxc # Proxmox LXC installer tarball
packages.x86_64-linux.pxe # netboot-ipxe + netboot-initrd + netboot-kernel, bundled packages.x86_64-linux.pxe # netboot-ipxe + netboot-initrd + netboot-kernel, bundled
packages.x86_64-linux.all # all three of the above, bundled
``` ```
```sh ```sh
nix build .#iso nix build .#iso
nix build .#lxc
nix build .#pxe nix build .#pxe
nix build .#all
``` ```
There's no `nixosConfigurations.proxmox-lxc` (installer-boots-as-an-LXC-
container) or `packages.x86_64-linux.lxc`/`.all` anymore. Both existed only
to let the installer itself run as an LXC container so you could
`nixos-install` some *other* host from within it — but LXC targets are
excluded from the install menu (same bind-mount problem as any LXC
`nixos-install`), and now have their own direct tarball path anyway (see
"LXC hosts" above), which left the installer's own LXC form with no real
use case.
The `pxe` variant is also built automatically as part of the `pxe-boot` host The `pxe` variant is also built automatically as part of the `pxe-boot` host
itself (`modules/pxe-boot/stage-installer-artifacts.nix`) and served over itself (`modules/pxe-boot/stage-installer-artifacts.nix`) and served over
iPXE — see `docs/pxe-boot.md`. iPXE — see `docs/pxe-boot.md`.
+9 -17
View File
@@ -100,12 +100,6 @@
modules = [ ./modules/installer/iso.nix ]; modules = [ ./modules/installer/iso.nix ];
specialArgs = { inherit vars; }; specialArgs = { inherit vars; };
}; };
proxmox-lxc = nixpkgs.lib.nixosSystem {
inherit system;
modules = [ ./modules/installer/proxmox-lxc.nix ];
specialArgs = { inherit vars; };
};
}; };
# Same installer environment, built as netboot (kernel + initrd + # Same installer environment, built as netboot (kernel + initrd +
@@ -128,24 +122,22 @@
nixosConfigurations = generatedTargets // installerTargets; nixosConfigurations = generatedTargets // installerTargets;
# Buildable auto-installer artifacts (`nix build .#<name>`), migrated # Buildable auto-installer artifacts (`nix build .#<name>`). No `lxc`
# unchanged from nix-auto-installer's interface. # variant (installer-boots-as-an-LXC-container) or `all` bundle
packages.${system} = rec { # anymore — lxc-* and proxmox-* hosts deploy via their own tarball/
# disk-image outputs instead (see docs/auto-installer.md and
# docs/proxmox-images.md), which left the installer's own LXC form
# with no real use case: it's excluded from the install menu (same
# bind-mount problem as any LXC nixos-install target) and nothing
# else needed booting the installer itself as a container.
packages.${system} = {
iso = installerTargets.installer.config.system.build.isoImage; iso = installerTargets.installer.config.system.build.isoImage;
lxc = installerTargets.proxmox-lxc.config.system.build.tarball;
pxe = pkgs.linkFarm "pxe" [ pxe = pkgs.linkFarm "pxe" [
{ name = "netboot.ipxe"; path = netbootSystem.config.system.build.netbootIpxeScript; } { name = "netboot.ipxe"; path = netbootSystem.config.system.build.netbootIpxeScript; }
{ name = "initrd"; path = netbootSystem.config.system.build.netbootRamdisk; } { name = "initrd"; path = netbootSystem.config.system.build.netbootRamdisk; }
{ name = "kernel"; path = netbootSystem.config.system.build.kernel; } { name = "kernel"; path = netbootSystem.config.system.build.kernel; }
]; ];
all = pkgs.linkFarm "all" [
{ name = "iso"; path = iso; }
{ name = "lxc"; path = lxc; }
{ name = "pxe"; path = pxe; }
];
}; };
}; };
} }
+11 -13
View File
@@ -57,25 +57,23 @@
echo "Fetching available NixOS hosts from flake..." echo "Fetching available NixOS hosts from flake..."
# Two categories deliberately excluded from the menu: # Two categories deliberately excluded from the menu:
# lxc-* these build a config.system.build.tarball # lxc-* these build a config.system.build.tarball meant for
# meant for `pct restore` on Proxmox # `pct restore` on Proxmox directly, not an install.
# directly, not an install. Running # Running nixos-install against one here would
# nixos-install against one here would # bind-mount / onto /mnt and then refuse to touch the
# bind-mount / onto /mnt and then refuse to # filesystem it's currently running on see
# touch the filesystem it's currently # docs/auto-installer.md.
# running on see docs/auto-installer.md. # installer this *is* the installer image's own flake target,
# installer/proxmox-lxc these *are* the installer image's own # not a deployable host; "installing" it means
# flake targets, not deployable hosts; # nixos-install-ing a copy of the installer into
# "installing" one means nixos-install-ing # itself.
# a copy of the installer into itself.
mapfile -t options < <( mapfile -t options < <(
nix eval --json --no-use-registries --no-accept-flake-config --extra-experimental-features "flakes nix-command" \ nix eval --json --no-use-registries --no-accept-flake-config --extra-experimental-features "flakes nix-command" \
"''${FLAKE_BASE_URL}#nixosConfigurations" \ "''${FLAKE_BASE_URL}#nixosConfigurations" \
--apply builtins.attrNames \ --apply builtins.attrNames \
| jq -r '.[] | jq -r '.[]
| select(startswith("lxc-") | not) | select(startswith("lxc-") | not)
| select(. != "installer") | select(. != "installer")'
| select(. != "proxmox-lxc")'
) )
if [[ ''${#options[@]} -eq 0 ]]; then if [[ ''${#options[@]} -eq 0 ]]; then
-12
View File
@@ -1,12 +0,0 @@
{ modulesPath, ... }:
{
imports = [
./common.nix
(modulesPath + "/virtualisation/proxmox-lxc.nix")
];
# LXC has no bootloader
boot.loader.grub.enable = false;
boot.loader.systemd-boot.enable = false;
}
+2 -5
View File
@@ -57,9 +57,8 @@ for host in $hosts; do
nix eval --raw --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.toplevel.drvPath" nix eval --raw --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.toplevel.drvPath"
# lxc-* hosts deploy via a directly pct-restore-able tarball instead of # lxc-* hosts deploy via a directly pct-restore-able tarball instead of
# nixos-install (see docs/auto-installer.md); proxmox-* hosts (excluding # nixos-install (see docs/auto-installer.md); proxmox-* hosts can
# proxmox-lxc, the installer's own LXC target, which has no disko config) # alternatively be built as a standalone disk image (see
# can alternatively be built as a standalone disk image (see
# docs/proxmox-images.md). Both are otherwise-unvalidated buildable # docs/proxmox-images.md). Both are otherwise-unvalidated buildable
# surface, easy to silently break without this. # surface, easy to silently break without this.
case "$host" in case "$host" in
@@ -67,7 +66,6 @@ for host in $hosts; do
echo "==> $host (tarball)" echo "==> $host (tarball)"
nix eval --raw --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.tarball.drvPath" nix eval --raw --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.tarball.drvPath"
;; ;;
proxmox-lxc) ;;
proxmox-*) proxmox-*)
echo "==> $host (diskoImagesScript)" echo "==> $host (diskoImagesScript)"
nix eval --raw --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.diskoImagesScript.drvPath" nix eval --raw --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.diskoImagesScript.drvPath"
@@ -96,7 +94,6 @@ if [[ "$MODE" == "dry-run" ]]; then
echo "==> Dry-run build: $host (tarball)" echo "==> Dry-run build: $host (tarball)"
nix build --dry-run --no-link --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.tarball" nix build --dry-run --no-link --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.tarball"
;; ;;
proxmox-lxc) ;;
proxmox-*) proxmox-*)
echo "==> Dry-run build: $host (diskoImagesScript)" echo "==> Dry-run build: $host (diskoImagesScript)"
nix build --dry-run --no-link --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.diskoImagesScript" nix build --dry-run --no-link --no-use-registries --no-accept-flake-config ".#nixosConfigurations.${host}.config.system.build.diskoImagesScript"
+2 -2
View File
@@ -62,8 +62,8 @@ Generated: ${keyfile}(.pub)
a) Rebuild the installer image with all host-keys/ baked in (see a) Rebuild the installer image with all host-keys/ baked in (see
docs/auto-installer.md): docs/auto-installer.md):
NIXOS_HOST_KEYS_DIR="${keydir}" nix build .#iso --impure NIXOS_HOST_KEYS_DIR="${keydir}" nix build .#iso --impure
(or .#lxc / .#pxe / .#all — --impure is required since host-keys/ (or .#pxe — --impure is required since host-keys/ is gitignored and
is gitignored and flakes can't see it otherwise) flakes can't see it otherwise)
b) Or, for an image already built without keys, scp it in after boot: b) Or, for an image already built without keys, scp it in after boot:
scp ${keyfile}{,.pub} root@<target-ip>:/root/host-keys/ scp ${keyfile}{,.pub} root@<target-ip>:/root/host-keys/