- Nix 36%
- Shell 32.8%
- Python 30.2%
- JavaScript 0.4%
- PLpgSQL 0.4%
- Other 0.2%
|
Some checks failed
NixOS Deploy / Resolve the deploy (implementation, scope, rev) (push) Successful in 18s
Secret Scan / gitleaks scan (push) Successful in 20s
NixOS Build Check / Scope changed deployable hosts (push) Successful in 1m7s
NixOS Build Check / Flake input regression guard (push) Has been skipped
NixOS Build Check / Hermes runtime gates (one eval of vpn's runtime) (push) Successful in 1m31s
NixOS Build Check / Build changed host closures (per-host budget) (push) Successful in 1m42s
NixOS Build Check / Gate summary (push) Successful in 0s
NixOS Deploy / Deploy public host deploy of public (c82279a)
NixOS Deploy / Deploy vpn host deploy of vpn (c82279a)
|
||
|---|---|---|
| .forgejo | ||
| certs | ||
| dns | ||
| docs | ||
| hosts | ||
| lib | ||
| modules | ||
| overlays | ||
| packages | ||
| patches | ||
| scripts | ||
| secrets | ||
| video | ||
| .gitignore | ||
| .gitleaks.toml | ||
| .review.yaml | ||
| .sops.yaml | ||
| flake.lock | ||
| flake.nix | ||
| IDEA.md | ||
| nixpkgs.nix | ||
| README.md | ||
| shell.nix | ||
NixOS Fleet — ymrtech.com
One declarative source of truth for every machine behind YMRTECH's services and its client VPN product.
What this repository is
This is the public configuration skeleton of a small, fully declarative NixOS fleet: seven
machines, one flake, no hand-edited servers. Every host — the public edge, the mail and forge host,
the mesh hub, the two regional nodes, the CI box and the operator workstations — is described as
code. Its packages, users, network policy, services and hardening are expressed in Nix and rebuilt
from this repository. A host changes only when main changes.
The same fleet backs three things:
- YMRTECH's own services — the site, mail, git forge, monitoring and collaboration tooling behind ymrtech.com.
- The client VPN product — a subscription service whose accounts, devices and regional egress are provisioned from this configuration. Product overview: ymrtech.com/vpn.
- The engineering system that operates it — an autonomous operator agent, scheduled passes and a work board, described further down, all fed by declarations in this tree.
For the narrative version of the same stack — twelve layers from the board down to the kernel — see ymrtech.com/stack.
Each layer is there for the same reason: its state is reproducible from a revision.
This repository is deliberately the evaluable half of that configuration. What is specific to the product's security perimeter lives in a private companion repository, kept separate on purpose so the architecture can be inspected without publishing the material that makes the perimeter defensible.
The public / private boundary
| Public — this repository | Private — nix-config-private |
|
|---|---|---|
| Contents | Flake shape, host definitions, module layout, shared hardening defaults, generic service wiring, the CI/CD workflows, the fleet's hermetic test suites | The product perimeter: the client tunnel interfaces and their service wiring, the fleet roster with addresses and ports, the private operational runbooks, and the real secret store |
| Consumed how | Readable and evaluable by anyone | Consumed as a flake input, pinned in flake.lock and fetched at deploy time |
Both repos are the same shape of thing — NixOS modules — and the public repo stays a flake that still evaluates and builds on its own. The boundary moves implementation out of view; it never removes capability, and it never moves the evidence: the audit reports, verification keys and signed logs that let a third party check the claims below stay public (see Security & compliance).
Fleet at a glance
Roles are what each machine is for, not what it is named. Service placement follows load and blast
radius, so a hostname is a historical label: the git forge and its database live on mail, and the
machines that build closures are not the ones that serve the site.
| Host | Role | Hardware |
|---|---|---|
vpn |
Mesh hub and operator edge. Terminates the management mesh (its WireGuard listener is the fleet's only public UDP port, alongside 443). Runs the encrypted DNS resolver with network-wide tracker/ad filtering, the primary client-VPN door, and the operator agent that maintains the fleet. | Ampere A1 (aarch64) |
vpn-mx |
Second region (Queretaro). A mesh ingress in Mexico with no WAN listener; carries the second client door, monitoring probes and the RIG ELEVEN atlas. | Ampere A1 (aarch64) |
public |
Public edge. TLS termination for the ymrtech.com sites, the client portal, the operator console, the docs build, the password vault, the chat server and its media relay, the status page and the honeypot. | Ampere A1 (aarch64) |
mail |
Mail and the forge. Inbound MX and authenticated submission, the self-hosted Forgejo forge with its Postgres and CI runner, the newsletter list, e-signature, the Attic binary cache, and the metrics/log store every other host pushes to. | Ampere A1 (aarch64) |
ci |
The build box. CI lanes and nothing else: it evaluates host configurations, builds their closures and publishes them to Attic. Deliberately monochrome — no mail store, no public ingress, no client door, nothing but runners. | Ampere A1 (aarch64) |
giga |
GPU workstation. The desktop and local inference endpoint, plus the owner's personal agent gateway. Off the automated deploy path: it moves by an explicit dispatch only. | RTX 3090 desktop (x86_64) |
command |
Bare-metal workstation. On the mesh like any peer; nothing inbound, no CI lane. | Own hardware (x86_64) |
Seven machines, one declaration. Only a few ports face the internet; every other path is the mesh.
Architecture principles
- Declarative — every system's state is defined in code. No manual changes on running servers.
- Reproducible — the same revision builds the same machine; no drift between two builds of one host.
- Modular — shared settings live in common modules; host-specific settings override as needed.
- Version-controlled — the entire OS lives in Git. Changes are reviewed, committed and deployed.
- Atomic — new configurations are evaluated and built before activation; the previous generation stays bootable, so rollback is a name you can write down.
- Health-gated — every deploy verifies its critical services after the switch and rolls itself back if one is down.
- Least exposure — secrets are split per host (a host can decrypt only the stores it is a recipient of). Only the ports that must face the internet do — the hub's door, the web edge and the mail exchanger — and every other service binds to the mesh.
- No standing root for automation — an agent's privileged surface is a read-only, argument-pinned allowlist plus a few single-purpose wrappers, all journalled. A verb outside the list fails instead of prompting. Privileged change to a host rides a deploy lane, not a shell.
How a change reaches a host
- A change lands as a pull request. A diff-scope job decides which hosts it affects — a flake, shared-module, overlay, package or patch change affects every host; otherwise only the host directories touched.
- CI evaluates each scoped host configuration, then builds its full closure on the
cipool and pushes the result to the self-hosted binary cache, so the merge substitutes rather than rebuilds. - On merge to
main, the fleet deploy workflow pins the private implementation to a revision, recomputes the host scope, and fans out one job per affected host on that host's own runner. - The new generation activates, then the deploy polls its gated services until they are active
and asserts that no unit on the host is in a
failedstate. - Any violation auto-rolls-back to the previous generation. There is no unattended upgrade:
hosts move when
mainmoves, and inputs advance only through the weekly flake-update job.
Deployable by the automatic fan-out: mail, vpn, public, vpn-mx, ci. giga has its own
workflow and moves only on explicit dispatch. command is bare metal with no CI lane at all.
The same set the table below lists in reference form, grouped instead by what sets it off. The argument behind this path — written for a reader who is not going to open the repository — is ymrtech.com/stack, which names no workflow file on purpose.
CI / CD
| Workflow | Trigger | What it does |
|---|---|---|
| NixOS Build Check | every PR, and every push to main that touches host-relevant paths |
Diff-scopes the affected hosts, evaluates each to a derivation path (catching every eval/syntax error in seconds), builds each closure natively on the ci pool and pushes it to Attic. Also carries the flake-lock guard and the operator-runtime gates. Required check. |
| Policy Gates | every PR | The script-driven policy suites: worker and reaper bounds, board capacity, scratch reapers, cache sweep, coordination-ledger ordering, fleet controls. |
| Repo Gates | every PR | The script-only battery: workflow path filters, dispatch input types, action pins, and the hermetic suites under .forgejo/tests. |
| Secret Scan | every PR and push | gitleaks over the full history of this (public) repository. Required check. |
| PR base guard | every PR | A real three-way merge-tree check against the current main; red on a genuine conflict, naming the conflicted paths. Required check. |
| NixOS Deploy (fleet) | push to main, plus manual dispatch |
One job per affected host: fetches the pinned private implementation, runs the switch on the host, verifies, and rolls back on a failed health check. |
| NixOS Deploy (host) | manual dispatch | One named host, on that host's own lane — the re-deploy and recovery path. |
| NixOS Boot Entry | manual dispatch | Pins the next boot generation, which is how a rollback drill is exercised without a switch. |
| Cache push | manual dispatch | Fills a hole in Attic by building one closure on the ci pool. Never switches a host. |
| Giga Build Check | PRs touching giga |
Builds giga's closure on its own runner — its configuration cannot be realized on the aarch64 fleet. |
| Giga Deploy | manual dispatch | The only way giga moves. |
| Flake update | weekly (Monday 09:30 UTC) and manual | Advances pinned inputs inside the ≥5-day freeze window and opens the change; never the absolute tip. |
| VPN Pin Follow | manual dispatch | Follows a change of the hub's public address, splicing one resolver-agreed literal. |
| RIG ELEVEN publish | manual dispatch | Rebuilds and publishes the atlas. |
| Content artifacts / Render Video | manual dispatch | Site artifacts and episode rendering. |
Runners are outbound-only — they dial out to the forge and there is no SSH between hosts and no
inbound port opened on a target. main is protected: the secret scan, the base guard and the build
check's gate summary are required contexts, administrators included. A direct push is refused for
everyone except the two identities named on main's push whitelist — the operator agent hermes
and the fleet's provisioning service account clientsv, never a blanket allowance for writers. The
one lane that uses it is the pin-follow lane (.forgejo/workflows/vpn-pin-follow.yml), whose output
is a single IPv4 literal two independent public resolvers agreed on, spliced by a tested one-line
rewrite and read back before it is committed; it keeps the ordinary PR-merge path as a fallback if
the whitelist is ever revoked. That lane is dispatch-only — it runs after a hub address change,
not on a timer.
The autonomous engineering system
The fleet is not only described declaratively — it is operated by an autonomous software-engineering system built on top of it. For us this is the real engineering result: building the VPN product was, in effect, the exercise that forced it into existence.
You talk to the fleet in plain language. Work is expressed as a card on a self-hosted kanban board, or as a reply to an email. That message is the input — no logging into hosts, no hand-run commands, no local merges. The system takes the request, plans it, makes the change on a fresh branch and worktree, and carries it through the fleet's normal path: evaluate every affected host, build its closure, push it to the binary cache, open a pull request, drive CI to green, merge, deploy, verify.
Nothing bypasses a gate. The same review, CI, branch protection and post-deploy health check apply to work the system does as to work a human does. The human stays in the loop exactly where a review is wanted — and nowhere it is not.
It is autonomous and self-healing. When a pipeline goes red or a host rolls itself back, the system reads the actual failing step, diagnoses it and opens the fix itself; it does not wait for someone to notice. A broken change is repaired by the same loop that shipped it.
It is conflict-avoidant by construction. Because several workstreams can run at once, each one claims the files it is about to touch in a shared coordination ledger before it edits them. Two sessions cannot silently overwrite each other's work — a collision becomes a queue, not a merge race.
Everything is tracked and declared. Every intent, claim, verification and landed change is recorded on the board and in the ledger, so any change can be audited after the fact: what was asked, what moved, and what proved it.
It maintains its own knowledge. The system keeps a curated library of versioned procedures, loaded by trigger rather than by wish — a host that fills its disk, a deploy lane that deadlocks, a dependency that must not be bumped. An operation that took a session to work out the first time is a lookup the next time, and each procedure names the log line or file that proves it ran.
Scheduled passes tend the fleet. Beyond change work, LLM-driven passes run on clocks instead of on attention: retention and store upkeep, a command-detection sweep, a delivery digest, an availability watch on the outside names, a weekly distillation of the transcript archive into the repository. Each has a written brief and a delivery rule, so a pass that quietly does nothing shows up as nothing — the failure mode that actually matters. They are declared in the same configuration that converges the host, and a record nobody declared is reported as unowned.
No agent holds the root. The sandbox is not an honour system: the operator runs under
NoNewPrivs, so it cannot acquire privilege even locally, and its privileged work on its own host
leaves through SSH to the host's own daemon rather than through a shell it owns. System state is
rebuilt from a declaration at boot, so an injected instruction that writes to /etc has done nothing
that survives a reboot.
We are turning this way of operating a fleet into an offering — rolling it out inside enterprises and as a hosted platform. Details on request: contact.
Repository layout
nix-config/
├── flake.nix # Flake root: inputs, host set, overlays, topology artifact, mkNixos
├── flake.lock # Pinned dependency revisions
├── nixpkgs.nix # Legacy nix-shell fallback
├── shell.nix # Dev shell (exported as devShells)
├── .sops.yaml # Secret-store encryption rules
├── .forgejo/
│ ├── workflows/ # 16 workflows: build check, policy/repo gates, deploy, secret scan, …
│ ├── scripts/ # Workflow helpers: input freeze and freshness, host scope, lock bumps,
│ │ # closure verification, surface crawlers, pin follow
│ ├── tests/ # 96 hermetic suites run on every PR
│ └── data/ # Allowlists the gates are checked against (binary refs, logging)
├── hosts/
│ ├── common/
│ │ ├── global/ # Shared host settings: hardening, memory pressure, DNS zone, edge
│ │ │ # budgets, health gate
│ │ ├── optional/ # Toggleable service groups
│ │ └── users/ # User accounts, keys, shells
│ ├── vpn/ # Mesh hub + operator edge
│ ├── vpn-mx/ # Second-region mesh node
│ ├── public/ # Public edge (apps/ holds the client portal)
│ ├── mail/ # Mail + forge + observability store
│ ├── ci/ # Dedicated CI runner box
│ ├── giga/ # GPU workstation
│ └── command/ # Bare-metal workstation
├── modules/ # Fleet modules: monitoring, identity, deploy gate, immutable root,
│ # service sandbox, backups, topology, cache sweep, detonation lab,
│ # Node/Reticulum, service priority, provider metrics
├── lib/ # Nix helpers used by overlays
├── overlays/ # Package overrides and pinned upstream packages
├── packages/ # Locally built packages
├── patches/ # Patches applied by overlays into runtimes a host loads
├── docs/ # Prose lane: documentation that deploys nothing
├── video/ # Episode media, consumed only by the render workflow
├── certs/ # Public root CA
└── secrets/ # Demo value only — the real store is private
Dependency surface
Inputs are pinned in flake.lock and are chosen from upstream revisions that are at least five
days old — never the absolute tip. They advance only through the weekly flake-update job, or for a
high/critical security fix, and never regress. Build toolchain inputs are rev-pinned rather than
branch-followed, so a bump re-resolves their nested inputs instead of half-updating a lock.
| Input | Role |
|---|---|
nixpkgs |
Package set (unstable channel) |
sops-nix |
Per-host encrypted secret delivery |
hardware |
Hardware profiles |
nixos-mailserver |
Mail server module |
nix-config-private |
Private product-perimeter modules and the fleet roster |
clientsv |
VPN subscription backend (private) |
hermes-agent |
Operator agent (rev-pinned) |
llm-agents |
Agent tooling packages |
hindsight |
Agent memory store |
hermes-bench |
Agent benchmarking application |
pyproject-nix, uv2nix, pyproject-build-systems |
Python build toolchain for the memory store (rev-pinned) |
comfyui-nix |
Image-generation tooling |
ninfer-3090 |
Local inference engine |
Service capabilities
Network, privacy and the client tunnel
- An obfuscated encrypted mesh between every host, with NAT egress through the hub and nothing inbound on any node but the hub.
- Encrypted recursive DNS with aggressive caching, upstream authenticated transport, and network-wide tracker and advertising filtering at the resolver layer.
- Per-device client provisioning, regional egress selection (two doors, two jurisdictions), and a portal that shows each device's live connection state and verifies that its DNS is not leaking.
- Single sign-on for the console surfaces, with its own database and published discovery records.
Public services
- The ymrtech.com sites and their documentation build, terminated at one edge with per-vhost security headers and rate budgets.
- A self-hosted git forge (git.ymrtech.com) with an integrated CI/CD pipeline, Postgres, and self-hosted, container-free runners.
- A self-hosted password vault, a service status page, an operator console, a paste service and the RIG ELEVEN infrastructure atlas.
- A chat server with a capacity-limited real-time media relay, restricted to the private ranges.
- A decoy surface whose hits are watched rather than merely logged.
Mail, data and storage
- A full mail stack: authenticated delivery and storage with server-side full-text search, plus policy-enforced authentication and per-source throttling against abuse.
- A newsletter list with double opt-in and self-service export/deletion, and e-signature for documents.
- A self-hosted binary cache, snapshot-based filesystem backup with off-site replication, and physical point-in-time recovery for the databases — every store encrypted before it leaves the host, with retention bounded by data class rather than by free disk.
Observability and automation
- Central metrics, log aggregation and tracing, with dashboards, alert rules, probe inventory and a public status surface. Retention is bounded, and the posture is tested behaviourally — by re-applying a setting and reading the store back — instead of trusted from a config file.
- Command detection over the fleet's own audit stream.
- The autonomous engineering system that runs and evolves the fleet — see above.
Security & compliance
The fleet is run toward an ISO-27001-style, defensible posture, and the evidence for the claims above is published rather than described:
- Audit — signed logging audit reports and their history.
- Standards — the standards each host is held to, and the evidence for each.
- Logging — exactly what the VPN logs, and what it cannot log.
- Privacy and Terms.
- Management system — scope, risk register, statement of applicability, change management, incident response and internal audit.
Two properties are enforced by the platform rather than promised by policy: agents hold no standing root (a read-only allowlist plus bounded wrappers, all journalled, and the verbs that would rewrite the system are absent rather than guarded), and the root filesystem is immutable — rebuilt from the declaration at boot, with anything writable owned by a group the agent is not in.
Quick start
# Dev environment
nix develop # or: nix-shell
# Build and activate a host you own, from a checkout
sudo nixos-rebuild switch --flake .#<host>
# Or build straight from the remote, bypassing any local cache
sudo nixos-rebuild switch --flake git+https://git.ymrtech.com/ymrtech/nix-config#vpn --refresh
# Move inputs forward inside the freeze window (what the weekly job automates)
nix flake update
Fleet hosts are not switched by hand: a change reaches them through the pull-request path above.
Hostnames: vpn, vpn-mx, public, mail, ci, giga, command
ymrtech.com · The stack · VPN · Writing · Contact
Built with Nix · Declarative · Reproducible · Health-gated