- HCL 77%
- Nix 23%
locally setups #
NixOS, k3s, and Terraform config for a small homelab plus cloud resources.
Visibility: Public repository (hosted on Tangled, where all repos are public). Use <tailnet>, <host>, and
<snapshot> placeholders in docs and examples. Keep tailnet names, bucket names, account IDs, and credentials out of
prose. Manifests that need real values must take secrets from sops-encrypted files, never plaintext.
Hosts #
Each host runs a single-node k3s cluster. Port maps and hardware are in the host READMEs.
locally0: GMKTec G3 (N150, 16 GB, 1 TB NVMe). Primary homelab: Home Assistant (the Matter server runs on NixOS), Miniflux, Dashy, NanoMQ (MQTT), VictoriaMetrics, VictoriaLogs, Perses, Gatus, Vector, Beszel, Pocket ID, feather-ai-proxy, Valkey, Databasus, gowitness, and the zot OCI registry.leno0: Lenovo ThinkCentre M715q (Ryzen 5 PRO 2400GE, 32 GB, 128 GB). Public-facing apps behind a Cloudflare Tunnel: Mastodon, Bluesky PDS, Tuwunel (Matrix) with hookshot, and Umami. It also runs RustDesk, Gatus, and Vector.
Each host dir has the same layout: services/ (k8s manifests), k3s-cert.sops.yaml (encrypted cluster-admin
kubeconfig; just k3s-decrypt <host> writes the plaintext k3s-cert.yaml), k3s/, and a README.md. NixOS config
lives in the central nixos/ tree, synced with just nix-upload <host> / just nix-download <host>.
Layout #
locally0/,leno0/: per-host k3s manifests, keyed by hostname.common/: cluster-shared manifests (services/,tailscale/). Recipes apply them per host withapply-common.nixos/: NixOS config for both hosts.infra/: Terraform for cloud resources (Scaleway, GCP, Bunny, DNS, storage buckets, IAM). State ininfra/state/.just/: splitjustrecipes per concern (nixos,k3s,kubernetes,services,backup,mqtt,encryption,common). The rootjustfileimports them, andjust --listshows the merged view.docs/: guides that span hosts and services. Seedocs/index.md..tangled/workflows/: CI on Tangled (lint.yml,test.yml)..agents/skills/: repo-local agent workflows shared across agent harnesses, including Feather model updates..env.<host>.sops.yaml: per-host sops-encrypted env (restic repository and credentials). Seedocs/secrets.md.
Setup #
just install # mise install: every tool pinned in mise.toml
just hooks-install # hk git hooks: format + lint staged files, gitleaks, commit-msg, pre-push
just pre-push # what CI runs: lint, format-check, typecheck, test
just lint: kubeconform (strict) over every tracked Kubernetes manifest.just format/just format-check: oxfmt for YAML, JSON, and Markdown, plusterraform fmtforinfra/.just typecheck/just test:terraform validateandterraform testininfra/, without backend or state.
CI runs the same recipes on Tangled, from .tangled/workflows/.
Kubernetes #
Deploy a service with its recipe (just miniflux, just monitoring, and so on). The recipes are in
just/services.just. They call kubectl apply against the live cluster, so the confirmation
rule in AGENTS.md applies. See AGENTS.md for the two ways to reach a cluster.
K3s stores its data in /var/lib/rancher/k3s on the host. just cp-k3s-storage <host> copies the local-path volume
data to the gitignored <host>/k3s/storage/ over scp. It is a plain copy, not a consistent backup, so database
files copied from a running pod can be torn. Use k8up for backups.