Commit Graph
382 Commits
Author SHA1 Message Date
beatzaplentyandClaude Sonnet 5 0f7ab6fe7f Migrate nix-auto-installer into this flake
Folds the separate nix-auto-installer repo's build outputs into this
flake so it can build every auto-installer artifact it used to,
negating the need for that repo:

- modules/installer/{common,iso,proxmox-lxc}.nix — migrated from
  nix-auto-installer's common.nix/installer.nix/proxmox-lxc.nix.
- flake.nix gains nixosConfigurations.{installer,proxmox-lxc} and
  packages.x86_64-linux.{iso,lxc,pxe,all}, matching the original
  repo's interface (nix build .#iso / .#lxc / .#pxe / .#all).
- Dropped the live Gitea PAT baked into every installer image via
  environment.etc."git-credentials" — gitea.lan.ddnsgeek.com/beatzaplenty/nixos.git
  allows anonymous read, so the installer (which only ever reads the
  flake, never pushes) doesn't need a credential at all.
- installer_old.nix wasn't migrated — dead code, unreferenced by the
  source repo's flake.nix, and carried a second stale leaked token.
- The installer environment's own hardcoded login password hash is
  preserved as-is: sops-nix has no stable per-boot host key to derive
  an age key from on ephemeral installer media, so it can't reuse the
  same per-host secret mechanism the rest of this repo uses without
  separate design work.
- vars.adminSshKey / vars.dockerHost-style dedup: the installer's SSH
  authorized key and its FLAKE_BASE_URL domain were exact duplicates
  of values already in variables.nix / modules/common/configuration.nix,
  so both now reference the single source of truth instead.

Verified eval-equivalent for every existing host (drvPath-identical)
and confirmed the migrated auto-install.sh script renders byte-for-byte
identical to the source repo's output.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
2026-07-20 03:47:19 +10:00
beatzaplentyandClaude Sonnet 5 75aef6ba4c Refresh stale architecture docs
Check NixOS configurations / eval-hosts (push) Failing after 11m16s
CLAUDE.md's "Composition pattern" section still described the
pre-refactor layout (hosts/<host>/configuration.nix as a thin imports
list, hardware-configuration wired in from flake.nix) from before the
platform x build-type matrix landed. Rewrite it to match the current
mkTarget/host.nix architecture and the module moves from the prior
commit. Also fixes docs/nix-cache.md, which referenced a
modules/nix/ path that never existed in this repo.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
2026-07-20 02:58:25 +10:00
beatzaplentyandClaude Sonnet 5 bd65e71413 Reorganize loose modules into themed directories
Several single-purpose modules sat at modules/ root or in the
services/ catch-all despite the repo's established pattern of one
directory per concern (tailscale/, beszel/, docker/, nix-cache/):

