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 a90e736743 Simplify installer into shared common.nix + per-platform targets
Replaces the single monolithic installer.nix (preserved as
installer_old.nix for reference) with a shared common.nix carrying the
install-script/user/SSH baseline, consumed by per-platform targets
(installer.nix for netboot/ISO, new proxmox-lxc.nix for the Proxmox
LXC-based flow). flake.nix drops the nixos-generators input in favor
of building images directly from each nixosConfiguration's
system.build.isoImage/tarball.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 13:12:46 +10:00

113 lines
2.2 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} = {
netboot-ipxe =
netbootSystem.config.system.build.netbootIpxeScript;
netboot-initrd =
netbootSystem.config.system.build.netbootRamdisk;
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;
}
];
};
};
}