Commit Graph
67 Commits
Author SHA1 Message Date
beatzaplentyandClaude Sonnet 5 532dc03cfa Add tailscale-exit-node build type across all three platforms
Check NixOS configurations / eval-hosts (push) Failing after 10m47s
New build type dedicated to Tailscale exit-node capability, wired up for
linode/proxmox/lxc like every other build type (the lxc variant is the one
actually intended for deployment). Kept separate from the "server" host
rather than bundling exit-node capability onto it.

Trimmed modules/tailscale/exit-node.nix down to pure exit-node behavior:
dropped the old --advertise-routes=${vars.lanCidr} bundling (meaningless
for a Linode-hosted VPS with no path to the LAN), and switched
extraUpFlags -> extraSetFlags. Confirmed against nixpkgs' tailscale.nix
that extraUpFlags is only applied by tailscaled-autoconnect, which itself
only runs when services.tailscale.authKeyFile is set -- nothing in this
repo sets one, so the old flags would never have actually been applied.
extraSetFlags runs unconditionally via tailscaled-set on every boot, so
--advertise-exit-node self-reapplies once the operator has done the
one-time manual `tailscale up` auth.

Verified: all three new targets eval cleanly, nixpkgs-fmt/statix clean,
and a dry-run build of lxc-tailscale-exit-node's tarball resolves its full
closure including tailscaled-set.service.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
2026-07-20 13:38:39 +10:00
beatzaplentyandClaude Sonnet 5 9748a3f772 Fix lxc-* hosts having no host-key pre-seeding mechanism at all
Check NixOS configurations / eval-hosts (push) Failing after 10m48s
The real root cause behind the original nix-cache 502, traced all the way
through: modules/installer/host-keys.nix (which NIXOS_HOST_KEYS_DIR=...
--impure actually wires up) is only ever imported by the installer's own
modules/installer/common.nix -- modules/platforms/lxc.nix, which every
real lxc-* host build actually uses, never imported anything like it.
docs/auto-installer.md previously claimed NIXOS_HOST_KEYS_DIR bakes a key
into lxc-* tarballs "the same way it does for the ISO/PXE installer
images" -- that was never actually true; I wrote it without verifying the
mechanism existed for lxc.nix specifically.

In practice this meant every lxc-* container booted with a freshly
self-generated SSH host key that could never match whatever .sops.yaml
actually trusts for that target, so *every* secret -- not just
cache-priv-key -- silently failed to decrypt. No error surfaces in the
boot log for this: the activation step that installs secrets only runs
on a genuinely fresh first activation and silently no-ops once
/run/current-system already exists, so by the time anyone looks the
window has closed. Found by manually invoking sops-install-secrets
directly: "Error getting data key: 0 successful groups required, got 0".