- remote-builder-client.nix -> nix-cache/ (always co-included with
  nix-cache/client.nix in flake.nix's mkTarget, same buildType guard)
- set-locale.nix -> common/ (unconditionally imported by
  common/configuration.nix already)
- enable-ip-forwarding.nix -> networking/
- rotate-traefik-logs.nix -> traefik/rotate-logs.nix
- services/docker-health-to-gotify.nix and services/nextcloud-cron-job.nix
  -> docker/ (both only ever imported by the docker build type, same
  as the rest of modules/docker/*)

Pure path moves plus import-path updates in flake.nix,
common/configuration.nix, and build-types/docker.nix — verified
eval-equivalent (drvPath-identical) across representative hosts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
2026-07-20 02:58:09 +10:00
beatzaplentyandClaude Sonnet 5 3a821158ca Add parameterized beszel host-token helper module
hosts/server/host.nix and hosts/nix-cache/host.nix each hand-rolled the
same sops secret/template/environmentFile wiring for the beszel agent
token, differing only in the sops file path and template name. Factor
it into modules/beszel/host-token.nix ({ name, sopsFile }) so a third
host can adopt it without copy-pasting the boilerplate again. Also
drops two dead, stale commented-out HUB_URL lines left over from
before variables.nix grew a homeDomain var.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
2026-07-20 02:57:55 +10:00
beatzaplentyandClaude Sonnet 5 94bc27bcbb Extract ports, docker host, and remote-builder keys into variables.nix
Pulls the beszel hub / PVE / PBS ports, the docker-compose host's LAN
name, and the remote-builder client SSH keys out of scattered inline
literals across modules/hosts and into variables.nix as the single
source of truth, matching the existing pattern for other cross-host
references (nixCacheHost, nfsServerHost).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
2026-07-20 02:57:38 +10:00
beatzaplentyandClaude Sonnet 5 326e764f51 Switch LXC targets from NetworkManager to systemd-networkd
Check NixOS configurations / eval-hosts (push) Failing after 11m15s
boot.isContainer disables services.udev, which NetworkManager depends on
to enumerate devices — this left NM unable to reliably manage the
container veth, breaking DHCP-hostname registration in Pi-hole. It also
defaulted networking.useHostResolvConf to true, which assumes a
systemd-nspawn-style resolv.conf bind-mount that real Proxmox LXC doesn't
provide (nixpkgs' own proxmox-lxc.nix module forces this false for the
same reason). Also guard the networkmanager extraGroups membership in the
minimal/gui build-types, since that group only exists when NM is enabled.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
2026-07-20 01:16:29 +10:00
beatzaplenty bbc6124dc0 added lxc-nix-cache key 2026-07-19 17:22:20 +10:00
beatzaplenty b64ef613c3 updated sops keys
Check NixOS configurations / eval-hosts (push) Failing after 12m16s
2026-07-19 16:59:44 +10:00
beatzaplentyandClaude Sonnet 5 29d7059f70 Consolidate minimal-buildtype hosts onto a single nix-minimal identity
Check NixOS configurations / eval-hosts (push) Failing after 11m45s
linode-minimal, proxmox-minimal, and lxc-minimal now all share
hosts/nix-minimal/host.nix instead of three separate per-platform
host files with different hostnames — every minimal-buildtype host is
named nix-minimal regardless of which platform it runs on.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 16:30:02 +10:00
beatzaplentyandClaude Sonnet 5 e667215ea6 Enable boot.loader.initScript for LXC targets
LXC containers share the host kernel — Proxmox starts them by exec'ing
/sbin/init directly in the container's rootfs, no bootloader or initrd
involved at all. Without boot.loader.initScript.enable, that file
isn't wired to launch the current generation, so even a correctly
installed system (see the nix-auto-installer bind-mount fix, same
underlying issue) could still fail to come up after reboot. This is
exactly what nixpkgs' own virtualisation/proxmox-lxc.nix module sets
for the same reason.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 16:11:17 +10:00
beatzaplenty 9c0b74d731 updated sops keys
Check NixOS configurations / eval-hosts (push) Failing after 11m56s
2026-07-19 15:06:59 +10:00
beatzaplentyandClaude Sonnet 5 6dcbae5659 Centralize shared values into variables.nix
One file (variables.nix) holding every value that was previously
hardcoded and repeated across modules: LAN domain/CIDR, home/tailnet
domains, cross-host references (nix-cache substituter hostname, NFS
server hostname, remote-builder user), PXE/PBS IPs, timezone, and the
primary username.

Wired in via flake.nix's specialArgs (and home-manager's
extraSpecialArgs for the two home.nix files), so any module picks it
up by just adding `vars` to its function arguments — no explicit
import needed. Two hosts (nix-cache, server) now derive their own
networking.hostName from the same variable other hosts use to reach
them, so there's exactly one place to change either identifier.

Purely mechanical: every substituted value matches what was already
there, confirmed by identical toplevel .drv paths for all 17 targets
before and after.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 14:51:37 +10:00
beatzaplentyandClaude Sonnet 5 2f7831aea8 Migrate live secrets to sops-nix (Milestone 2)
Check NixOS configurations / eval-hosts (push) Failing after 11m5s
Audited the working tree and full git history for committed secrets
(gitleaks + trufflehog + manual grep, see secrets-inventory.md, kept
local/gitignored per the spec). Found: a password hash shared by root
and the nixos user across every host, two live Beszel monitoring
tokens, and a GitHub fine-grained PAT embedded in a home-manager
nix.conf.

Migrates all of them to sops-nix:
- .sops.yaml + secrets/*.yaml, encrypted for admin + the age keys
  derived (via ssh-to-age) from each live host's existing SSH host
  key — no new key material transferred to any machine.
- users.users.{root,nixos}.hashedPasswordFile replaces the inline
  hashedPassword shared by every target.
- The GitHub PAT moves from a home-manager-managed, store-visible
  nix.conf to a sops.templates-rendered file included via nix.conf's
  native !include, system-wide instead of per-user.
- Beszel TOKEN moves from `environment` (store-visible) to
  `environmentFile` (runtime-only via sops.templates); the dead
  commented-out docker token is removed from the tree entirely.

Added a tracked pre-commit hook (gitleaks protect --staged, wired via
core.hooksPath) so a secret can't be committed by accident again, and
documented the sops workflow in README.md.

Structural verification only: all 17 flake targets evaluate, and
`nix build --dry-run --no-link` succeeds for the three currently
deployed hosts. Per CLAUDE.md, actual `nixos-rebuild switch` — the
step that confirms secrets decrypt and services start on a real
machine — is left for manual verification.

Git history still contains the original plaintext secrets; scrubbing
history (Milestone 3) and rotating every credential (Milestone 4) are
separate, deliberately gated steps per remove-sensetive-info-refactor.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 12:46:39 +10:00
beatzaplentyandClaude Sonnet 5 c05e3a3821 Refactor flake targets into platform x build-type matrix
Check NixOS configurations / eval-hosts (push) Failing after 12m2s
Generates all nixosConfigurations from mkTarget(platform, buildType,
hostPath) instead of hand-written per-host blocks, so adding a new
platform or build type is a one-line addition. Per-machine identity
(hostname, hostId, secrets, stateVersion) moves into hosts/<name>/host.nix;
platform-specific config (hardware, boot, networking) into
modules/platforms/*.nix; build-type config (minimal/server/docker/gui/
nix-cache/pxe-boot) into modules/build-types/*.nix.

Old flat targets (nixos, docker, server, nix-cache, nix-minimal, pxe-boot)
are replaced by the 17-target <platform>-<buildtype> matrix; each new
target was verified to evaluate before its old counterpart was removed.
CI workflows and docs/aliases now discover hosts dynamically via
nixosConfigurations attrNames and /etc/flake-target instead of hardcoded
lists, so they can't drift from flake.nix again.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 12:03:33 +10:00
beatzaplentyandClaude Sonnet 5 0b090cab07 Sync host lists with flake.nix and add CLAUDE.md
Check NixOS configurations / eval-hosts (push) Successful in 34m44s
Remove the nonexistent kuma host and add the missing linode-minimal
host across README, AGENTS.md, docs, and CI eval workflows so they
match flake.nix's nixosConfigurations. Also add CLAUDE.md with
architecture/safety guidance for future Claude Code sessions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-19 09:48:05 +10:00
beatzaplenty 14accceb02 updated to efi boot and resolved module paths
Check NixOS configurations / eval-hosts (push) Failing after 25m24s
2026-07-19 06:27:22 +10:00
beatzaplenty 90baa168d1 remove swap label
Check NixOS configurations / eval-hosts (push) Failing after 14m52s
2026-07-18 08:14:39 +10:00
beatzaplenty d3ae41a031 updated to efi boot
Check NixOS configurations / eval-hosts (push) Failing after 14m57s
2026-07-18 07:52:30 +10:00
beatzaplenty a3230128b2 updated proxmox disko configuration
Check NixOS configurations / eval-hosts (push) Failing after 17m51s
2026-07-18 05:54:32 +10:00
beatzaplenty 1395fdaccc removed fileSystems definition for disko config
Check NixOS configurations / eval-hosts (push) Failing after 23m22s
2026-07-17 11:42:29 +10:00
beatzaplenty 8259e57191 update configuration
Check NixOS configurations / eval-hosts (push) Failing after 14m28s
2026-07-17 09:18:24 +10:00
beatzaplenty 9d42450c65 update grub config
Check NixOS configurations / eval-hosts (push) Failing after 14m19s
2026-07-15 13:23:09 +10:00
beatzaplenty add9a29908 disabled disko module
Check NixOS configurations / eval-hosts (push) Failing after 14m41s
2026-07-15 13:10:09 +10:00
beatzaplenty 13b0c028a1 updated mounts
Check NixOS configurations / eval-hosts (push) Failing after 14m18s
2026-07-15 12:59:08 +10:00
beatzaplenty fdc4ea4596 updated mounts
Check NixOS configurations / eval-hosts (push) Failing after 14m26s
2026-07-15 12:57:45 +10:00
beatzaplenty c2c86f0854 disabled disko in linode-minimal
Check NixOS configurations / eval-hosts (push) Failing after 14m31s
2026-07-15 12:47:35 +10:00
beatzaplenty 40b68c2e16 updated bios partition definition
Check NixOS configurations / eval-hosts (push) Failing after 14m33s
2026-07-15 11:44:03 +10:00
beatzaplenty 2ea39994f8 remove grub mount point
Check NixOS configurations / eval-hosts (push) Failing after 14m54s
2026-07-15 11:29:52 +10:00
beatzaplenty 331246a1cb remove bios type
Check NixOS configurations / eval-hosts (push) Failing after 18m43s
2026-07-15 11:25:25 +10:00
beatzaplenty 442e7986f2 added bios partition
Check NixOS configurations / eval-hosts (push) Failing after 14m28s
2026-07-15 11:22:21 +10:00
beatzaplenty 6064c69d3b removed duplicate boot entry
Check NixOS configurations / eval-hosts (push) Failing after 15m0s
2026-07-15 11:08:50 +10:00
beatzaplenty 56a2f3ff51 add boot loader path
Check NixOS configurations / eval-hosts (push) Failing after 15m4s
2026-07-15 11:05:12 +10:00
beatzaplenty a29efce29e remove file systems. they are defined in disko
Check NixOS configurations / eval-hosts (push) Failing after 14m22s
2026-07-15 10:29:10 +10:00
beatzaplenty 8e8183e371 updated disko config
Check NixOS configurations / eval-hosts (push) Failing after 14m40s
2026-07-15 09:59:37 +10:00
beatzaplenty 4c53cce35c update linode host folder name to linode-minimal
Check NixOS configurations / eval-hosts (push) Failing after 14m21s
2026-07-15 09:38:12 +10:00
beatzaplenty dea6bfec25 add linode disko config 2026-07-15 09:36:04 +10:00
beatzaplenty 04de84d03b updated flake
Check NixOS configurations / eval-hosts (push) Failing after 14m52s
2026-07-15 09:28:33 +10:00
beatzaplenty 7bfe8cb0b2 added disko configuration to remove disk formatting from auto installer
Check NixOS configurations / eval-hosts (push) Failing after 14m31s
2026-07-15 07:30:32 +10:00
beatzaplenty 8460eff2de Merge branch 'main' of https://gitea.lan.ddnsgeek.com/beatzaplenty/nixos
Check NixOS configurations / eval-hosts (push) Failing after 14m21s
2026-07-14 20:52:05 +10:00
beatzaplenty bcfeb08b11 update hardware config 2026-07-14 20:50:21 +10:00
beatzaplenty 783bda00c1 Update hosts/nix-minimal/configuration.nix
Check NixOS configurations / eval-hosts (push) Failing after 15m52s
2026-07-13 14:07:57 +00:00
beatzaplenty e3ac63aefa update module path
Check NixOS configurations / eval-hosts (push) Failing after 14m47s
2026-07-13 19:49:45 +10:00
beatzaplenty 4f1aff9a16 updated flake.lock
Check NixOS configurations / eval-hosts (push) Failing after 14m51s
2026-07-13 19:44:35 +10:00
beatzaplenty befab7f3c6 revert
Check NixOS configurations / eval-hosts (push) Failing after 15m29s
2026-07-13 19:22:10 +10:00
beatzaplenty b9610dbc9d update module path
Check NixOS configurations / eval-hosts (push) Failing after 15m0s
2026-07-13 19:19:39 +10:00
beatzaplenty b605d19870 update disko path
Check NixOS configurations / eval-hosts (push) Failing after 15m18s
2026-07-13 19:17:43 +10:00
beatzaplenty 679dfd80c0 added disko configuration
Check NixOS configurations / eval-hosts (push) Failing after 14m45s
2026-07-13 19:10:21 +10:00
beatzaplenty 298f615929 create linode flake
Check NixOS configurations / eval-hosts (push) Failing after 15m13s
2026-07-13 17:46:12 +10:00
beatzaplenty 5e17baba72 update common home path
Check NixOS configurations / eval-hosts (push) Failing after 15m15s
2026-07-13 16:07:17 +10:00
beatzaplenty 345b5ca657 moved common into modules
Check NixOS configurations / eval-hosts (push) Failing after 18m43s
2026-07-13 16:03:48 +10:00