Commit Graph
60 Commits
Author SHA1 Message Date
beatzaplentyandClaude Sonnet 5 6cae8a2fcd Fix LXC installs never actually activating (bind-mount / onto /mnt)
LXC containers have no raw disk visible from inside them, only their
already-mounted root filesystem, so hosts like lxc-minimal have no
disko config and auto-install.sh's disko branch was a no-op. With
nothing pointing /mnt at anything, nixos-install (which defaults to
--root /mnt) built the new system into a disconnected empty directory
on the container's own root — never the filesystem it actually boots
from. After reboot, Proxmox just re-execs the *original* /sbin/init,
so the container silently keeps running the installer environment
forever, with the "installed" system sitting inert and unused.

Confirmed on a real lxc-minimal attempt: /etc/flake-target (stamped by
every nixos flake target) didn't exist post-"install", the only SSH
key present matched this installer's own common.nix rather than the
target flake's modules/common/configuration.nix, and sshd was still
socket-activated (nixpkgs' proxmox-lxc.nix default) rather than
running as the target's plain sshd.service.

Fix: bind-mount / onto /mnt when there's no disko config, so
nixos-install actually lands on the filesystem the container boots
from — installing NixOS in place rather than into a void.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 15:55:19 +10:00
beatzaplentyandClaude Sonnet 5 8d6ad63094 Wire nix-cache as a substituter into the installer image
Without this the installer only ever sees cache.nixos.org, which
doesn't carry sops-install-secrets — it's built straight from the
sops-nix flake's own Go source, not part of nixpkgs. Every install had
to compile it from scratch, which is what ran an 8GB LXC container's
disk out of space (Go toolchain fetch plus a large module tree of
small files, all on the same disk that needs to hold the rest of the
system).

Once sops-install-secrets has been built once anywhere and served via
the existing nix-cache/nix-serve setup (naturally happens the next
time nix-cache itself gets switched with the sops-nix changes), every
future install of any type fetches the pre-built binary instead of
rebuilding.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 15:27:12 +10:00
beatzaplentyandClaude Sonnet 5 dd2d3b5914 Fix prepare-host-key.sh: backticks in a double-quoted nix-shell --run
string were parsed as command substitution by the outer shell

The whole keygen+instructions block ran inside one big double-quoted
nix-shell --run "..." string. Markdown-style `keys:` backticks in the
instructions heredoc are live to the *outer* shell in that context (it
parses the string before nix-shell ever sees it) — bash tried to run a
command literally called "keys:", failed, and silently dropped the
backtick-quoted text from the output.

Split into two minimal, single-purpose nix-shell --run invocations
(keygen, then age derivation into a captured variable) and moved the
instructions to a plain heredoc in the outer script, where normal
quoting rules apply and there's nothing left to misinterpret. Also
resolves host-keys/ to an absolute path instead of the literal
./scripts/../host-keys/... that showed up in output before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 15:00:40 +10:00
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
beatzaplentyandClaude Sonnet 5 5a7bdea454 Document the sops-nix host-key pre-seeding process end-to-end
Adds a "Creating a New Machine" walkthrough tying together the steps
that were previously scattered or missing entirely: running
scripts/prepare-host-key.sh, editing .sops.yaml + sops updatekeys,
pushing nixos, scp'ing the key to the live installer, and verifying
/run/secrets after first boot.

Also fixes several places that still described the pre-refactor
layout (installer.nix as the sole config file, only the nixos user
triggering the installer, "Pre-Seeding..." section name that no
longer existed) to match the current common.nix/installer.nix/
proxmox-lxc.nix split.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 13:34:49 +10:00
beatzaplenty 9db659d54e updated 2026-07-19 13:29:35 +10:00
beatzaplentyandClaude Sonnet 5 02ea1929e5 Pre-seed SSH host keys so sops-nix secrets decrypt on first boot
sops-nix (in the nixos flake) derives each host's age decryption key
from its own /etc/ssh/ssh_host_ed25519_key at activation time, which
runs before systemd would otherwise generate that key on first boot
(sshd-keygen is a plain systemd service gated behind multi-user.target;
activation scripts run earlier). Without pre-seeding, secrets --
including the login password -- fail to decrypt on a fresh install's
very first boot.

- scripts/prepare-host-key.sh: run on the admin workstation before an
  install, generates the host's ed25519 keypair and prints the exact
  steps to register its derived age key in nixos/.sops.yaml and
  re-encrypt the affected secrets/*.yaml files.
- common.nix's auto-install.sh: after disko mounts /mnt and before
  nixos-install, installs a pre-seeded key from /root/host-keys/ into
  /mnt/etc/ssh/ if present, otherwise warns and asks for confirmation
  before continuing without one.
- installer.nix now imports common.nix (previously only proxmox-lxc.nix
  did), so the ISO/netboot path used for EFI VM installs gets the same
  auto-install.sh and pre-seed check, not just the LXC path.
- Also fixes a pre-existing stray backtick in the disko invocation that
  broke auto-install.sh's bash syntax entirely, independent of this
  change (found while rendering the script to verify the new logic).

README.md documents the new pre-flight workflow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 13:21:33 +10:00
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
beatzaplenty 48a879e2a0 enable lish console 2026-07-15 13:20:46 +10:00
beatzaplenty 2424a77da4 update mounts 2026-07-15 12:58:25 +10:00
beatzaplenty 4ab490b9ae remove exit for no disko config 2026-07-15 12:45:41 +10:00
beatzaplenty 96e8e39a45 add lsblk command 2026-07-15 10:29:49 +10:00
beatzaplenty 9d2d460640 add missing experimental features options to eval commands 2026-07-15 10:08:48 +10:00
beatzaplenty ebbae5e562 added exit back into script 2026-07-15 09:39:42 +10:00
beatzaplenty 7f5a06720e update .gitignore 2026-07-15 08:30:11 +10:00
beatzaplenty b3f5696daf Added .gitignore 2026-07-15 08:25:13 +10:00
beatzaplenty 90425148c3 remove exit from install script 2026-07-15 08:19:54 +10:00
beatzaplenty e326ea9d36 updated README 2026-07-15 07:42:10 +10:00
beatzaplenty 1f38ed3d8c removed disk actions and updated flake 2026-07-15 07:33:37 +10:00
beatzaplenty 3ebf411bc9 Update installer.nix 2026-06-02 22:08:45 +00:00
beatzaplenty 80966748ae updated outputs 2026-06-02 21:36:30 +00:00
beatzaplenty 61f73dd1d7 update lock 2026-06-02 21:12:22 +00:00
beatzaplenty fd68a32ad1 Update flake.nix 2026-06-02 20:57:35 +00:00
beatzaplenty 4e68d2cd26 Update flake.nix 2026-06-02 10:33:50 +00:00
beatzaplenty 655865e77a Update flake.nix 2026-06-02 10:32:14 +00:00
beatzaplenty bf0d980e6d Update flake.nix 2026-06-02 10:25:14 +00:00
beatzaplenty 0e79677059 Update installer.nix 2026-06-02 01:05:12 +00:00
beatzaplenty ec0c04d766 added readme and updated auto-install.sh script to dynamically derive hostnames from flake 2026-06-01 18:19:48 +10:00
beatzaplenty c4b14d3f83 modified: installer.nix 2025-07-21 18:46:32 +10:00
beatzaplenty 1249246dd9 modified: installer.nix 2025-07-21 18:45:56 +10:00
beatzaplenty c60990cdec modified: installer.nix 2025-07-21 18:45:32 +10:00
beatzaplenty 0fca2a029e modified: installer.nix 2025-07-21 18:44:48 +10:00
beatzaplenty 3c20a9944d modified: installer.nix 2025-07-21 18:44:07 +10:00
beatzaplenty 820328421e modified: installer.nix 2025-07-21 18:40:52 +10:00
beatzaplenty 92a36d87d9 modified: installer.nix 2025-07-21 18:30:16 +10:00
beatzaplenty e75946419b deleted: home.nix
modified:   installer.nix
2025-07-21 17:48:38 +10:00
beatzaplenty 4fe21b95af modified: flake.nix
modified:   installer.nix
2025-07-21 17:44:22 +10:00
beatzaplenty 48552c81d2 modified: flake.nix 2025-07-21 17:40:20 +10:00
beatzaplenty a32a70c0ba modified: home.nix 2025-07-21 17:37:50 +10:00
beatzaplenty 25119edb43 modified: home.nix 2025-07-21 17:36:40 +10:00
beatzaplenty 06e54f18ce modified: home.nix 2025-07-21 17:34:31 +10:00
beatzaplenty 32f7776aa4 modified: home.nix 2025-07-21 17:32:34 +10:00
beatzaplenty 60dc2b6342 modified: home.nix 2025-07-21 17:31:13 +10:00
beatzaplenty 948d4bd3bd modified: installer.nix 2025-07-21 17:28:31 +10:00
beatzaplenty 2c44b19359 modified: home.nix 2025-07-21 17:25:23 +10:00
beatzaplenty d83cf0c49b modified: flake.nix
new file:   home.nix
2025-07-21 17:24:08 +10:00
beatzaplenty bbf6496ca8 modified: installer.nix 2025-07-21 17:07:56 +10:00
beatzaplenty 5287daea14 modified: installer.nix 2025-07-21 17:06:52 +10:00
beatzaplenty 63a1207ff5 modified: installer.nix 2025-07-21 17:06:02 +10:00
beatzaplenty 3732e547e9 modified: installer.nix 2025-07-21 17:03:11 +10:00