󰣻 flake.nix — infrastructure overview
# ymrtech/nix-config — the public flake
# one declaration per machine, one module tree they all inherit
󰣨 tree -L 1
├── hosts/ # one directory per machine
├── modules/ # the services and roles those hosts enable
├── overlays/ # package overrides the hosts share
├── flake.nix # the entry point
└── flake.lock # every input pinned to a revision

What this is

My infrastructure is declared, not administered. Every machine is described in Nix code, the description lives in Git, and the running system is whatever the current revision says it is. Nothing is installed by hand on a live host, and nothing about a host’s state exists only on that host.

That has three consequences worth stating plainly: a change is reviewable before it happens, a machine is reproducible from its declaration, and a bad deploy is reverted instead of debugged in place.

The two repositories

The fleet is split into two flakes on purpose.

The public flake carries the parts that describe how a machine is built: one directory per host, and a module tree those hosts inherit — kernel and SSH hardening, compressed swap, the internal DNS zone, secrets handling, the deploy health gate, and the agents that ship metrics and logs. It is published, so the shape of the fleet is inspectable without exposing anything that protects it.

The private flake carries what only means something for a running service: the client-facing tiers, the credentials and key material, the deployment wiring those services need, and the recovery runbooks. It is consumed as a pinned input, never vendored, and it is not published.

Secrets are encrypted at rest in the repository and decrypted at activation, on the host that needs them. There is no plaintext credential in either flake, none baked into a build, and none pasted into a CI variable.

How a change reaches a host

  1. A pull request. CI evaluates the whole configuration and builds every host the change touches, then runs the repository’s gates over the result.
  2. A merge to main. A self-hosted runner builds the affected hosts and activates the new generation on each of them.
  3. A health gate. The deploy polls the host’s critical units until they are active again — a unit still activating does not count — and then asserts that nothing on the host sits in a failed state.
  4. An automatic rollback. If the gate is violated, the host returns to the previous generation by itself. A deploy that cannot prove itself healthy does not stay.
  5. A weekly input update. Dependencies are advanced on a schedule, through the same gate, as the only unattended path that moves an input. Nothing else upgrades a host: main moves, and the hosts follow.

The network

One machine is reachable from the internet. Everything else speaks only over an encrypted mesh, and the administrative paths — SSH, the forge, the dashboards — are inside that mesh rather than exposed and authenticated at the edge.

Backups and recovery

Monitoring and the published audit

Every host ships metrics and logs into a central stack with bounded retention, and dashboards and alerts read from that. On top of it runs the part worth mentioning here: a daily check re-derives the state of each host, tests the logging posture behaviourally — re-applying the setting and then looking for what was actually written, rather than reading it off a config file — and signs a report per host. Those reports are published, with monthly roll-ups that freeze once closed, at Infrastructure audit.

That is the difference between a claim and a claim you can check.

What is deliberately not on this page

This page describes how the infrastructure is built, not what is in it. There are no host names, no network addresses, no ports, no service inventory, and no credentials here — those belong in the repositories, and the ones that matter are in the private flake. If you want the specifics of how a part of it works, that is what an audit is for.

󰔟 Want this level of infrastructure for your team?
I design, build and operate NixOS infrastructure — from a single host to a multi-site fleet. Declarative configuration, atomic deployment, instant rollback, and a recovery plan that has been run.
[ GET IN TOUCH ] [ THE DEVOPS SERVICES ]
󰣨 ymrtech@ymrtech | 󰌠 NixOS | 󰍢 UTF-8