ποΈArchitecture
The homelab is four layers, each managed as code in the infra repo, each with its own apply mechanism. Most day-to-day work happens in one layer at a time.
The four layers
Layer 1 β Bare metal (Architecture/NixOS)
NixOS configuration under
nix/for every host. Declared inflake.nix, deployed withnixos-rebuild, self-healing via auto-upgrades that trackmain.
Layer 2 β Kubernetes (Architecture/Kubernetes)
Two fully capable clusters under
clusters/:follyon-site andoffsiteat the remote site, withclusters/base/shared between them. FluxCD reconciles every manifest on merge. ArgoCD is installed as a Flux HelmRelease and currently owns no applications.What runs on each cluster: Architecture/Cluster Applications
Layer 3 β Cloud and network (Architecture/Terraform)
OpenTofu root modules under
terraform/, covering the network fabric and the cloud and identity estate. Applies run through Atlantis on the PR.
Layer 4 β Applications (Architecture/Applications)
First-party code: deployable services in
apps/, reusable packages and Helm charts inpackages/, base and tool OCI images inimages/.
Cross-cutting
Architecture/Networking β VLANs, BGP, Cilium load balancing, tunnels, and the cross-site fabric
Architecture/Secrets and PKI β SOPS/age, OpenBao, and the cluster CAs
Architecture/GitOps β how a change actually ships, layer by layer
Architecture/Spindrift β the deploy control plane and its explicit runtime ownership boundary
Architecture/Bosun β ephemeral microVM runners for CI, and the warm pool that keeps them ready
Architecture/kthx β quick sites with a database, a socket and a visitor identity, at
<name>.kthx.devFleet β the concrete hosts all of this runs on
Design principles
GitOps-first. Desired state lives in git; the operators β Atlantis, Flux, and NixOS auto-upgrade β apply it. Mutating live infrastructure by hand is a bug, and out-of-band changes get reverted by the machinery itself.
Network facts have one source. Cluster IPs, CIDRs, ASNs, and API endpoints live in the per-cluster
cluster-topologyConfigMaps, read by Flux, Nix, and OpenTofu alike. A conftest contract enforces the schema in CI.Point, don't restate. Documentation names the directory and lets the tree answer. A list written in prose is a list that goes stale.
Sub-pages
Linked references 3
Layer 2 of Architecture: two Kubernetes clusters under clusters/, reconciled by FluxCD on every merge to main. The Terraform bootstrap roots own CoreDNS and Flux itself; Flux owns post-bootstrap cluster state. ArgoCD is installed as a Flux HelmRelease and owns no applications; terraform/argo/ wires the provider and declares no resources. Reconciliation mechanics and the apply model live on Architecture/GitOps.
Architecture β the four layers and how they fit together
Seeded Architecture (all four layers plus networking, secrets, and GitOps), Fleet, and Runbooks.