ποΈArchitecture
The homelab is four layers, each managed as code in the infra repo, each with its own apply mechanism. Changes flow downward rarely; most day-to-day work happens in one layer at a time.
The four layers
Layer 1 β Bare metal (Architecture/NixOS)
NixOS configurations under
nix/for every physical host: Kubernetes nodes, Raspberry Pis, and a GCE VM. Declared inflake.nix, deployed withnixos-rebuild, self-healing via auto-upgrades that trackmain.
Layer 2 β Kubernetes (Architecture/Kubernetes)
Two clusters under
clusters/:folly(primary, on-site) andoffsite(backup), plusclusters/base/for shared resources. FluxCD reconciles manifests on merge; ArgoCD handles apps sourced from external repos.
Layer 3 β Cloud & network (Architecture/Terraform)
Terraform root modules under
terraform/: UniFi network fabric, Cloudflare DNS/tunnels, Tailscale, GCP organization and projects, Google Workspace, and Vault. Applies run through Atlantis on the PR β see ADR/0001 GitOps apply model.
Layer 4 β Applications (Architecture/Applications)
First-party code: deployable services in
apps/, reusable packages and Helm charts inpackages/, base/tool OCI images inimages/. Built by CI on change.
Cross-cutting concerns
Architecture/Networking β VLANs, BGP, Cilium load balancing, tunnels, and the cross-site fabric
Architecture/Secrets and PKI β SOPS/age, Vault, and the offline root CA
Architecture/GitOps β how a change actually ships, layer by layer
Fleet β the concrete hosts all of this runs on
Design principles
GitOps-first. Desired state lives in git; operators (Atlantis, Flux, ArgoCD, nixos auto-upgrade) apply it. Manual mutation of live infra is a bug, and out-of-band deploys get reverted by the machinery itself.
Single source of truth for network facts. Cluster IPs, CIDRs, ASNs, and API endpoints live in per-cluster
cluster-topologyConfigMaps consumed by Flux, Nix, and Terraform alike β ADR/0003 Cluster topology single source of truth.Decisions are recorded. Anything with lasting consequences gets an ADR.
Sub-pages
Linked references 4
Architecture Decision Records capture decisions with lasting consequences: the context that forced a choice, the choice made, and what it costs. They are the "why" behind Architecture.
Architecture β the four layers and how they fit together
Seeded Architecture (all four layers plus networking, secrets, and GitOps), Fleet, Runbooks (migrated from loose files in docs/), and backfilled ADRs 0001β0008.