Fixed by giving modules/platforms/lxc.nix the same key-baking mechanism
the installer has, but keyed to its own exact flake target and placing
the key directly at /etc/ssh/ssh_host_ed25519_key (no copy step to stage
for, unlike the installer's /etc/host-keys/ staging area -- an lxc-*
tarball has no install step). The target name comes in via
specialArgs.flakeTarget (new, set by flake.nix's mkTarget) rather than
being read back from config.environment.etc."flake-target" -- reading
that back from within a module that also contributes to
environment.etc is circular (confirmed: "infinite recursion
encountered").

Verified live end-to-end against the real test container (lxc-nix-cache,
VMID 100 on pve.sweet.home): destroyed it, rebuilt the tarball fresh with
the fix, recreated it, and confirmed /run/secrets/ now has all three
secrets this host needs (beszel-token, cache-priv-key, nix-github-token),
nix-serve is active (running), and curl http://localhost/nix-cache-info
succeeds both directly and through nginx.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
2026-07-20 12:29:01 +10:00
beatzaplentyandClaude Sonnet 5 a9a204eaf2 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
2026-07-20 08:04:08 +10:00
beatzaplentyandClaude Sonnet 5 f0fae441ca Authorize the WSL workstation as a nix-cache remote-builder client
Check NixOS configurations / eval-hosts (push) Failing after 11m55s
Adds debian@surface's existing SSH key (already used as its admin
key elsewhere in this repo) to vars.remoteBuilderAuthorizedKeys so
nix-cache will accept it as a distributed-build client once deployed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01La55Nsss8jZ7ZuzUV9mfot
2026-07-20 04:08:19 +10:00
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 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 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 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
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 a3230128b2 updated proxmox disko configuration
Check NixOS configurations / eval-hosts (push) Failing after 17m51s
2026-07-18 05:54:32 +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 8e8183e371 updated disko config
Check NixOS configurations / eval-hosts (push) Failing after 14m40s
2026-07-15 09:59:37 +10:00
beatzaplenty dea6bfec25 add linode disko config 2026-07-15 09:36:04 +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 bcfeb08b11 update hardware config 2026-07-14 20:50:21 +10:00
beatzaplenty e3ac63aefa update module path
Check NixOS configurations / eval-hosts (push) Failing after 14m47s
2026-07-13 19:49:45 +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
beatzaplenty dd80145e4f Update flake.nix
Check NixOS configurations / eval-hosts (push) Successful in 47m42s
2026-06-30 23:06:26 +00:00
beatzaplenty 545775fc26 clean up docker version config
Check NixOS configurations / eval-hosts (push) Failing after 7m1s
2026-06-28 17:48:04 +10:00
beatzaplenty 514fa3068a add overlay for docker version for flake.nix
Check NixOS configurations / eval-hosts (push) Failing after 7m8s
2026-06-28 17:31:02 +10:00
beatzaplenty ded8b7dd55 revert 8444fc370e
Check NixOS configurations / eval-hosts (push) Failing after 8m38s
revert Update flake.nix
2026-06-28 07:27:53 +00:00
beatzaplenty 8444fc370e Update flake.nix
Check NixOS configurations / eval-hosts (push) Failing after 17m57s
2026-06-28 07:26:51 +00:00
beatzaplenty bf0445ebd6 created pxe-boot configuration
Check NixOS configurations / eval-hosts (push) Successful in 32m25s
2026-06-01 17:34:51 +10:00
beatz174-bit 8b919d2d5a Fix pure eval and harden nix script bootstrap 2026-05-12 11:09:23 +10:00
beatzaplenty c6f6441907 Update flake.nix 2026-02-17 15:59:35 +00:00
beatzaplenty 3389c9549a Update flake.nix 2026-02-09 10:12:06 +00:00
beatzaplenty 25b8ebcad7 modified: flake.nix
new file:   hosts/kuma/configuration.nix
2025-12-17 14:34:23 +10:00
beatzaplenty d08951d46a modified: flake.nix 2025-12-17 14:31:09 +10:00
beatzaplenty 9eba317de0 modified: flake.nix 2025-12-17 14:30:15 +10:00
beatzaplenty 943c5324ca Update flake.nix 2025-12-16 11:42:35 +00:00
beatzaplenty a8f417b4f9 Update flake.nix 2025-12-16 11:41:38 +00:00
beatzaplenty 6f79daefc4 Update flake.nix 2025-12-16 10:56:47 +00:00
beatzaplenty b952075a1e Update flake.nix 2025-12-16 10:25:19 +00:00
beatzaplenty 0dc6c5099f modified: flake.nix
modified:   hosts/nixos/configuration.nix
2025-07-22 14:29:45 +10:00
beatzaplenty f4a849bbac modified: flake.nix
modified:   hosts/nixos/home.nix
2025-07-22 14:15:15 +10:00
beatzaplenty 0c2344098b modified: flake.nix 2025-07-22 14:10:44 +10:00
beatzaplenty ee44a2dafd modified: flake.nix 2025-07-22 14:09:08 +10:00
beatzaplenty ff014f6658 modified: flake.nix 2025-07-22 14:05:43 +10:00
beatzaplenty 35f2c457dd modified: flake.nix
modified:   hosts/nixos/home.nix
2025-07-22 13:59:42 +10:00
beatzaplenty 5a60d574d8 modified: flake.nix 2025-07-22 13:47:56 +10:00
beatzaplenty 08f6dd7347 modified: flake.nix 2025-07-22 13:37:24 +10:00
beatzaplenty 0228bdf429 modified: flake.nix 2025-07-22 13:33:45 +10:00