refactor(nixos): architecture overhaul #128

Merged
nick merged 59 commits from nick/dotfiles:architecture into main 2026-11-17 17:41:21 -05:00
Owner
No description provided.
nick added 59 commits 2026-11-17 17:40:53 -05:00
Step 1 of docs/architecture.md. Every field in lib/options and
lib/records.nix is inventoried with its readers in
docs/architecture-inventory.md, the plan's mapping is corrected from what
the inventory found, and what nothing read is gone: 231 fields (660 to
429), the audiobookshelf and zookeeper records, the schema options no
record set, the records.nix constants no record used, and the let
bindings and inherits those deletions orphaned.

Corrections to the plan: forgejo's guest reads microvm.ssh (kept on that
one record); the Firefox bookmarks in home-manager read label, short and
tags for nine services (kept there); 30 home-manager files read the
records, so step 6 waits for them or they read nodes in step 5.

Every derivation is unchanged except the forgejo guest and the ceres and
mars systems, whose only differing leaf is the repo source copied by
forgejo-branding and peertube-branding.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 2 of docs/architecture.md. lib/nodes holds the host schema, the
resolver (link-derived address, gateway, tag and ports; the checks) and
the builder, which imports a host's own directory, its people's profiles,
its enabled features, the modules it still names, common/hosts and
common/all, passing `node` and `nodes` as specialArgs. features/ and
common/ wrap today's modules through flake.lib.legacy until their code
moves in. systems/ceres becomes nodes/hosts/ceres with a record.nix, and
leaves the hand list in flake.nix.

Every derivation is unchanged apart from the three branding ones. ceres
also reorders environment.systemPackages and systemd.tmpfiles.rules,
because today's one alphabetical bundle interleaves features and guests
by their old names; the built system-path trees are identical and the
rule sets equal, which the plan now states as the standard.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 3 of docs/architecture.md. nodes.workstations (mars, deimos,
lamdagibson) and nodes.routers (firewall) join nodes.hosts (ceres, eris),
sharing one record shape whose link may be null for a machine the network
data doesn't place. The builder picks common/<type>, and imports with a
person what assumes their account: nick brings environment, nh, ssh and
sops, which is exactly what lamdagibson lacked. crust's hardware is four
features; sixteen feature wrappers cover the rest of the old lists.

Only phobos and the two images remain in flake.nix's hand list.

The firewall's derivation is unchanged. ceres, deimos, eris and mars
reorder system-path (identical built trees), eris and mars the tmpfiles
rules (equal sets); lamdagibson reorders udev-rules and cups-progs
(identical trees, hwdb.bin byte-identical).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 4 of docs/architecture.md begins with the guest that has one
instance and few readers. nodes.guests.<service> holds a shared block and
numbered instances (link, vm, data share, features, the legacy names
pinned until cutover); the resolver finds each guest's host through its
link's range and refuses a homeless guest or a shared MAC; the builder
gives the host the homelab.microvms entry, with the service's guest.nix
as the guest and node/nodes as its arguments, and imports the service's
host.nix for what it asks of the host.

