Infrastructure · ongoing

The homelab

Five servers, a laptop and a workstation, all described in one Nix flake. This is the part of the site that makes the rest of it checkable: when I say a stack holds up, there is a machine here that has been holding it up.

WhatDetail
MachinesFive servers, a laptop and a workstation
Managed byNix flakes — one directory per host, one shared module
Public entryOne wildcard DNS record, one host terminating TLS, one reverse proxy
AuthSSO in front of every subdomain
SecretsPer service, encrypted, in the same repository as the config
OperationsAn agent skill for every service, so an agent can administer what I run

What I need from it

A homelab is not a smaller datacentre. It has different requirements, and being honest about them is the only way the thing survives contact with a Tuesday evening:

The shape of it

A wildcard DNS record points at the router. The router forwards only web traffic to a single machine, and that machine does two jobs: it terminates TLS with Let's Encrypt certificates, and it reverse-proxies to services that live across the rest of the cluster. Everything else stays internal.

That one decision removes most of the operational surface. There is exactly one place where certificates are renewed, one place where a new service is published, and one place to look when a subdomain stops answering. The SSO provider sits on the same host, in front of the proxy, so the authentication decision happens before a request ever reaches an application.

The machines

Five servers, numbered rather than named for their roles, because roles move. The hostnames they actually answer to are the numbered names prefixed with the site's own — the flake targets stay short and the machines stay descriptive.

The laptop is the interesting one: it runs CachyOS, not NixOS, so it is managed by Home Manager instead of a system flake. Declarative user environments on a non-declarative distribution is the compromise that keeps the laptop usable and the dotfiles honest. It has its own review and deploy scripts, because if applying a home configuration is annoying, you stop doing it carefully.

One flake, one directory per host

The repository is deliberately boring:

Secrets live in their own directory tree, one folder per service, encrypted before they ever meet git. That layout is the reason adding a service is a small, reviewable diff rather than an afternoon of ssh and prayer.

What actually runs on it

By category, because the specific list changes every month:

Agents as operators

This is the part I'd point at first. Alongside the host configs sits a directory of agent skills — roughly one per service. Not documentation for humans: instructions an agent loads before it touches GitLab, Nextcloud, Authentik, Paperless, InvenTree, Firefly, PeerTube, the Matrix server, the proxy, the object store, or the secrets.

Each skill is the distilled version of "how to administer this without breaking it" — the commands, the order they go in, and the traps. The consequence is that routine administration stops being a thing I have to remember, and starts being a thing I can dispatch. It also means the knowledge is versioned next to the machine it applies to, so when a service is upgraded, its skill gets upgraded in the same review.

There is a certain circularity to it — agents running the infrastructure that runs the agents — and the honest answer is that it is circular, deliberately, and it has been the single largest change in how this lab is operated.

Deep dives

The rest of this is too specific to sit on one page. These are the pieces worth their own article:

← All work