This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nix-auto-installer/flake.nix
T
beatzaplentyandClaude Sonnet 5 0c70c63371 Restructure build outputs into iso/lxc/pxe/all, fix broken LXC tarball
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 <noreply@anthropic.com>
2026-07-19 14:12:38 +10:00

111 lines
2.3 KiB
Nix

{
description = "Auto-install NixOS ISO";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
nixos-conf-editor.url = "github:snowfallorg/nixos-conf-editor";
flake-utils.url = "github:numtide/flake-utils";
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, home-manager, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
netbootSystem = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./installer.nix
({ modulesPath, ... }: {
imports = [
(modulesPath + "/installer/netboot/netboot-minimal.nix")
];
})
];
};
in
{
#
# Complete NixOS systems
#
# These can be used with:
#
# nixos-rebuild switch --flake .#name
#
nixosConfigurations = {
installer =
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./installer.nix
];
};
proxmox-lxc =
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./proxmox-lxc.nix
];
};
};
#
# Buildable artifacts
#
# These are built with:
#
# nix build .#name
#
packages.${system} = rec {
iso =
self.nixosConfigurations.installer.config.system.build.isoImage;
lxc =
self.nixosConfigurations.proxmox-lxc.config.system.build.tarball;
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; }
];
all =
pkgs.linkFarm "all" [
{ name = "iso"; path = iso; }
{ name = "lxc"; path = lxc; }
{ name = "pxe"; path = pxe; }
];
};
};
}