nodes/guests/jellyfin replaces modules/nixos/homelab/guests/jellyfin. The
jellyfin guest's derivation is unchanged; ceres reorders its tmpfiles
rules (equal sets).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Grafana, Loki, Mimir and Tempo move to nodes/guests/<service>. Grafana
reaches the other three at their links' addresses through `nodes` and
takes its public name from the site that points at its link (`node.sites`,
new in the resolver); Tempo's OTLP ports come from the link's `otlp`
range. The four guests' derivations are unchanged, and so is ceres apart
from branding.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Forgejo, Mastodon, OpenCloud, PhotoPrism, Vaultwarden, the torrent stack
and the four Minecraft worlds move to nodes/guests/<service>: the old
guest config becomes guest.nix with node/nodes in place of the record
reads (ports from the link, the public name from the site, Forgejo's SSH
port from the link, which retires the record's `microvm.ssh` reader), the
old wrapper becomes host.nix less what the record now says, and
Minecraft's worlds are one record with four instances over a shared block
and a properties file per world.

An instance can be `enable = false`: the placement stays on record and
builds nothing. The unused OpenCloud-on-eris and Vaultwarden-for-the-
project-site wrappers become such instances. The data share's mode moves
to the record, and the builder only sets the share when the record
enables it, so PhotoPrism's host.nix can keep making a directory nothing
mounts, as today.

Every guest's derivation is unchanged, eris is unchanged, and ceres
reorders its tmpfiles rules (equal sets).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The four upRoot Nutrition services move from
modules/nixos/homelab/guests/uprootnutrition/ to nodes/guests/<service>:
uproot-frontend, uproot-backend, enaychi and uproot-routing, each one
record with a prod instance ("01", on ceres) and a dev instance ("02", on
mars) pinned to today's guest names. The old wrappers split in two: what ran
inside the guest becomes instances/<nn>/guest.nix, with the link's named
port, the neighbouring guests' addresses (`nodes.<name>.address`), the
frontend's site as the OpenID issuer and Loki's address and push port in
place of the record reads; what the wrapper set on the host beyond the
record-derived fields (secrets, the backend's shares, the encrypted
container, directories, mars's port) becomes instances/<nn>/host.nix. The
helpers follow the service that uses them: backendReadiness, databaseBackup,
discordArchiveStream and mapCells to uproot-backend, routingReadiness and
valhalla to uproot-routing. Prod and dev stay separate files: this pass is
placement, not factoring.

The dev links name no http port and mars's Caddy ports are not yet on its
record, so the dev frontends keep a literal 4321 and the dev backend's
origins still read the website record's `domain` and `hostPort`.

The resolver now places a guest on any machine whose link's `guests` range
holds the guest's link, not only a host: mars is a workstation and runs
the dev instances. The bare `enaychi` gitignore rule is told to leave
nodes/guests/enaychi alone.

Every guest's derivation is unchanged, mars and the forgejo guest differ
only in the branding sources, and ceres reorders `system-path` (identical
built tree) and its tmpfiles rules (113 each, equal sets: the websiteProd
block moves).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 4 of docs/architecture.md, continued: the two services with a prod
instance on ceres and a dev instance on mars.

peertube: nodes/guests/peertube/record.nix (instances "01" peertubeProd,
"02" peertubeDev; shared mem and the data share, mounted at /var/lib/peertube
from a state directory not named after the guest). The shared config is
service.nix, still a function of what differs per instance (web host and
port, issuer, dev's CA, aliases and tmp size); the plugin list and the
secrets staging, which both wrappers duplicated, moved into it. guest.nix
imports instances/<nn>/guest.nix, which applies service.nix, deletionSync
and, for prod, the failure alerts and the nightly dump. host.nix imports
instances/<nn>/host.nix: prod's shares, tmpfiles and secrets; dev's shares,
the CA share, the Caddy vhost, the hosts alias and the data-dirs oneshot.
branding.nix, the CSS, deletionSync and the scripts moved alongside; the
ceres videoProd Caddy config now imports branding.nix from there. The
peertubeRunner modules stay where they are (they are the feature).

compatiq: nodes/guests/compatiq/record.nix (instances "01" compatiq, "02"
compatIQDev; the database is the data share), one guest.nix that picks the
base URL and cookie flag from whether the instance has a public name, and
one host.nix for both, which files the secrets under the state directory's
name (compatiqProd, compatiqDev) as before. The dev architecture note moved
with it.

Where a value came from the service's own legacy record it now comes from
the link (node.ports.http on prod, node.address, node.sites) or the smtp
record; the dev links name no port, so 9000 and 4321 are written where the
prod link's port is read, as are mars's 4722 vhost port and localhost:4521.

lib/nodes/resolve.nix: a guest's host is any machine whose link's `guests`
range holds the guest's link, not only a `hosts` record, since mars (a
workstation) runs the dev guests.

Verification: every system's and guest's derivation path is unchanged but
ceres/forgejo, ceres and mars. Their leaves are forgejo-branding and
peertube-branding (source only) and, on ceres, nixos-tmpfiles.d, whose only
difference is the position of the five peertube rules (sorted rule sets
identical).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The per-host copies become one feature each, with their per-host values
in the records and the rest from the resolved nodes:

- alloy: hostname and the Loki and Mimir endpoints from node and nodes;
  the microvm module gives every guest the same module, and names the
  guest itself (alloy used to). A guest without a record (eris's
  WireGuard, until cutover) gets a minimal node.
- nfs: the exports, their fsid and squash user, and the clients by node
  name, each at the address the resolver gives it: its flat-LAN address
  (`lanAddress`, pinned in the record's `legacy.ip` until cutover), the
  firewall tunnel's (`tunnel` on the roaming machine's record), or
  ceres's own WireGuard (`legacy.tunnel`) until the firewall's replaces
  it. The exports text is byte for byte today's.
- restic: schedule, the host's own paths and the retention set
  (prune, the daily age ceiling, alerts) in the record; the guests'
  paths and excludes on their own records (`backup`), gathered by host.
  The sets are today's; the list order follows the guests' names, which
  restic ignores (it groups by host).
- sharedIds: the users and groups machines agree on for NFS, with the
  IDs in one file; each record says which it carries.
- caddy: a vhost and certificate per public name in network.sites, at
  the link's named port; the sites whose vhost says more than the
  default have a file by their name under features/caddy/sites. The two
  names whose VMs aren't deployed, which network.sites doesn't list
  yet, are the record's `alsoServes`. The Caddyfile is unchanged.

Every guest, eris, deimos, the firewall and lamdagibson are unchanged;
ceres differs only in restic's path and exclude lists (equal sets) and
mars only in branding.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The drawing asked each link's `nixos` field for its system; the nodes
say it now (the node that names the link, or the machine whose record
names the tunnel), as docs/architecture.md's rules want. The drawing's
derivation is unchanged. `links.*.nixos` keeps its other reader, the
resolver's agreement check, until step 6.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Home-manager gets `node` and `nodes` beside `flake` (modules/nixos/core/
homeManager), and the hand-listed systems (phobos and the two images)
get a node that is only a name, which the profiles pick the home module
by (the iso's hostname is `nixos`; its node is `iso`). The readers of
the old records that only wanted an address, a port or a public name
read the nodes now: the justfile's hosts (`lanAddress`), managarr's
apps (the torrent guest's named ports), espanso's and the search
engine's names (the guests' sites), and the wallpaper and profile
hostname checks become the names themselves. Ollama's API port is a
constant where crush and zed read it.

Firefox's self-hosted bookmarks still read `instances` for labels,
keywords and tags: they move into the bookmark module at step 6, with
the names of the nodes whose VMs aren't built. Every derivation is
unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The hosts' and workstations' own config reads `node` for its name and LAN
address, and inlines what only it used: the data disks' labels and mounts,
the ESP's mask. Ceres's own WireGuard and its clients read the records'
`legacy`: ceres and mars join deimos with their tunnel addresses, and the
clients' public keys are a new `legacy.key`, which ceres's server and eris's
WireGuard guest (now eris's own config, no longer a named module) both read.
Deimos's tunnel is its record's.

The five modules that read the records move into their features with the
reads converted: acme (its two DNS providers), forgejoRunner (Forgejo's site),
comfyui (its port from the link; its name a literal, since the ingress never
sees it), ollama (its two ports; the node's LAN address) and wireguardShared
(the flat LAN from `network.firewall.lan`, the other client from the records).
The dev stack's name is mars's `devTls` feature, which also makes the local CA
and runs the Caddy; each dev guest's vhost moves into its own host.nix at the
port mars's link names for it, as PeerTube's already was. PeerTube dev's port
stays a literal: naming it on the link is a firewall rule.

The guests' SMTP reads go through `flake.self.lib.mail` (lib/mail.nix); the
production site's and PeerTube's names are the nodes' sites, and the deletion
journals sit beside the backends' database shares. deploy-rs finds a link's
machine in the records. The unused per-machine bundles leave
modules/nixos/default.nix. Every derivation is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 6 of docs/architecture.md, the home-manager slice: nothing under
modules/home reads `services.instances` or `machines.devices` any more.

The Firefox "Self Hosted" bookmarks carry their own table of what shows a
service (label, keyword, tags), copied from the nine instance records that
kept `short` and `tags` for them. Where a service is reached comes from the
resolved nodes (address, the link's named ports, the public name from
`network.sites`) for jellyfin, forgejo, mastodon, torrent and vaultwarden,
and from the links directly for firefly-iii, ollama and syncthing, whose VMs
aren't built; their three public names, which `network.sites` can't list
yet, are literals in the table, as are the Router's Asus address, Readarr's
port (not on the link) and Firefly's 8084 (the link says 80). `nodes` is
threaded through firefox/default.nix and the bookmarks importer.

The desktop modules (hyprland, niri, plasma) compare the hostname with the
node names "mars"/"deimos" directly, and `flake.homeModules` is keyed by the
literal node names (the iso's is "iso"), keeping the `people` reads.

Every derivation is unchanged: the 37 drvPaths match the step-5 baseline
apart from the branding source leaves, and mars's bookmark list evaluates
byte for byte to today's.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Nothing built reads them: the nodes (lib/nodes) and the network data hold
what they held. lib/options keeps the people and the themes, and
lib/records.nix their helpers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The modules nothing imports stop reading `services.instances` and
`machines.devices` and move to where they would live if used (step 6 of
docs/architecture.md). Nobody enables them.

Guest services nobody runs become service directories with one disabled
instance, their link drawn as planned, today's name pinned as `legacy.name`:

- modules/nixos/homelab/guests/firefly-iii/{config,fireflyEris}
  -> nodes/guests/firefly-iii/{record,guest,host}.nix (firefly_priv)
- modules/nixos/homelab/guests/syncthing/{config,syncthingEris}
  -> nodes/guests/syncthing/{record,guest,host}.nix (syncthing_priv)
- modules/nixos/homelab/guests/openwebui/{config,openwebuiCeres}
  -> nodes/guests/openwebui/{record,guest,host}.nix (openwebui_priv; the
  old `ollama` record, so the guest is still named `ollama`)
- modules/nixos/homelab/guests/projectsite/projectSiteProd
  -> nodes/guests/projectsite/{record,guest,host}.nix with the two halves it
  composed, opencloud.nix and vaultwarden.nix, carrying the parameters the
  wrapper passed (projectsite_frontend_prod). Its imports of the removed
  vaultwarden/config and opencloud/config were already dangling.

Host-side orphans become features, which lib/nodes/options.nix turns into
record options nothing sets:

- modules/nixos/homelab/orphans/{glance,searx,midnight,defenseio}
  -> features/{glance,searx,midnight,defenseio}
- modules/nixos/services/ollamaCeres -> features/ollamaCeres

Record reads replaced: hostname compares read `node.name`; ceres's LAN
address is `nodes.ceres.lanAddress`; the three WireGuard addresses are
`nodes.{ceres,mars,deimos}.legacy.tunnel`; ports the links name come from
`node.ports.{http,searx}`; SMTP settings read `flake.self.lib.mail`;
jellyfin's public name is `nodes.jellyfin.sites`. Literals, each with a
comment, for what the network doesn't name: firefly's 8084/8081, syncthing's
21027/22000, Ollama's API 11434, glance's 3434, the project-site
Vaultwarden's 8085; the names nothing serves (finances, dashboard, search,
cloud./vault.<project site>); the acme certificate paths for dashboard and
search; `/run/secrets/searx-<secret>`; and the `web` record's two addresses
(0.0.0.0, 127.0.0.1). Glance's assets-path follows its directory.

The module index loses the three comment lines naming the old wrappers.
Every system's and guest's derivation is unchanged but the usual three
(branding source).
Brought onto the branch after the record deletion: the module list keeps the
branch's shorter form, and the mail reads use lib/mail.nix's names (`ports`,
`noReply`).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The firewall's tunnel replaces it, tested from away: the wireguardShared
feature on mars, ceres's server and mars's client interfaces, eris's
WireGuard guest, the DNS and WireGuard ports ceres opened for it, the NFS
export ceres gave deimos's tunnel address, and the records' `legacy.tunnel`
and `legacy.key`. The two orphan features that proxied through the tunnel
(glance, searx) use the links' addresses. The drawing has no off-network
guest left.

Changes ceres (the wg0 units and peers, wireguard-tools, the NAT's sysctl
and nftables, the exports file, the firewall ports), mars (the wg0 unit,
wireguard-tools) and eris (the guest). Deimos is unchanged. Deploy those
three to finish; the hosts' `wireguard/*` sops entries are now unread.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The project site's Vaultwarden is projectsite "01" (nodes/guests/projectsite),
which lends the same directory and secret to one VM with its OpenCloud; the
"02" instance from step 4 recorded the same placement twice. Nobody runs
either. Ceres's backup list names the project site now.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The owner will run it again, so vaultwarden "02" stays on record beside
projectsite "01" (which lends the same directory) until it gets a link.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Mars's four mounts dial ceres and eris at their links' addresses, and the
exports allow each client at its link's (features/nfs reads `address`), or at
its tunnel's for deimos, now on both hosts. No firewall change: mars's link
reaches anywhere, and nothing else mounts NFS. Deploy ceres and eris before
mars.

That leaves `legacy.ip` and `lanAddress` one reader: the host's own address
on untagged `lan`, the way in docs/network.md leaves to the owner. Deimos
loses its `legacy.ip`, which nothing at home ever saw. The justfile, the
bookmarks' desktop copies and Ollama's URL use the link's address, as
deploy-rs does.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
nodes/, network/, features/ and common/ in place of tiers, bundles and
lib/options; the firewall and the two images in the host table; phobos as
decommissioned; seven CI hosts; the deploy example at the link's address.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
A node names its link; nothing read the link's name for the node any more
except the resolver's agreement check and the host network module's lookup of
its own link, which now comes from the record (`node.link`). The firewall's
model and decoder lose the field too, and the golden network.json with them.
Every system's derivation is unchanged but the firewall's, whose network.json
and package are the change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 8 of docs/architecture.md starts with the features: the seventeen
features that were one line over flake.lib.legacy now hold their module's
code. guestHost keeps hostNetwork.nix beside it, hypr and wayland their
parts as sibling files, peertubeRunner its two runners as dev/ and nvidia/
with their patches. The relative paths into modules/nixos (homelab's
helpers, the guests' common.nix) and out of it (alloy, topology) are the
only edits, plus the unused bindings deadnix found in four files. The
phobos and crust bundles import the features directly.

Every derivation is unchanged but the branding leaves; ceres, mars and
phobos reorder system-path (identical trees), and deimos and mars reorder
nix.conf's substituters and keys (equal sets; Nix orders substituters by
each cache's own priority).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The second part of step 8 (docs/architecture.md). The bundles stay as they
were, so the modules move in as they were imported: common/all holds
determinate, locale, nix and sudo; what hosts and workstations share
(accounts, fonts, homeManager, rsync, sysStat, xserver) is common/desktop,
imported by both; common/workstations adds crust's disks, steam and
virtManager. common/routers still wraps nh and ssh, which a person brings
too, until people/ exists. The core, mantle, iso, crust and phobos bundles
list the files at their new places in the order they had.

Every record-built system is unchanged but the branding leaves; iso and
phobos reorder system-path (identical trees).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The builder's `people` table named four modules under modules/nixos
(core/environment, core/nh, core/ssh, sops) beside profiles/user0. They are
people/user0/{environment,nh,ssh,sops}.nix now, with a default.nix importing
them, and the table lists that directory beside the profile. common/routers
imports nh and ssh from there; the core, iso and mantle bundles list the new
paths in the order import-tree gave them; the sops module's defaultSopsFile
path is the one edit inside a moved file. The empty core/system module goes.

Every derivation is unchanged but the branding leaves; ceres, deimos, eris
and mars reorder `system-path` (identical built trees), which dbus-1 and the
dbus-broker, polkit and accounts-daemon units inherit. flake.lib.legacy has
one reader left, the firewall's `modules` (docs/architecture.md, step 8).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The firewall's seven modules move from modules/nixos/firewall into
nodes/routers/firewall/config beside the hardware files import-tree already
reads; its three data files become _bogons.nix, _leases.nix and _ruleset.nix
there, the underscore keeping import-tree off them while dhcp, nftables and
the ruleset import them by path. The record's `modules = ["firewall"]` goes,
with the option, flake.lib.legacy and the builder's use of it; nothing reaches
modules/nixos by directory name any more. modules/helpers.nix stays for
modules/home.

The ISO is images/iso (determinate, installer, platform, the owner's sops and
xserver as sibling files; flake.nix adds the profile and core) and the
firewall's installer images/firewallInstaller. modules/nixos/default.nix
keeps the four bundles phobos and the ISO import. The comments and docs that
named modules/nixos/firewall point at the new paths, five of them in the
firewall's Haskell package.

Every record-built system is unchanged but the branding leaves and the
firewall, whose one leaf is that package's src (the five comment lines); the
installer carries the firewall's closure and the tool, so it follows. The ISO
reorders system-path (identical built trees). phobos is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
phobos was recycled and never returns (owner, 2026-11-17). Its hand-written
system (systems/phobos), its flake.nix entry, the phobos, mantle and crust
bundles only it imported, its deploy-rs node, its justfile commands, its home
configuration, the phobos branch of defenseio's and midnight's sizing, its CI
matrix entry and the comments that named it go. modules/nixos/default.nix
keeps `core` alone, for the ISO.

Every remaining derivation is unchanged but the branding leaves and the
owner's justfile on deimos, mars and the ISO, which loses the two phobos
recipes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Only deimos's pair is read now (its tunnel to the firewall); the owner's,
the phone's, mars's and the old server pair went with ceres's own WireGuard
(docs/architecture.md, step 9).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 9 of docs/architecture.md. The hosts lose their foot on untagged lan
(legacy.ip, lanAddress, hostNetwork.lanAddress, the untagged VLAN on the
uplink and the bridge, br-vms-reapply); the bridge has no address and is
required-for-online at carrier. A guest's link is required and gives its
address, gateway, DNS and tag, so the hand-written flat-LAN path and its
192.168.50.1 default go, with the guests' legacy.ip/gateway and the
resolver's pinned. glance and searx lose their wg0 ports, the Router
bookmark reads router_1's lease, the bridge test runs without lan.

Leaves: ceres/eris/mars = the two bridge units and the dropped service;
the rest is the sops prune, the bookmark and branding paths. Running hosts
keep the foot until they are deployed (eris, ceres, mars).

Also records step 10's confirmed design: <service>-<role> names, one
guest.nix/host.nix per service with a roles block, and the rule that a
rename changes no data directory, share tag or secret path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 11.a of docs/architecture.md (owner: the dotfiles should be fully
dendritic). flake.nix imports lib, network, packages, parts and topology
whole with one import-tree; the value files they hold take the underscore
import-tree skips (_records, _mail, _users, _themes, _lib, _tests, _nixos,
the packages' callPackage files) and the pure aggregators go. The record
schema declares common.<tier>, features.<name>.{module,options},
images.<name>.module, home.modules/groups, nodes.*.module and the guests'
module/host; a person gets nixos. The builder takes a module by name where
its files fill the option and by path where they don't yet.

Leaves: the Haskell packages whose source directory holds a renamed file,
and branding paths. Nothing else evaluates differently.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 11.b of docs/architecture.md, in the shape of the owner's reference
(mightyiam/infra b45e9e1): every module is a flake.modules.<class>.<name>
through flake-parts' own modules flakeModule, and nothing imports another
module by path. common/<tier>/*.nix fill all, desktop, hosts, workstations
and routers; people/user0/*.nix fill people/nick/<piece> and the profiles
people/<person>; the routers take people/nick/nh and people/nick/ssh by
name, the ISO all, desktop and people/nick. The invented common/features/
images/home options from 11.a go; a feature's record fields will come from
flake.modules.record.<name>. The builder resolves names from
config.flake.modules.nixos and falls back to today's paths for the trees
not yet converted.

Leaves: system-path and the tmpfiles lines reorder on ceres, deimos, eris,
mars and the ISO with the same entries; the rest is branding paths. The
firewall and lamdagibson are byte-identical.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 11.c of docs/architecture.md. features/<name>/*.nix fill
flake.modules.nixos.<name>, and each feature's record fields (or an empty
entry) flake.modules.record.<name>, which is where the record schema now
takes the feature names from. hypr, wayland and peertubeRunner lose their
aggregator files; the runner's two builds pick themselves by the record's
gpu flag. The shared ID table becomes the flake option sharedIds, read by
the sharedIds and nfs features instead of a path; caddy's sites and the
glance and searx config trees take the underscore. Guests take alloy by
name from the guestHost feature.

Leaves: system-path, the tmpfiles lines and mars's nix.conf substituters
reorder with the same entries; cups follows a reordered cups-progs whose
tree is identical; the rest is branding paths.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 11.e of docs/architecture.md. A node's hardware files fill
nixosConfigurations/<node>, a service's guest.nix fills guests/<service>,
and its host.nix becomes guests/<service>/host: a module that applies the
instance's function to every enabled instance of the service on the node
it is built into (flake.lib.guestsOn), which the builder imports once per
service. The dispatchers' instance files, the Minecraft worlds, PeerTube's
service and CSS, the backend's and routing's probes and the project site's
two services take the underscore as values beside their module.

The homelab helpers become the flake option homelab (lib/homelab:
labHelpers, nasUsers, failureAlerts), read as flake.config.homelab by the
ingress sites, the nasDirs and restic features, the firewall's verify and
the hosts; PeerTube's branding fills homelab.peertubeBranding for the site
and the dev host. The guests' common module is guests/common, taking the
tag and address from node. nodes/ is read whole by import-tree; the
record.nix matcher and the builder's path fallbacks go.

Leaves: ceres and mars tmpfiles reorder with the same lines, system-path
identical, the rest branding paths.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 11.f of docs/architecture.md. images/iso/{installer,platform}.nix and
images/firewallInstaller/default.nix fill nixosConfigurations/<image>; the
ISO's own module names the all and desktop tiers and the owner it is built
with. The builder makes a system of every nixosConfigurations/<name> that
has no record, with node as only the name, so flake.nix's hand list goes
and images/ is read whole by import-tree.

No derivation changed beyond the branding source paths.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 11.g of docs/architecture.md. modules/home moves to home/; each program
module fills flake.modules.homeManager.<program>, and the groups (cli, dev,
files, fun, shell, utilities, desktop, theming, wayland, sharing) are modules
whose imports name their members in the order import-tree read them. hypr's
two parts fill hypr. The config/ and vault0 value directories take the
underscore, and the byte-identical claudeCode under gui/apps/tools, which
the old name table never reached, goes.

A record's people is now an attribute set whose home lists the modules and
groups that person gets on the node, checked against the class's names; the
profiles import those by name, and the ISO's module lists its own. The old
per-node tables (modules/home/default.nix, flake.homeModules), the
directoryImport helper and mkHome go, and home/ is read whole by import-tree.

Leaves: mars and deimos reorder home-manager-path (identical trees) and the
fonts.xml and user-environment that name it; every other system is
identical.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Step 11.h of docs/architecture.md. flake and nodes leave specialArgs
everywhere: a module reads people, aesthetics, homelab, network, the nodes
(config.nodes.all), inputs and self from the flake-parts module that
defines it, bound in an outer let under those names, and a value file takes
them as arguments from the module that calls it. The instance dispatchers
hand them on beside the module arguments; a host side keeps its function of
the instance record, applied with the flake's nodes. Home-manager gets node
alone, like the systems.

The drawing's NixOS module becomes flake.modules.nixos.topology, appended by
the builder and taken by name by the guest host. The four modules nothing
imported (gnome, the wireless config, logrotate, defenseioGpu) become
features no record enables, and modules/ is gone. README and docs/network.md
follow.

No derivation changed beyond the branding source paths; six of the eight
systems are byte-identical.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The owner's call: a module is referenced as an identifier, never as a
string naming it, so the file that declares flake.modules.homeManager.<name>
is the one source of that name. A record's people.<person>.home is now
`with config.flake.modules.homeManager; [ cli firefox … ]` (listOf
deferredModule; a wrong name is a missing attribute), and the profiles
import that list as it is.

No derivation changed beyond the branding source paths.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
Every guest resolves a role from its link's suffix, a tap name (vm<tag>, or
the pinned guest's legacy tap) and the peer instance of each service with the
same role; an unpinned guest is named <service>-<role>. The host sides of the
guests to be renamed bind today's name as `state` for their share tags,
sources, secret paths and sops keys, and the forgejo, mastodon and opencloud
records write the mount points their state uses, so a rename moves nothing on
disk. No derivation changes but the branding leaves.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
enaychi, peertube, uproot-backend, uproot-frontend and uproot-routing lose
their instances/<nn>/ files: each guest.nix and host.nix reads the guest's
role and keeps what differs in a `roles` block (values as role.<x>, the
options only one role defines as the imported module role.only); peers are
nodes.${node.peers.<service>}. Every host wrapper imports its host sides
instead of merging them. Leaves: ceres's tmpfiles rules reorder with equal
sets, its system-path builds an identical tree, and the dev enaychi's
Caddyfile takes prod's wording of one comment.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
features/caddy/_sites/<fqdn>.nix becomes _sites/<domain>/default.nix for the
registrable name and _sites/<domain>/subdomains/<label>.nix beneath it, the
TLD dropped from the file names; the torrent apps' shared shape sits with
its domain. The lookup splits the served name into those labels. No
derivation changes but the branding leaves.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
firefly-iii, photoprism, syncthing and vaultwarden lose their name pins: as a
priv service's single instance each keeps its name, so only the taps move to
vm<tag> (vm300, vm304 for the two that run). Nothing on disk changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
grafana, jellyfin, loki, mimir, tempo and torrent lose their name pins: each
keeps its name as its service's one priv instance, so only the taps move to
vm<tag>. Nothing on disk changes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The first rename with state: the guest's pin goes, its name becomes
forgejo-prod and its tap vm507; the runner feature reads it by the new name.
Its data, mount, secrets and backup paths were already literals, so only
the hostname, the microvm unit and /var/lib/microvms/<name> move (step 10).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The two home lookups that reached the guest by its old name followed the
rename; mars's derivation moves by the branding path alone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
mastodon-prod, opencloud-prod, compatiq-prod, minecraft-1…4, openwebui (the
disabled ollama) and projectsite-prod (disabled) lose their pins; the
minecraft worlds also lose their legacy taps. A priv service's numbered
instances parse their zero-padded numbers with toIntBase10. The Mastodon
bookmark and snippet read mastodon-prod. Every path, tag and secret the
guests use is a literal, so only hostnames, units and the microvm state
directories move.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
uproot-backend-prod, uproot-frontend-prod, uproot-routing-prod,
enaychi-prod and peertube-prod lose their pins. Their shares, secrets and
state names stay literals on the host side, so only hostnames, units and
the microvm state directories move.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
uproot-backend-dev, uproot-frontend-dev, uproot-routing-dev, enaychi-dev,
compatiq-dev and peertube-dev lose their pins, the last legacy blocks in the
records. State names, shares and secrets stay literals on the host side, so
only hostnames, units and the microvm state directories move.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
The plan records the renames (order, state copy, booted-vs-current check,
the order-only leaves) and marks the guests table and the legacy example as
history; the upRoot deployment doc, its agent notes, the PeerTube runner
README and compatiq's architecture note name the guests as they run now.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
common/ is gone: its thirteen files are the features nix, determinate,
locale, sudo, accounts, fonts, homeManager, rsync, sysStat, xserver, disks,
steam and virtManager, and what the owner's account brought (nh, ssh, sops,
environment) are features too, so nothing system-level sits under a
person's name and the builder adds nothing by node type. sops keeps the
module, the age key and the root-owned secrets; the owner's own secrets
moved into their account, which with profiles/ folded into people/ is one
directory and one module per person. Every record enables what its tier
gave it; the ISO names the same features (explicitly: `with` lost to the
let-bound home class). Leaves: system-path, tmpfiles and nix.conf
substituter order only; lamdagibson, the firewall, its installer and every
guest unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
home/parents listed fifteen plain packages for lamdagibson. Each is now a
module under cli/ or gui/ like every other program (vlc, spotify, gwenview,
googleChrome, naps2, xsane, uxplay, lutris from the stable channel,
cifsUtils, sshfs, ncdu), the Android tools reuse `android`, and where the
configured module of the same name brings more than that machine wants the
package alone is `<name>Plain`: firefoxPlain (the `firefox` module writes
profiles), flameshotPlain (the `flameshot` module starts a tray service),
vesktopPlain (the `vesktop` module installs Discord with nixcord). The
record names the fifteen in place of `parents`. Leaves: both homes'
home-manager-path reorders with an identical tree, and the fontconfig and
putter files that embed its path follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
flake.nix is the inputs, the import-tree call over the module trees and
the systems; the flake modules the inputs provide (pre-commit, treefmt,
flake-parts' `modules`) and the templates are parts/ modules like
everything else. Three inputs nothing read go: nixpkgs-2505, charm-nur and
wpaperd (the home module of that name uses nixpkgs' package). The lock
loses their nodes and nothing else; every system and guest is unchanged
but the branding leaves.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
refactor(flake): flat inputs
Some checks failed
CI / build (ceres) (pull_request) Has been cancelled
CI / build (deimos) (pull_request) Has been cancelled
CI / build (eris) (pull_request) Has been cancelled
CI / build (firewall) (pull_request) Has been cancelled
CI / build (lamdagibson) (pull_request) Has been cancelled
CI / build (mars) (pull_request) Has been cancelled
CI / check (pull_request) Has been cancelled
683d7f77c5
Every input is a bare url with no `follows`, so each builds against the
nixpkgs it ships with (owner: tooling stays project-specific), and the
system is a literal in place of the nix-systems input. The lock gains the
inputs' own nixpkgs nodes. Module-only inputs evaluate against the system's
pkgs and change nothing: eris, deimos, lamdagibson, the firewall, its
installer and the ISO are identical. mkElmDerivation's Snapshot tool and
compatiq's backend now come from their flakes' nixpkgs, so the Elm
frontend guests (torrent, enaychi, uproot-frontend, compatiq) and the
deploy-rs checks have new derivations; those guests restart on their next
deploy with the same sites.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dB3eMiG93gcJ3PG8jnkqe
nick merged commit 8a21175e11 into main 2026-11-17 17:41:21 -05:00
nick deleted branch architecture 2026-11-17 17:41:22 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
upRootNutrition/dotfiles!128
No description provided.