Author SHA1 Message Date
jackos1998andClaude Opus 5.5 b56ce8ff5d flake: Pin slop-broker to its progress branch
For testing slop-broker#22 on real deploys; not for merging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 20:38:59 +00:00
jackos1998andClaude Opus 5.5 d95309b4d3 flake: Update slop-broker to v0.3.0
Build llm-agents / build (pull_request) Skipped
CI / Check, build and cache nixfiles (push) Successful in 29m42s
Update docs / update (push) Failing after 1m11s
Containers as targets (protocol 3, so every `slop` moves with the
broker), copying from the builder's store, and stdin no longer hiding
a disconnect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 18:33:41 +00:00
jackos1998andClaude Opus 5.5 0a8c98f76f nixos/slop-cannon: Keep agents' running notes in issues
Build llm-agents / build (pull_request) Skipped
CI / Check, build and cache nixfiles (push) Canceled after 0s
Update docs / update (push) Canceled after 0s
Plans and status notes kept in files on branches go stale once the
work moves on or the branch is forgotten. Have agents keep them in
Gitea issues on the repository they're about, one per piece of work,
and say the same in `AGENTS.md` for `dev/nixfiles`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 18:17:46 +00:00
jackos1998andClaude Opus 5.5 5fcd2f29be nixos/palace: Hide guest NVMe disks from LVM by every name
Build llm-agents / build (pull_request) Skipped
CI / Check, build and cache nixfiles (push) Canceled after 0s
Update docs / update (push) Canceled after 0s
`global_filter` rejected `/dev/nvme*` but then accepted everything
else, and LVM accepts a device if any of its names is accepted: the
disk's `/dev/disk/by-*` links were. So `palace` saw `slop-cannon`'s
volume group, also called `main`, and LVM commands naming `main`
refused to run while the disk was connected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 16:26:08 +00:00
jackos1998andClaude Opus 5.5 57a21b459b flake: Update slop-broker to v0.2.2
Build llm-agents / build (pull_request) Skipped
CI / Check, build and cache nixfiles (push) Successful in 38m50s
Update docs / update (push) Failing after 1m29s
Says how long approvers have to answer when a request starts waiting,
instead of the guide giving the five-minute default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 19:44:29 +00:00
jackos1998andClaude Opus 5.5 36c42e7c6f flake: Update slop-broker to v0.2.1
Build llm-agents / build (pull_request) Skipped
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Canceled after 16m42s
Names secret recipients by their comments in `secrets.nix`, shows what
approvers saw in the audit history as approvals do, and reads unsigned
size changes from newer Nix in deploy approvals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 18:52:58 +00:00
jackos1998andClaude Opus 5.5 68de43b467 secrets: Name host keys for slop-broker approvals
Update docs / update (push) Failing after 1m44s
CI / Check, build and cache nixfiles (push) Canceled after 8m38s
Approvals list host keys abbreviated, which says little about which box
a secret goes to. Write each system's name after its key as the key's
comment, which age ignores and slop-broker shows as the name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 16:09:08 +00:00
jackos1998andClaude Opus 5.5 44f0358fef flake: Update the Paseo fork for stale jj workspaces
CI / Check, build and cache nixfiles (push) Canceled after 1m51s
Update docs / update (push) Failing after 1m18s
The fork now reports a jj workspace that another workspace made
stale, keeps its diffs readable, and offers an update-stale action.
It also logs skipped idle compactions at info.

Update the slop-cannon page, which still described Paseo before the
fork's jj workspaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 16:07:34 +00:00
jackos1998andClaude Opus 5.5 08cb5828e8 middleman: Add a Pocket ID client for mailcow
Build llm-agents / build (pull_request) Skipped
CI / Check, build and cache nixfiles (push) Successful in 28m43s
Update docs / update (push) Failing after 1m25s
mailcow's Generic-OIDC identity provider can sign mailboxes in to
its UI and SOGo with Pocket ID. mailcow isn't NixOS, so its side is
set up by hand in the admin UI with the secret from
`mailcow/oidc-secret.txt`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 14:42:21 +00:00
jackos1998andClaude Opus 5.5 712fabcb62 git: Sign in to Gitea with Pocket ID
Build llm-agents / build (pull_request) Skipped
Update docs / update (push) Failing after 1m10s
CI / Check, build and cache nixfiles (push) Successful in 29m1s
Add an `id.nul.ie` OpenID Connect login source to Gitea, kept up to
date from `preStart` since Gitea stores login sources in its database.
Its client is declared on `middleman` with the secret shared by both.
Registration stays disabled, so a Pocket ID sign-in links to an
existing account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:35:02 +00:00
jackos1998andClaude Opus 5.5 eeb1f2d15c middleman: Replace nginx-sso with Pocket ID SSO
CI / Check, build and cache nixfiles (push) Canceled after 25m17s
Update docs / update (push) Failing after 1m53s
Gate the vhosts without their own sign-in with oauth2-proxy, which
signs in with Pocket ID and allows members of the `admins` group.
Each gated vhost serves its own `/oauth2/` endpoints with a host-only
session cookie, so other `.nul.ie` sites never receive it. Sessions
last a week, and a refresh token lets oauth2-proxy check back with
Pocket ID every hour without a passkey.

Add `my.pocket-id`, which declares Pocket ID groups and OIDC clients
in Nix; `pocket-id-sync` applies them through the API with a static
API key that nginx keeps from outside requests. This lets apps move
to Pocket ID with their client defined next to them, with secrets
from `slop secret generate`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 00:15:06 +00:00
jackos1998 a3950b9bb3 flake: Update slop-broker to v0.1.1
Build llm-agents / build (pull_request) Skipped
CI / Check, build and cache nixfiles (push) Successful in 31m1s
Update docs / update (push) Failing after 1m7s
2026-11-26 22:57:59 +00:00
jackos1998andClaude Opus 5.5 d0eed3943d ci: Evaluate with a pool of nix-eval-jobs workers
CI / Check, build and cache nixfiles (push) Successful in 30m7s
Update docs / update (push) Failing after 1m9s
Each CI job ran in its own `nix build`, and its output path came from
a second `nix eval`. Every one of those evaluations paid ~15s and
~4 GiB to evaluate the flake before reaching its job, and import from
derivation stalled each job in turn. The final `ciDrv` evaluation
covered every job once more.

Evaluate everything once with `nix-eval-jobs` instead: workers keep
the shared evaluation for several jobs and wait on import from
derivation in parallel, and the worker count and memory bound cap
evaluation at 24 GiB of the 40 GiB `git` VM. Build every job in one
`nix build --keep-going`, push the results in one copy, and build the
profiled link farm from the known output paths, which makes `ciDrv`
unnecessary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 22:07:15 +00:00
jackos1998andClaude Opus 5.5 cc38f152be ci: Cancel runs superseded by a newer push
A run builds every system for an hour or more, and only the newest
commit on `master` needs building and caching.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 22:07:15 +00:00
jackos1998 25dfa0684f flake: Pin slop-broker to v0.1.0
Build llm-agents / build (pull_request) Skipped
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Canceled after 3m6s
2026-11-26 21:49:38 +00:00
github-actions[bot] 6220289079 flake: Update llm-agents
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Successful in 1h8m53s
claude-code 2.1.330 -> 2.1.332
codex 0.170.0 -> 0.172.0
2026-11-26 18:31:01 +00:00
jackos1998andClaude Opus 5.5 f806a59cd3 ci/llm-agents: List version changes in the PR body
CI / Check, build and cache nixfiles (push) Canceled after 0s
Update docs / update (push) Canceled after 0s
Show the installed version changes as a table in the update PR's
description, with a link to the upstream comparison, rather than
pointing reviewers at the commit message. The updater rewrites the
description of an existing PR whenever it no longer matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 18:20:47 +00:00
jackos1998andClaude Opus 5.5 b047a563d2 Ignore Python bytecode caches
Build llm-agents / build (pull_request) Skipped
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Canceled after 31s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 18:20:01 +00:00
jackos1998andClaude Opus 5.5 2a14417315 ci/llm-agents: Propose and build version updates
Build llm-agents / build (pull_request) Skipped
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Canceled after 13s
Discover the upstream derivations installed by the box and home
configurations. Refresh one update PR when their versions change,
and run the targeted package build against its new commit.

Closing the PR declines its versions until a later release, and
the updater closes an open PR once master already has the latest
versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 18:11:10 +00:00
jackos1998 1119371d2e nixos/palace: Extend slop approval timeout
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Successful in 1h13m47s
Give approvers 45 minutes to answer each request. Install guidance
for Claude and Codex on `slop-cannon` to report expired requests
and pause work that depends on approval.
2026-11-26 14:19:04 +00:00
jackos1998andClaude Opus 5.5 bc7c2e36b9 flake: Update slop-broker
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Canceled after 1m24s
`slop ssh` sends its stdin with the request so approvers see it, which
bumps the protocol version; activations finish when their connection
drops, and switching no longer restarts the broker. Document restarting
it after deploying `palace`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 14:18:45 +00:00
jackos1998andClaude Opus 5.5 cca27d60b0 flake: Update the Paseo fork to v0.17.5
CI / Check, build and cache nixfiles (push) Successful in 1h16m51s
Update docs / update (push) Failing after 1m17s
`fork/jujutsu-v0.17.5` replays the Jujutsu commits on upstream
`v0.17.5` and adds idle compaction: an idle Claude agent with a large
context is compacted shortly before its one-hour prompt cache expires,
following Claude Code's own rules. It is on by default.

Deploy `slop-cannon` and `middleman` together, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 11:05:23 +00:00
jackos1998andClaude Opus 5.5 6996096765 nixos: Use BBR for TCP sent from colony and home
CI / Check, build and cache nixfiles (push) Successful in 1h17m9s
Update docs / update (push) Failing after 1m10s
`estuary`'s port in ColoClue DC6 loses bursts of packets whenever the
members switch floods other members' traffic to it. CUBIC treats each
burst as congestion and takes 20-30 s to recover, longer than the gap
between floods. BBR keeps going. Between `estuary` and `river`, it
averaged 899 Mbit/s against CUBIC's 258 Mbit/s downloading from
colony, and 185 against 149 Mbit/s uploading to it.

Add a `my.network.bbr` option. Congestion control is chosen by the
sender, so enable it on the colony boxes that send data off-box
(`colony`, `shill` and its `middleman` proxy, `git`, `whale2`), and
for uploads on `castle` and the home routers. Forwarded traffic isn't
affected, so the routers only gain for their own connections and
`estuary` is left alone. BBR paces itself, so the default qdisc
stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:11:53 +00:00
jackos1998andClaude Opus 5.5 c3e7a4daa3 secrets/slop-cannon: Replace the Gitea token
CI / Check, build and cache nixfiles (push) Canceled after 0s
Update docs / update (push) Successful in 1m11s
The bot's new token can also read its own profile (`read:user`), which
`tea` asks for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:21:24 +00:00
jackos1998andClaude Opus 5.5 1a7c632dce flake: Switch Paseo to our Jujutsu fork
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Canceled after 23m56s
The fork on `git.nul.ie/dev/paseo` carries colocated Jujutsu support
on upstream `v0.17.4`. `slop-cannon` runs its daemon and `middleman`
serves its web app, so both need deploying together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:11:18 +00:00
jackos1998andClaude Opus 5.5 51c26fbcec nixos/slop-cannon: Reach Gitea as the bot user
Agents pushed with a write-enabled deploy key, added to each repo by
hand, and had no way to open pull requests. The bot user's token now
does both: Git uses HTTPS with a credential helper that sends it, and
`tea` is wrapped to log in with it. Only Dev pushes and merges to
`master`.

A new `my.agents.rules` option gives every agent extra instructions.
`slop-cannon`'s make a pull request the default way to finish work,
unless a repository's own instructions allow more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:11:18 +00:00
jackos1998andClaude Opus 5.5 cb4937f230 nixos/palace: Let slop-broker change secrets
Update docs / update (push) Successful in 1m6s
CI / Check, build and cache nixfiles (push) Successful in 1h12m51s
The broker gets its age identity and `slop secret` for agents.
Listing keys doesn't ask; everything else does, with approvals
checked against `master`, which only Dev can push to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:45:27 +00:00
jackos1998andClaude Opus 5.5 0de9124c3a secrets: Add slop-broker as a recipient
`slop-broker` on `palace` gets its own age identity, so it can change
secrets for agents without the dev key. Every secret is rekeyed once
to include it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:45:27 +00:00
jackos1998andClaude Opus 5.5 93f9309c91 nixos/castle: Use slop-broker over SSH
`castle` gets a requester and an approver key for `palace`'s broker,
set up with `programs.slop`, to try the SSH transport. `palace` lets
the keys in as the requester `castle`, sharing `slop-cannon`'s `agent`
policy, and the approver `castle`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:45:27 +00:00
jackos1998andClaude Opus 5.5 2519c3c86c nixos/palace: Run slop-broker for agents
`slop-cannon`'s agents reach the broker on `palace` through a vsock
device, under an `agent` policy: box queries run without asking,
`slop ssh` asks (offering 5 min and 1 h leases), and so do deploys.
The deploy key moves to `palace` as an age secret for the broker, so
the VM never holds it, and `AGENTS.md` points agents there at `slop`.

`palace` runs the builder itself, as `slop-broker-build`, reached over
SSH like a separate box and fetching `dev/nixfiles` with a read-only
deploy key, so `slop-cannon` shrinks to 24 GiB. `slop build` pushes
into Harmonia's store on `object` with a key of the broker's own,
which can only speak the store protocol and add GC roots there.
Agents' use of the builder asks, unless the commit is already on
`master`. Builds run agent-written Nix, so they only reach the
Internet, like `lan-untrusted`, and `nix-daemon` is limited so they
can't starve the VMs.

The approvals web app listens on `palace` for `middleman` only, the
one client the firewall lets in, which publishes it at
`approve.slop.nul.ie`. Approvers sign in with Pocket ID, and deploys
to the routers need a fresh passkey.

The broker's SSH targets are the deploy-rs nodes on `master`, which
the builder reads there, so agents can't add or redirect one.

With the broker gating what needs credentials, `slop-cannon`'s agents
are permissive by default: Claude bypasses permission prompts and
Codex runs without approvals or its sandbox, with matching Paseo
profiles. The deny rules for raw `deploy` and `ssh-machine` stay as
steers towards `slop`; the ones for `.keys/` go, since the VM's
checkout only has the committed public keys there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:45:27 +00:00
jackos1998andClaude Opus 5.5 71ed076f12 flake: Add slop-broker from its own repository
The broker, its NixOS and home-manager modules and the agents' guide
now live in the `slop-broker` repository, which this flake takes as an
input: its overlay provides `pkgs.slop-broker`, and the common modules
import `services.slop-broker*` and `programs.slop`. What's specific to
these boxes stays here: tmproot persistence for the broker and its
builder, `my.agents.slop` and the devshell's `slop` commands, which
`docs/slop-broker.md` describes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:45:27 +00:00
jackos1998andClaude Opus 5.5 75f6c1a064 nixos/middleman: Add Pocket ID at id.nul.ie
Pocket ID is a passkey-only OpenID Connect provider. It will sign in
to the slop-broker approvals web app, and later replace nginx-sso's
Google sign-in. Creating the first admin is restricted to internal
networks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:45:27 +00:00
jackos1998andClaude Opus 5.5 1622d9dda9 nixos/middleman: Move Paseo web app to slop.nul.ie
The public certificate also gains `*.slop.nul.ie` for agent dev
server previews.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:45:27 +00:00
jackos1998andClaude Opus 5.5 3d9da0efda AGENTS.md: Spell out blank lines and nested bullets
Separate logical steps with blank lines inside functions too, and break
long bullets and steps into a short lead with nested bullets rather
than growing them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:45:27 +00:00
jackos1998andClaude Opus 5.5 9c61198937 colony/git: Start Actions runner after Gitea
Update docs / update (push) Successful in 1m29s
CI / Check, build and cache nixfiles (push) Successful in 1h25m52s
The runner exits when Gitea isn't serving yet, so an activation that
restarts both made it hit its start limit and failed the deploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 16:04:08 +00:00
jackos1998andClaude Opus 5.5 3bc6885a14 nix: Add nix-community binary cache
CI / Check, build and cache nixfiles (push) Successful in 1h52m34s
Update docs / update (push) Successful in 33s
The nix-community cache builds unfree packages that `cache.nixos.org`
skips, such as the MongoDB used by UniFi, which otherwise takes hours
to build in CI. Add it to the flake's `nixConfig` (used by CI) and to
`lib.my.c.nix.cache` for boxes, homes and the devshell.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:51:28 +00:00
jackos1998andClaude Opus 5.5 139afc004e colony/git: Match Gitea task timeout to runner
Gitea's default `ENDLESS_TASK_TIMEOUT` of 3h marked long CI jobs as
failed while the runner kept building, leaving an orphaned job
container. Raise it to the runner's 8h job timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:51:05 +00:00
jackos1998andClaude Opus 5.5 7694945041 nixos/containers: Hash rendered nspawn file
CI / Check, build and cache nixfiles (push) Failing after 3h20m33s
Update docs / update (push) Canceled after 7m47s
The container restart trigger hashed the whole `systemd.nspawn.<name>`
option value. Newer NixOS adds a `warnings` list to it, which embeds
module source paths. With lazy trees those paths change on every
evaluation, so the toplevel differed between `nix build` and `nix eval`
and CI failed to push `system-kelder`.

Hash the rendered `.nspawn` text instead, so containers restart exactly
when the file systemd reads changes. Older NixOS renders all units into
one directory, so fall back to the JSON hash there until 26.11.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:17:08 +00:00
jackos1998 fabbb43fbf ci/nix: Allow IFD for runtime dependency replacements
Update docs / update (push) Successful in 1m5s
CI / Check, build and cache nixfiles (push) Failing after 1h2m10s
Share a single replacement list between NixOS and standalone Home
Manager. CI checks that list against its targets' nixpkgs channels.

When a replacement applies, warn and defer the flake check until
after the target builds. Runtime replacement needs to generate and
import store reference graphs during evaluation, which fails under
`nix flake check --no-build` on a fresh runner.

Keep the early eval-only check and disable IFD when the list is empty.
2026-11-23 23:45:23 +00:00
github-actions[bot] d5e2b93fd0 docs: Update generated references 2026-11-23 17:11:58 +00:00
jackos1998 af32a8dd4b lib/json-c: Work around the 0.19 memory leak
Update docs / update (push) Successful in 1m28s
CI / Check, build and cache nixfiles (push) Failing after 1m31s
In json-c 0.19, json_object_put calls the function that frees detached
JSON objects inside assert(). Release builds with NDEBUG skip that
call. Sway's frequent IPC replies then leak memory, eventually making
workspace switches lag.

Patching json-c in the main package set changes the library's store
path and forces dependent packages, including Firefox and Chromium,
to rebuild. Keep the pin with SPDK 26.09 and build the ABI-compatible
fix separately. Rewrite runtime references in NixOS systems and
standalone Home Manager generations to reuse their existing binaries.

Drop the replacement when the pinned nixpkgs includes the fix.

https://github.com/NixOS/nixpkgs/pull/586077
2026-11-23 17:09:05 +00:00
jackos1998 a75d94f492 devshell: Add container support to ssh-machine
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Canceled after 25m22s
Port `ssh-machine` to Python and derive container targets from their
hosting boxes. Configure `tower` to prefer its home DNS name and fall
back to its Tailscale name.
2026-11-22 23:26:00 +00:00
jackos1998 19265dfc75 openwrt/feeds: Refresh fergal firmware pins
Update docs / update (push) Successful in 1m25s
CI / Check, build and cache nixfiles (push) Failing after 58m12s
Update the snapshot and release feeds and record the serial console
settings for firmware recovery.
2026-11-22 16:18:48 +00:00
jackos1998 6894b5c1ab skills: Share flash-openwrt and install-box 2026-11-22 16:18:48 +00:00
github-actions[bot] a45cbf4c3d docs: Update generated references 2026-11-22 15:21:30 +00:00
jackos1998andClaude Opus 5.5 f7c733c2d1 nixos/spdk: Move to SPDK 26.09
CI / Check, build and cache nixfiles (push) Failing after 6m19s
Update docs / update (push) Successful in 1m23s
SPDK 26.01 crashes while scanning the PCI bus with DPDK 26.07. Pick
up the fork's bump to SPDK 26.09, which adds the 26.07 compatibility
layer, and drop the 26.01-only DPDK 26.03 workaround.

SPDK 26.09 sizes transport caches from the shared iobuf pool, so the
RDMA transport on `cellar` starved the bdev and accel caches. Set its
caches explicitly and enlarge the pools. Also retry `spdk-tgt` on
failure, as loading its config can fail intermittently at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:11:44 +00:00
jackos1998andClaude Opus 5.5 65221ee403 middleman: Set nginx workers through the module
The nginx module now writes `worker_processes` itself, so the copy in
`appendConfig` duplicated it and nginx failed its config test. Keep
`auto` explicit through `services.nginx.workerProcesses`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:11:44 +00:00
jackos1998andClaude Opus 5.5 4d4404a254 colony: Install ipmitool and document the BMC
Record the BMC's management address and how to reach and recover it
through the in-band IPMI interface while the host is up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:11:44 +00:00
jackos1998andClaude Opus 5.5 f51a4db577 hass: Drop the ignored HTTP YAML configuration
Home Assistant 2026.8 imported the `http` block into `.storage/http`
and has ignored it since, raising a repair to remove it. Keeping it in
Nix suggested that `trusted_proxies` still followed `middleman`'s
assignments. Remove it and document that the HTTP settings are
managed in the UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:11:44 +00:00
jackos1998andClaude Opus 5.5 288d68b954 colony-psql: Upgrade PostgreSQL to 18
Return the container to `mine` with PostgreSQL 18. The live cluster
was migrated from 14 with `pg_upgrade --link` before this config
first started. The new cluster was initialized with
`-E UTF8 --locale=en_US.UTF-8 --no-data-checksums` to match the old
one, and every B-tree index on a `character(n)` column was reindexed
afterwards because `amcheck` rejected their 14-built deduplication
flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:11:44 +00:00
jackos1998andClaude Opus 5.5 31b5e3b608 nixpkgs: Refresh pins and flake inputs
Move all four channels and both home-manager inputs to the rebased
fork and current channels, and refresh the other moving inputs. Bump
the latest kernel to 7.3 and the release metadata to 26.11.

Follow upstream removals: pin `colony-psql` (PostgreSQL 14) to
`mine-stable` until the PostgreSQL 18 migration that follows, and
`spoder` (Nextcloud 32) until its own migration, and take MinIO for
`object` from `mine-stable` through a compatibility import. Replace
Gitea's removed `DOMAIN` with `SSH_DOMAIN`, let `determinate-nix` pick
its own nixpkgs, and drop the nginx bump now that every pin ships fixed
releases. Move Frigate's recording retention to the `record.continuous`
layout, since 0.18 rejects `record.retain`. Pass the borgbackup wrapper
flags as separate arguments now that the package uses structured
attributes. Stop `britway`'s mesh link gating `network-online.target`:
systemd 262 holds it in configuring until `tailscale0` exists for its
policy rule, and tailscaled only starts once the network is online.

Keep the SCTP module block: no kernel in use carries the NGINX2Root
SCTP fix yet. Record the checks `kelder` missed while out of service
on its page.

Notable upgrades:

- Kernels: 6.18.64 LTS and 7.3.5 latest.
- Gitea 1.27.2 -> 28.3.0, with schema migrations.
- Home Assistant 2026.8.2 -> 2026.11.2 and Frigate 0.17.2 -> 0.18.3.
- Jellyfin 10.11.11 -> 12.4, Radarr 6.1 -> 7.0.3 and Sonarr
  4.0.17 -> 5.0.0 (a prerelease), each migrating its database.
- HedgeDoc 1.11.1 -> 1.12.0, mautrix-whatsapp 26.08 -> 26.11,
  Vaultwarden 1.37.1 -> 1.37.5, Seerr 3.3.0 -> 3.5.2.
- Headscale 0.29.3 -> 0.29.7, BIRD 2.19.2 -> 2.20.0 and Tuwunel
  1.8.3 -> 1.9.4.
- nginx 1.30.7 and 1.31.9 from the channels, with the NGINX2Root
  fixes.
- `determinate-nix` 3.22.2 -> 3.24.3, `harmonia` 3.2.0 -> 3.3.0,
  `deploy-rs` 1.0.0, `copyparty` 1.20.21 -> 1.20.26, and `llm-agents`
  with Codex 0.170.0 and Claude Code 2.1.330.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:11:44 +00:00
jackos1998andClaude Opus 5.5 a3d4918095 docs/nixpkgs: Expand the upgrade procedure
Add the review and bookkeeping the last upgrade needed:

- Keep a progress document in the workspace, out of the upgrade's
  commits, and delete it at wrap-up after moving open follow-ups to
  TODOs, box pages or commit messages.
- Check the published stable release rather than the newest release
  branch, and fetch the upstream branches explicitly.
- Verify requested backports on each rebase base and compare both
  fork patch stacks with `git range-diff` before pushing.
- Review the apps and services each channel supplies, and every
  direct flake input, for removals, migrations and breaking changes.
- Present channel moves and migrations as choices, and mark any
  temporary pin with a TODO naming its exit condition.
- Commit the refresh apart from procedure changes and service
  migrations, and list notable version upgrades in its description.

Default the fork checkout to `../nixpkgs` and update the
`upgrade-nixpkgs` skill to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:42:08 +00:00
jackos1998 f5ef9031a6 home-manager/gui: Keep screenshots on clipboard
CI / Check, build and cache nixfiles (push) Successful in 47m40s
Update docs / update (push) Successful in 1m18s
Use `wl-copy` for Satty copies so screenshots remain available after
closing the editor.
2026-11-22 12:42:08 +00:00
jackos1998 b5be218f14 nixos/common: Block SCTP kernel module loading
CI / Check, build and cache nixfiles (push) Successful in 52m10s
Update docs / update (push) Successful in 58s
2026-11-19 00:26:50 +00:00
jackos1998andClaude Opus 5.5 01c8261de9 nixos: Bump nginx for NGINX2Root fixes
Override `nginxStable` and `nginxMainline` to 1.30.7 and 1.31.9 until
the pinned channels ship them. OpenResty has no fixed release yet, so
disable HTTP/2 on `spoder`'s vhosts in the meantime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 00:26:50 +00:00
github-actions[bot] 3370823ed5 docs: Update generated references 2026-11-18 22:51:24 +00:00
jackos1998andClaude Opus 5.5 a6491c7535 nixos/slop-cannon: Move to a VM on palace
CI / Check, build and cache nixfiles (push) Successful in 45m39s
Update docs / update (push) Successful in 1m0s
Give agents their own kernel, Nix daemon and disk for workloads that
need root. Put the VM on the `untrusted` VLAN with MAC spoof
checking on VF 5.

Export a dedicated partition from `cellar` and connect it on
`palace`. Give the VM its own SSH host key and age secrets for Paseo
and Gitea. Keep the agent home and Paseo identity on persistent
storage and provide `slop-pair` for pairing clients.

Retire the container, restore `sfh` to 8 cores and 32 GiB, and rekey
the shared password secret. Document the VM and its operating
procedures on the relevant box pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:02:14 +00:00
jackos1998andClaude Opus 5.5 5058dec3f1 nixos/cellar: Keep spdk-tgt running on deploy
Restarting `spdk-tgt` takes every NVMe-oF root disk away (river,
castle, sfh), so don't do it on deploy.

`spdk-debug` repeated the RAID definition by hand. Generate its config
from the real one instead (no examine, no exports, ublk disks from
`my.spdk.debug.ublkDisks`), so it can't drift and runs without a
terminal. Document adding a partition export with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:01:54 +00:00
jackos1998andClaude Opus 5.5 5fb8e8d280 nixos/home: Keep untrusted to the Internet
The routers reject new connections from the `untrusted` VLAN to
internal destinations before the firewall's ICMP rules, then allow
Internet transit via `wan` and `as211024`. The shared
`lib.my.c.internalNets` also covers the modem's management subnet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:01:54 +00:00
jackos1998 89cc4b679c nixos/sfh: Start Home Assistant without the webcam
An absent webcam made the nspawn bind mount fail before Home
Assistant could start. Give the container an always-present
directory and bind the video device into it when it is available.
Point go2rtc at the device in that directory.
2026-11-18 22:01:54 +00:00
jackos1998 4307939aab devshell: Fix ssh-machine caching in jj workspaces
CI / Check, build and cache nixfiles (push) Successful in 48m33s
Update docs / update (push) Successful in 1m15s
2026-11-18 21:08:24 +00:00
github-actions[bot] fc92ff9ba1 docs: Update generated references 2026-11-17 13:40:06 +00:00
jackos1998 15e12613fb nixos/estuary: Update LUJE and NL-ix peering
CI / Check, build and cache nixfiles (push) Successful in 51m18s
Update docs / update (push) Successful in 1m18s
Replace the ColoClue LUJE sessions with IPv6 peering on Clue-IX.
Add IPv4 and IPv6 LUJE sessions on NL-ix.

Share the lower NL-ix peer preference through dedicated templates,
including Meta alongside the other NL-ix direct peers.
2026-11-17 12:47:15 +00:00
jackos1998 c1242b12ed nixos/estuary: Add Clue-IX IPv6 peering
Attach `clue-ix` VLAN 121 directly to `wan` with the assigned IPv6
address. Add sessions to both AS218511 route servers using `rs_client`
roles and mandatory GTSM, following the existing IXP policy.

Include the interface in the direct protocol and IXP firewall set,
and document the VLAN and peers. Omit IPv4 peering because no address
was assigned.
2026-11-17 12:47:15 +00:00
github-actions[bot] 4b78cbe841 docs: Update generated references 2026-11-16 02:28:39 +00:00
jackos1998 1f4d058ba4 nixos/slop-cannon: Fix Codex procfs fallback
Update docs / update (push) Successful in 1m0s
CI / Check, build and cache nixfiles (push) Successful in 48m35s
Restore the bubblewrap diagnostic expected by Codex so its existing
container fallback handles nspawn procfs restrictions.

Verified workspace writes succeed and outside writes are denied.
`check-system slop-cannon` passes.
2026-11-16 01:01:18 +00:00
jackos1998andClaude Opus 5.5 9c508caeb5 nixos/palace: Grow sfh VM for slop-cannon
CI / Check, build and cache nixfiles (push) Successful in 55m9s
Update docs / update (push) Failing after 1m10s
Give `sfh` 16 cores x 2 threads (overcommitted) and 96 GiB, so the
coding agents in `slop-cannon` have room alongside `hass` and `unifi`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 00:39:48 +00:00
jackos1998andClaude Opus 5.5 b0a7f3cd89 nixos/middleman: Serve Paseo web app ourselves
Serve the web app from the Paseo package on `paseo.nul.ie` and point
the daemon's pairing links there, so browsers no longer load Paseo's
hosted app. It connects through our relay, so the daemon stays on
loopback.

Move the patched Paseo package into the shared overlay so `middleman`
and `slop-cannon` use the same build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 00:39:48 +00:00
jackos1998andClaude Opus 5.5 a62b8351fa nixos/sfh: Add slop-cannon container for agents
A container on `sfh` for coding agents driven remotely through Paseo,
using our relay on `middleman`. Agents run as the unprivileged
`slop-cannon` user; Claude managed settings disable bypass mode and
deny raw deploy and `ssh-machine` access.

Move the Claude Code and Codex configuration out of `gui` into a
shared `my.agents` home-manager module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 00:39:48 +00:00
jackos1998andClaude Opus 5.5 5af71ea231 nixos/middleman: Add self-hosted Paseo relay
Package paseo-relay and add a small `my.paseo-relay` module running it
as a single node without Erlang distribution. Publish it on
`paseo-relay.nul.ie` so Paseo daemons and the app can use our own
relay instead of the hosted one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:48:19 +00:00
jackos1998andClaude Opus 5.5 f567a43bc0 nixos/common: Disable bootvine in containers
Update docs / update (push) Successful in 1m6s
CI / Check, build and cache nixfiles (push) Successful in 43m36s
bootvine attaches to a console TTY, which nspawn containers do not
have, so the unit fails and leaves containers degraded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:49:56 +00:00
github-actions[bot] 3f63cf5938 docs: Update generated references 2026-11-15 17:16:18 +00:00
jackos1998 314be7620f nixos/home: Gate DDNS updates on WAN readiness
Update docs / update (push) Successful in 1m0s
CI / Check, build and cache nixfiles (push) Successful in 47m46s
Start updates when the WAN gate opens and skip timer runs while it
is inactive. Keep periodic retries and wait for the local DNS services.
2026-11-15 16:23:06 +00:00
jackos1998 a04d11423a nixos/home: Separate router storage and uplinks
Give `river` a dedicated RDMA VF and two RSTP trunk attachments.
Keep client services on the router VIPs and carry Digiweb VLANs
over both switch paths.

Set VF trust, multicast reception, bridge MAC and ARP behavior for
local switching. Wait for Kea interface readiness and apply RSTP
costs through `mstpd` despite port-registration and rename races.

Load `palace`'s RAID module in the initrd. Record RouterOS and
RouterBOOT upgrades and validate port, carrier and switch outages.

Document the deployed architecture, interface handoffs and recovery
procedures. Add physical socket maps, NIC capacities and cable
connections alongside the logical topology and failover checks.
2026-11-15 16:23:06 +00:00
jackos1998 b02948d826 nixos/spdk: Handle released DPDK 26.03
Use the supported PCI layout for released DPDK 26.03, matching the
upstream fix in SPDK 26.05. Otherwise SPDK 26.01 selects an older
layout and crashes during PCI scanning.
2026-11-15 16:23:06 +00:00
jackos1998 08c0ebf9e8 nixos/whale2: Add Quad to Valheim whitelist
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Canceled after 17m0s
2026-11-15 16:08:48 +00:00
jackos1998andClaude Opus 5.5 60324c5ff5 devshell: Add docs Markdown previewer
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Canceled after 2m48s
Wraps `go-grip` to preview docs in the browser before pushing,
rendered locally with live reload. Defaults to `docs/README.md`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:27:37 +00:00
jackos1998andClaude Opus 5.5 2606d0e4ae home-manager/gui: Update Claude status line to v1.4.5
Upstream v1.4.5 moves the effort level into parentheses after the
model name.

Also read the CLI version from the `version` field Claude Code passes
on stdin instead of caching `claude --version` for an hour, which kept
showing the old version after an upgrade. `claude --version` remains
as an uncached fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:21:48 +00:00
jackos1998 991ca5ee2a home-manager/gui: Pull Claude from llm-agents
CI / Check, build and cache nixfiles (push) Canceled after 0s
Update docs / update (push) Canceled after 0s
2026-11-15 15:12:38 +00:00
jackos1998 b1b27b5bc3 nixos: Enable bootvine everywhere
Update docs / update (push) Canceled after 0s
CI / Check, build and cache nixfiles (push) Successful in 47m21s
2026-11-15 14:04:08 +00:00
jackos1998 b705b66bfc devshell: Replace deploy-multi with --targets
CI / Check, build and cache nixfiles (push) Successful in 42m1s
Update docs / update (push) Failing after 1m7s
2026-11-15 13:57:04 +00:00
jackos1998 93ac20e053 devshell: Cache SSH connection settings
Cache all deploy node connection settings and invalidate them when
HEAD or tracked working-tree contents change. Preserve SSH argument
boundaries and support explicit refreshes.
2026-11-15 13:52:52 +00:00
jackos1998 99f105ed5f Update llm-agents
CI / Check, build and cache nixfiles (push) Successful in 53m55s
Update docs / update (push) Failing after 2m24s
2026-11-15 13:11:13 +00:00
jackos1998 d8cd889e1d nixos/gui: Add bootvine 2026-11-15 13:05:13 +00:00
jackos1998 198b172186 Update llm-agents
CI / Check, build and cache nixfiles (push) Successful in 48m59s
Update docs / update (push) Successful in 1m11s
2026-10-31 15:22:46 +00:00
jackos1998 4281aa9234 nix: Add Numtide binary cache for llm-agents
Configure the Numtide substituter and signing key in the shared cache
settings and flake configuration so Codex can use prebuilt binaries.
Document the cache and retain the input’s tested nixpkgs pin.
2026-10-31 15:21:26 +00:00
jackos1998 20ac77d8a0 devshell: Accept flake config in build-n-switch
Pass `--accept-flake-config` explicitly because `doas` drops the
devshell configuration that enables it. This avoids prompts for the
flake’s binary cache settings when rebuilding as root.
2026-10-31 15:19:14 +00:00
jackos1998 967faad269 home-manager/gui: Switch from swappy to satty for screenshots
CI / Check, build and cache nixfiles (push) Successful in 47m47s
Update docs / update (push) Successful in 1m14s
2026-10-30 12:16:16 +00:00
jackos1998 ebedb6b494 Update llm-agents
CI / Check, build and cache nixfiles (push) Successful in 1h24m33s
Update docs / update (push) Successful in 1m1s
2026-10-29 21:45:49 +00:00
jackos1998 cbe54f7523 home/gui: Guard newer Codex settings option
CI / Check, build and cache nixfiles (push) Successful in 2h42m49s
Update docs / update (push) Successful in 1m20s
Only set `programs.codex.mutableSettings` when Home Manager exposes it.
This fixes evaluation on 26.05, including boxes with the GUI disabled.
Record the removal TODO and guidance for future compatibility guards.
2026-10-19 17:14:21 +01:00
jackos1998 46008cb25a common: Add python3 to system and home packages
Update docs / update (push) Successful in 1m12s
CI / Check, build and cache nixfiles (push) Failing after 12m25s
2026-10-18 18:25:45 +01:00
jackos1998 5edb5e8ff6 Update llm-agents and allow Codex access to network 2026-10-18 18:16:52 +01:00
jackos1998 ee6b34dbd7 home-manager: Share Git and Jujutsu configuration
Update docs / update (push) Successful in 51s
CI / Check, build and cache nixfiles (push) Failing after 17m56s
Move Git, Git LFS and `diff-so-fancy` into the common home module.
Enable Jujutsu with the same identity and add it to the devshell.

Document `jj` workflows and prefer them in Jujutsu workspaces.
2026-10-03 22:16:42 +01:00
jackos1998 e7ec6740f1 home-manager/gui: Manage Codex with mutable settings
Pin Codex independently through `llm-agents.nix` and update unstable
home-manager for `programs.codex.mutableSettings`.

Declare the status line, including both usage windows, while preserving
imperative settings during activation.
2026-10-03 22:11:19 +01:00
jackos1998 73e538ad1f nixos/whale2: Refresh Valheim server and world
CI / Check, build and cache nixfiles (push) Successful in 55m5s
Update docs / update (push) Successful in 1m10s
Pin the community image and start simpland3 while retaining
simpland2. Correct the server-files volume name and reuse the
admin ID in both access lists.
2026-09-20 21:23:01 +01:00
github-actions[bot] 9e9027a250 docs: Update generated references 2026-08-25 19:59:15 +00:00
jackos1998 b904922356 ci/docs: Fix repository URL for push
CI / Check, build and cache nixfiles (push) Has been cancelled
Update docs / update (push) Successful in 1m4s
2026-08-25 20:57:26 +01:00
jackos1998 02c965dd96 ci/cache: Keep collection in preflight
CI / Check, build and cache nixfiles (push) Successful in 47m34s
Update docs / update (push) Failing after 1m4s
Group cache collection separately in the Actions log and avoid repeating
it after updating the CI profile.
2026-08-25 08:58:57 +01:00
jackos1998 adea4bd9e5 ci/cache: Prune profile generations
CI / Check, build and cache nixfiles (push) Failing after 3h5m51s
Update docs / update (push) Failing after 1m5s
Explicitly remove expired generations from the nonstandard Harmonia
profile before collecting garbage. This keeps old CI closures from
remaining rooted until the cache exhausts its inodes.
2026-08-25 08:46:45 +01:00
jackos1998 e875971237 nixos/hass: Use packaged pyirishrail
CI / Check, build and cache nixfiles (push) Failing after 29m48s
Update docs / update (push) Failing after 1m9s
Fix pyirishrail metadata in the nixpkgs fork, update the mine pin,
and remove the local package now supplied by the Home Assistant
component.
2026-08-25 00:12:01 +01:00
jackos1998 1a9c601c2b ci/cache: Collect garbage before pushes
CI / Check, build and cache nixfiles (push) Failing after 26m9s
Update docs / update (push) Failing after 1m3s
Run retention cleanup before uploading build results so inode
exhaustion cannot prevent CI from reaching its only garbage-collection
step.
2026-08-24 22:57:10 +01:00
jackos1998 92855606a4 pkgs/firefox-memory-control: React to swap-outs
CI / Check, build and cache nixfiles (push) Failing after 20m49s
Update docs / update (push) Failing after 1m9s
Firefox can exhaust swap while `MemAvailable` remains above the unload threshold. Track new `pswpout` pages so active swapping triggers tab unloading without treating stale swap occupancy as permanent pressure.
2026-08-24 15:19:23 +01:00
jackos1998 5171a10079 nixpkgs: Refresh channels and inputs
CI / Check, build and cache nixfiles (push) Failing after 59m32s
Update docs / update (push) Failing after 1m12s
Rebase the fork branches and refresh nixpkgs, home-manager, and the
approved ancillary inputs. Update kernel and release metadata, adapt
removed package and Home Assistant options, and keep Determinate Nix
on its tested nixpkgs revision to avoid duplicate Boost patches.

Retire Sharry and its public endpoint because copyparty replaces it.
Document the GitHub mirror gate and require real devshell and system
builds in the upgrade validation workflow.
2026-08-24 00:10:18 +01:00
jackos1998 e93e9f7a08 openwrt: Pin vendored feed indexes
CI / Check, build and cache nixfiles (push) Successful in 58m0s
Update docs / update (push) Failing after 1m12s
Pin `openwrt-feeds` to repository state that includes vendored APK
indexes, keeping image builds independent of mutable upstream indexes.

Document the corresponding refresh workflow.
2026-08-23 23:08:41 +01:00
jackos1998 5e036d17c4 docs/nixpkgs: Expand upgrade workflow
Move the skill to the shared agent location while retaining Claude
compatibility. Document kernel refreshes and the release metadata
policy as part of each upgrade, and make commit-message wrapping
explicit and verifiable.
2026-08-23 21:44:07 +01:00
jackos1998 57b94b64bb openwrt: Keep SFP LuCI app snapshot-only
CI / Check, build and cache nixfiles (push) Failing after 7m19s
Update docs / update (push) Failing after 1m13s
2026-08-23 21:27:32 +01:00
jackos1998andClaude Opus 5 bf411e03e2 nixos/portcullis: Tune NICs, IOMMU and EEE
Router-sized 4096-entry rings on every port with GRO kept across
forwarding, the IOMMU in passthrough mode, and EEE pinned off on the
I226-V ports as one trigger for their link-drop erratum. The ring and
GRO settings are .link files, so they land on a device add event rather
than at switch time.

Also document the tuning deliberately not done -- coalescing and PCIe
ASPM -- and what measuring the NICs' ESP offload found, since the
esp4_offload modules are software batching and easy to mistake for it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 10:54:22 +01:00
jackos1998andClaude Opus 5 81b7ca9d05 nixos/l2mesh: Load the ESP offload modules
CI / Check, build and cache nixfiles (push) Failing after 6m55s
Update docs / update (push) Failing after 1m11s
esp4_offload/esp6_offload provide GSO/GRO batching for ESP and are not
autoloaded when an SA is created, costing around a third of the mesh's
encrypted throughput. Load the one matching each secured mesh's
underlay family.

Also document the per-SA single-core limit and pcrypt as an option.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 14:09:23 +01:00
jackos1998andClaude Opus 5 dd0b318a44 nixos/castle: Set lan-lo to the standard MTU
lan-lo is a VLAN on et100g, which carries hi's jumbo frames, so it
inherited 9000 rather than the 1500 the lo VLAN runs at. MSS clamping
hid this from TCP; UDP without working PMTUD was silently dropped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 14:09:01 +01:00
jackos1998andClaude Opus 5 d24d71113f docs: Clarify what a logically distinct commit is
CI / Check, build and cache nixfiles (push) Failing after 6m50s
Update docs / update (push) Failing after 1m7s
"Keep logically distinct changes in separate commits" was being read as
split anything separable, which turns one piece of work into several
commits that only make sense read together.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 01:34:15 +01:00
jackos1998andClaude Opus 5 87cdfdbd97 nixos/portcullis: Bring up 10G on the home hi VLAN
portcullis is wired over 10G to fergal, which uplinks to jim's spare
SFP+ port. That uplink is untagged VLAN 1, so hi is carried tagged on a
lan-hi VLAN interface: a static assignment at 192.168.68.41 / ::6:1,
resolving through the router VIPs like any other hi client. Its gateway
route outranks the DHCP default, making 10G the preferred path while the
2.5G bootstrap stays as a fallback. Deploy now targets that address.

The hi MTU goes on the .network rather than the .link, since a .link is
only applied at udev device-add -- with it there, et10g-0 stays at 1500
across a switch and lan-hi cannot take 9000.

jim's sfp-spare was tagged into hi and lo out of band to match.

fergal turns out to belong with portcullis rather than to the home
fabric -- it goes to Nikhef when the box does -- so its documentation
moves to the colony site, leaving home/switches.md a short section on
what it borrows from that fabric.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 01:30:50 +01:00
jackos1998andClaude Opus 5 7bebac194c docs: Note commit trailer and body conventions
Co-Authored-By is the only trailer wanted here; session links are not.
Also spell out that bodies should stay concise.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 01:17:11 +01:00
jackos1998andClaude Opus 5 cdc5d9c1db openwrt: Build fergal's firmware in the flake
fergal is an 8-port SFP+ switch on a Realtek RTL9303, running OpenWrt
rather than RouterOS or UniFi. It is not part of the fabric yet, but
its firmware is now built here via astro's nix-openwrt-imagebuilder.
Packages are baked into the image: OpenWrt's package server keeps only
the current build of each feed, so installing at runtime stops working
as soon as the feed moves past the running firmware.

Those feed indexes rotate constantly, and upstream pins only the
indexes -- a mismatch drops evaluation into import-from-derivation,
putting this flake's eval on the network. The openwrt-feeds input pins
expanded per-package hashes instead, in a repository of its own
because they run to hundreds of thousands of generated lines.

Flashing gets a procedure doc and a thin skill pointing at it, the
same split as the box installation and nixpkgs upgrade procedures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 01:16:53 +01:00
jackos1998andClaude Opus 5 e7122b8862 docs: Add box installation procedure
CI / Check, build and cache nixfiles (push) Successful in 56m36s
Update docs / update (push) Successful in 1m11s
Canonical, agent-agnostic procedure for bringing a new box into the
flake, from a booted installer through to a deployable system, plus a
thin Claude Code skill pointing at it -- same split as the nixpkgs
upgrade procedure.

Records the conventions that were not written down anywhere: sgdisk
plus an LVM PV for the nix and persist volumes, adopting the
installer's SSH host keys so secrets can be encrypted before first
boot, and taking whatever show-hw-config emits that the flake's own
modules do not already set.

Also notes in AGENTS.md that a changed recipient list should be
re-encrypted per file with ragenix --rekey-one; --rekey rewrites every
secret in secrets/ and buries the actual change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 01:30:59 +01:00
jackos1998andClaude Opus 5 0aade09d7e nixos/portcullis: Add initial config
New bare-metal box headed for Nikhef, intended to take over most of
estuary's colony edge routing. This is the bootstrap config only: the
hardware, the single-NVMe ESP + LVM layout, and enough networking to
boot and be reachable.

It is being staged at home before it is racked, so it has no colony
assignments yet. Every 2.5G port takes DHCP and whichever one is
patched in brings the box up; kea registers the DHCP hostname, so the
deploy node points at portcullis.dyn.h.nul.ie until there is a real
colony FQDN for it.

The host key was adopted from the installer session and seeded onto
the persist volume before first boot, so my.secrets.key could be set
up front -- which makes portcullis a recipient of the user-passwd
secret that my.user declares for every box.

Documented with a box page, a row in the colony site index, and a note
in the colony section of networking.md that the topology is expected
to change once portcullis takes over from estuary.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 01:30:59 +01:00
jackos1998andClaude Opus 5 d1b9358069 nixos/netboot: Fix installer update failures
CI / Check, build and cache nixfiles (push) Has been cancelled
Update docs / update (push) Has been cancelled
Installer / Build installer (push) Successful in 4m56s
`netboot-update` failed with an opaque curl usage error whenever the
`installer` tag advanced past a build that had not published assets:
the `jq` select found no matching asset, and the empty result was
passed straight to `curl` as the URL. Report the missing asset (and
an unresolvable tag) instead.

The unit also had its network dependency inverted, being `wantedBy`
network-online.target rather than wanting and ordering after it. Fix
the idiom and keep it in the boot transaction via multi-user.target.

On river that is not enough on its own, because the WAN is a pppd
interface that networkd's wait-online knows nothing about, so
network-online.target is reached well before there is a route
off-site. Gate the service on wan-online.target there, following the
same wantedBy + partOf idiom as ipsec, which also re-runs the fetch
whenever the link returns.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 23:21:31 +01:00
jackos1998andClaude Opus 5 41ada3fa60 ci/installer: Switch to gitea-release-action
`release-action` is archived; its repository points at
`gitea-release-action` as the replacement. The inputs were renamed
(`api_key` -> `token`, `title` -> `name`).

The new action is a Node one rather than Go, so the Go setup step
kept in the previous commit is no longer needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 23:17:25 +01:00
jackos1998andClaude Opus 5 dcf79577ca nixos/git: Buffer uploads on the state volume
Gitea writes uploaded release assets to a temp file before storing
them. That landed in `/tmp`, which is on the 2G tmpfs root, so
uploading the installer ISO failed with:

  ParseMultipartForm [E] ... write /tmp/multipart-...: no space
  left on device

Point the service's `TMPDIR` at the state volume, which has room.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 23:17:21 +01:00
jackos1998andClaude Opus 5 cea32c5f16 ci/installer: Refresh workflow infrastructure
CI / Check, build and cache nixfiles (push) Has been cancelled
Update docs / update (push) Has been cancelled
Installer / Build installer (push) Failing after 4m30s
The installer workflow had not been touched since 2024 and missed
both the Ubuntu 26.04 runner bump and the move to Determinate Nix as
the common Nix. Bring it in line with `ci.yaml`.

The Go setup step stays: it supports the Gitea release action rather
than the Nix build.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 22:52:35 +01:00
jackos1998andClaude Opus 5 cbc48e456d nixos/build: Fix netboot initrd systemd config
`boot.initrd.systemd.extraConfig` was removed upstream and now fails
an assertion, which broke the `netbootArchive` target and with it the
second build step of the installer release workflow. Move the two
timeout settings to `settings.Manager`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 22:52:30 +01:00
jackos1998andClaude Opus 5 05918ec2ce nixos/installer: Refresh against upstream
CI / Check, build and cache nixfiles (push) Has been cancelled
Installer / Build installer (push) Has been cancelled
Update docs / update (push) Has been cancelled
The ISO target had drifted from nixpkgs and no longer evaluated:
`iso-image.nix` now defines `image.baseName` itself, which conflicts
with ours, so force it.

Drop the `boot.initrd.systemd.enable = false` override from the
`asISO` build target. The missing `/dev/root` it worked around is no
longer an issue, and scripted initrd is deprecated for removal in
26.11.

Replace the wpa_supplicant stanza, which upstream's
`installation-device.nix` no longer carries, with NetworkManager.
Keep it out of `multi-user.target` so nothing network-related starts
until asked; NetworkManager enables wpa_supplicant as its backend,
which is D-Bus activated on demand.

Pick up three more bits from that profile: the installer
`variant_id`, the pstore drop-in that stops an install evacuating the
target's persistent entries, and the mdadm `PROGRAM` stub that
silences the unset-mail warning.

Built and booted as an ISO to confirm.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 22:45:28 +01:00
jackos1998 2ca4c3d5b1 home-manager/gui: Toggle AVRCP media keys
CI / Check, build and cache nixfiles (push) Successful in 58m6s
Update docs / update (push) Successful in 1m23s
Some headsets alternate play and pause events independently of the
actual player state. Treat either event as a toggle so an out-of-sync
event is not a no-op.
2026-08-18 16:05:49 +01:00
jackos1998 82cbe67010 home-manager/firefox: Add memory control
CI / Check, build and cache nixfiles (push) Successful in 57m45s
Update docs / update (push) Successful in 1m17s
Wrap Firefox with a privileged AutoConfig controller that unloads tabs under configurable MemAvailable hysteresis and exposes an on-demand reclaim command. Enable it by default for Linux GUI homes.
2026-08-13 12:29:35 +01:00
jackos1998andClaude Opus 5 0c6928f7ae docs/home: Add 5G WWAN modem reference
CI / Check, build and cache nixfiles (push) Successful in 56m6s
Update docs / update (push) Successful in 1m14s
Notes from bench-testing the Quectel RM500U-EA on tower, bought to
eventually replace stream's Virgin Media WAN. Like the switches and
APs, the module is configured out-of-band and is not referenced by
the flake.

Records what it takes to connect at all: the module must be switched
from its stock NCM composition to MBIM, since under NCM the PDP
context activates but the cdc_ncm link never raises carrier; and the
connect only succeeds with the network-expanded APN read off the
default-attach bearer, as IPv4.

Also flags the two consequences for stream: the SIM is CGNAT so it
cannot carry the public lease stream's WAN currently publishes, and
the bearer reports a /8 that would cover Tailscale's 100.64.0.0/10
if configured literally.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 22:57:42 +01:00
jackos1998andClaude Opus 4.8 135d52d3de nix: Skip readLinkAt unit test on XFS builder
CI / Check, build and cache nixfiles (push) Successful in 1h7m38s
Update docs / update (push) Successful in 1m6s
CI builds Determinate Nix from source, running its unit-test suite. The
`nix-util` `readLinkAt.works` test creates symlinks with PATH_MAX-length
targets, but our CI runner's build filesystem is XFS, which hard-caps
symlink targets at 1024 bytes (XFS_SYMLINK_MAXLEN). Creation fails with
ENAMETOOLONG, so the test — and the whole determinate-nix build — fails
on the runner while passing on non-XFS filesystems.

Filter out just that test via gtest's GTEST_FILTER on the
`nix-util-tests-run` check input, leaving the rest of the unit and
functional tests gating the build (they still matter, since we build
against several nixpkgs channels).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 00:26:37 +01:00
jackos1998andClaude Opus 4.8 f8a89b9c87 docs: Add guided nixpkgs upgrade procedure
CI / Check, build and cache nixfiles (push) Has been cancelled
Update docs / update (push) Successful in 1m10s
Capture the periodic upgrade of the four nixpkgs channels and
home-manager as a repo doc: check for a NixOS stable bump first, rebase
the devplayer0 fork against upstream (re-verifying the patch stack
against freshly fetched refs), run the update commands, sweep
version-gated TODOs, and review the remaining flake inputs.

Keep the canonical, agent-agnostic procedure in docs/ and point both
AGENTS.md and a thin Claude Code skill at it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 23:31:26 +01:00
jackos1998andClaude Opus 4.8 5e3b196ee0 nixos/git: Fix Actions runner cache timeout
Job containers using actions/cache hung and timed out reaching the
runner's built-in artifact cache server. With cache.host unset,
act_runner announced the box's autodetected outbound address, which
containers on podman0 can't route back to; even to the right address
the host input chain (policy drop) dropped the connection, as only the
forward chain was opened for the podman subnet.

Pin cache.host to the podman bridge gateway and cache.port to a fixed
value, and open that one port on podman0 in the input chain. Declare
the podman subnet once in the box file and derive the gateway, the
default_subnet and both firewall rules from it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 22:56:30 +01:00
jackos1998 b8f31e23f8 nixos/home: Prefer dave for stream RSTP
CI / Check, build and cache nixfiles (push) Failing after 24m39s
Update docs / update (push) Successful in 1m9s
Set explicit port costs so `stream` prefers `dave` over `jim`.

Trigger `mstpd` when the bridge is configured, before it is routable.
2026-08-03 22:31:43 +01:00
jackos1998andClaude Opus 4.8 7fe3c8186c nix: Adopt Determinate Nix as the common Nix
Use Determinate Nix as `nix.package` for systems, homes and the
devshell, for its parallel evaluation and lazy trees. We only take the
package, not `determinate-nixd`: the daemon and `nix.conf` model are
unchanged and the Determinate NixOS module is not imported.

- Add the `determinate-nix` (`nix-src`) input, following our
  `nixpkgs-unstable`. FlakeHub's cache needs auth, so we build it
  ourselves and let it flow through Harmonia like everything else.
- `determinateOverlay` exposes it as `pkgs'.mine.determinate-nix`;
  `lib.my.c.nix.determinateSettings` (`lazy-trees`, `eval-cores = 0`)
  is merged into `nix.settings` and the devshell `nix.conf`.
- Switch CI to `DeterminateSystems/determinate-nix-action` so the
  runner itself evaluates with Determinate.
- Advertise the Harmonia cache via the flake's `nixConfig`, trusted
  without a prompt via `accept-flake-config` in the devshell, `.envrc`
  and CI only (boxes already trust it through `nix.settings`).
- Re-attach `pkgs`/`lib` to container and installer
  `nixosConfigurations` so Determinate's flake schemas can evaluate
  them (`nix flake check` otherwise fails with `attribute 'pkgs'
  missing`).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 22:31:43 +01:00
jackos1998andClaude Opus 4.8 1ca978baf4 home: Raise stateVersion and drop dead nix.package guards
Every managed home already had its stateVersion force-set per
home-manager branch (22.11 for stable/mine-stable, 23.05 otherwise);
pin them all to 23.05.

With the floor at 23.05 the `versionAtLeast config.home.stateVersion`
guards on `nix.package` are always taken, so drop them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 22:31:43 +01:00
jackos1998andClaude Opus 4.8 b9bcb1eaeb nixos/home: Anchor static hi clients' DNS on VIPs
CI / Check, build and cache nixfiles (push) Has been cancelled
Update docs / update (push) Successful in 1m10s
Statically-addressed home servers on hi run no DHCP, so they learned a
resolver only from the v6 RA RDNSS and lost DNS whenever v6 (and thus
the RA) was absent. Factor the fix castle/palace applied inline into a
shared lib.my.c.home.vlanDns helper that points resolved at the VLAN's
VRRP VIPs (always-present static v4, plus v6 when up) and sets the
advertised search domains, then apply it to every statically-addressed
hi client: castle, palace, cellar, sfh and the sfh hass/unifi
containers. Document it under the router client DNS section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 22:27:47 +01:00
jackos1998andClaude Opus 4.8 f9f61e19ad docs/home: Document switches/AP must not route
CI / Check, build and cache nixfiles (push) Successful in 47m37s
Update docs / update (push) Successful in 1m7s
jim, dave and the vibe AP are pure L2, but RouterOS ships ip-forward and
IPv6 forward on, and with IPv6 forwarding enabled it also advertises
itself as a default router. After the 7.18 -> 7.23 upgrade clients began
picking up the switches as IPv6 default routers alongside river.

Replace the earlier advertise-dns framing (which only strips RA options,
not the router lifetime) with the actual requirement: ip-forward=no,
IPv6 forward=no, accept-router-advertisements=no, ra-lifetime=0, and a
re-check after every RouterOS upgrade.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-03 14:15:40 +01:00
jackos1998andClaude Opus 4.8 14af217880 nixos/castle: Pin static DNS on lan-hi
CI / Check, build and cache nixfiles (push) Successful in 47m5s
Update docs / update (push) Successful in 1m16s
castle took its resolver solely from the IPv6 RA (radvd RDNSS) on
lan-hi, so DNS broke whenever RA was absent. Since castle's own v6 is
RA/SLAAC-derived it has no usable v6 address in that case, so anchor
DNS on the always-present static v4 via the VRRP VIP, with the v6 VIP
as a bonus when v6 is up. Search domains reuse the centralised
lib.my.c.home.searchDomains list.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:04:34 +01:00
jackos1998andClaude Opus 4.8 26e6870337 lib/home: Centralise advertised search domains
radvd's DNSSL and kea's domain-search hardcoded the same list of
search domains in two places. Hoist it to lib.my.c.home.searchDomains
so there is a single source of truth (and so other consumers, such as
statically-configured boxes, can reuse it). No change to what is
advertised.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 22:04:34 +01:00
jackos1998andClaude Opus 4.8 000c03d3c1 ci/docs: Fall back to discovered servers for AXFR
CI / Check, build and cache nixfiles (push) Successful in 47m47s
Update docs / update (push) Successful in 1m9s
The DNS reference generator transfers each zone from the nameservers
public NS discovery returns. The home IPv6 reverse zone
(0.d.4.0.0.c.7.9.e.0.a.2.ip6.arpa) is delegated only to Hurricane
Electric, which refuses AXFR, so generation aborted before committing
any zone. Our own authoritative servers (ns1/ns2.h.nul.ie) serve that
zone and permit transfers but aren't in its public delegation, as their
addresses are dynamic.

When a zone's delegated servers all refuse, retry against the union of
nameservers discovered for every other zone. That pool includes
ns1/ns2.h.nul.ie via the h.nul.ie NS records, resolved to their current
addresses at query time, so the reverse zone transfers from the same
reachable servers h.nul.ie already uses. Zones whose own servers work
are unaffected; the fallback only runs after their transfers fail.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 21:49:40 +01:00
jackos1998 4f6ea35ee4 nixos/toot: Fix broke deploy due to mastodon secrets 2026-08-02 21:31:07 +01:00
jackos1998andClaude Opus 4.8 de681f33da docs: Note container deploy targets
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 21:20:53 +01:00
jackos1998andClaude Opus 4.8 ab2308e765 lib: Disable IPv6 privacy addresses on assignments
IPv6 temporary (privacy) addresses rotate an interface's stable source
address out from under long-lived connected sockets. nginx's resolver
on middleman binds a UDP socket to the preferred temporary address at
worker start; once that address expires and is removed, the socket can
no longer send, so every upstream lookup fails with "could not be
resolved (timed out)" until nginx is restarted (which then binds the
next temporary address, so it recurs).

These are servers with no need for privacy addresses, so disable them
in networkdAssignment for every RA-accepting interface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 21:20:53 +01:00
jackos1998 539a76a94f docs: Correct sfh acronym 2026-08-02 11:42:09 +01:00
jackos1998 88d0d19239 docs/dns: Add live record reference
CI / Check, build and cache nixfiles (push) Successful in 46m57s
Update docs / update (push) Failing after 1m6s
Generate forward and reverse record tables from authoritative AXFRs
while preserving handwritten Markdown outside per-zone markers. Run the
generator in CI and link the reference from the relevant docs.
2026-08-02 01:07:27 +01:00
jackos1998 8f9ca5e1c4 nixos/dns: Allow internal zone transfers
Permit AXFR from shared internal networks and cross-site egress
addresses while retaining loopback and the existing secondary.
2026-08-02 01:07:03 +01:00
jackos1998 08605ab422 docs/boxes: Prioritize hardware details
Place physical hardware inventories and VPS resource allocations near
the top of each box page, while leaving broader platform details in
their topical sections.
2026-08-02 00:23:30 +01:00
jackos1998 c354998e11 ci/docs: Regenerate docs on master
CI / Check, build and cache nixfiles (push) Successful in 51m19s
Update docs / update (push) Successful in 1m4s
Run both documentation generators after master updates and commit their
outputs only when the generated files change.
2026-08-02 00:12:57 +01:00
jackos1998 b44095f1ed docs/options: Add option reference generator
Evaluate custom module options through a synthetic system, stabilize
configuration-dependent defaults for rendering, and commit the generated
reference beside its updater.
2026-08-02 00:12:57 +01:00
jackos1998 4084dfe64e docs/assignments: Add table generator
Render site tables from the aggregated assignments, group rows by
assignment name, preserve handwritten notes, and expose the updater as a
flake package.
2026-08-02 00:12:57 +01:00
jackos1998 f3d921bcdc AGENTS.md: Add documentation guidance
Keep agent context lean and define documentation conventions for
terminology, page structure, ownership, generated content, and commit
messages.
2026-08-02 00:12:57 +01:00
jackos1998 a2f3410e42 docs/boxes: Document deployed boxes
Add per-site and per-box inventories, consolidate shared network design,
and relocate the switch and access-point references under the home site.
2026-08-02 00:12:57 +01:00
jackos1998 43cf35d54e docs: Add infrastructure overview
Document the module architecture, deployment workflows, installer, and
high-level box map.
2026-08-02 00:12:57 +01:00
jackos1998andClaude Opus 4.8 390818ffdb home-manager/gui: Disable pi-coding-agent (breaks CI)
`pi-coding-agent-bun` breaks `nix flake check` in CI: its bun2nix
`fetchBunDeps` calls `builtins.filterSource` on subpaths of the pi.nix
flake source, which requires that source derivation to be realised in the
local store. A fresh CI runner doesn't have it, so eval aborts with
`path '...-source.drv' is not valid`. It only works locally because the
source is already realised there.

Not using pi right now, so comment out the input, overlays, home module
import and the package (leaving a root-cause note in `flake.nix`) rather
than working around the upstream issue.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-02 00:12:51 +01:00
jackos1998 43b5bedb48 nixos/vms: Fix LVM disk helper regression
Adding volume-group support changed the LVM disk helper's argument
meaning, so standard VM disks and the legacy darts calls resolved disk
names as volume groups.

Restore the main volume group for standard disks and map the differently
named darts volumes explicitly.
2026-08-02 00:12:36 +01:00
jackos1998andClaude Opus 4.8 e47e30df19 .claude: Add shared permissions allow list, ignore local settings
CI / Check, build and cache nixfiles (push) Failing after 2m30s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 20:13:03 +01:00
jackos1998 e077c6e30c home-manager/common: Add treemd 2026-07-28 12:06:24 +01:00
jackos1998andClaude Opus 4.8 6f8d499ec2 docs: Add home APs and switches references
Document the home network's out-of-band devices that aren't managed by
this flake:

- `home-aps.md` — the two dumb APs (`vibe` MikroTik cAP ax, `wave` Cudy
  AX3000 on OpenWrt): shared VLAN-trunk design (`hi`/`lo` are both
  trusted client VLANs differing only by MTU), SSIDs, per-AP management
  addressing, roaming (802.11k/v), and the OpenWrt flash + on-device
  config for `wave` (incl. the `mtk_eth_soc` eth0 2026-byte MTU cap that
  keeps it off the jumbo `hi` VLAN, wpad-mbedtls swap, HE160).
- `home-switches.md` — the hand-configured switches (`jim`/`dave`
  MikroTik, `brian` UniFi) topology, VLAN map, and ONT/WAN path.

Add the `home-aps.md` pointer to AGENTS.md alongside the existing
switches reference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-28 12:06:24 +01:00
jackos1998andClaude Opus 4.8 d0859d4c5c nixos/home: Add wave AP DNS records, renumber vibe to .15
New Cudy AX3000 AP `wave` takes host `.14` on core (backup) and lo
(primary); replaces the decommissioned AP of the same name. It's managed
on `lo`, not `hi`, because its 2.5GbE (`mtk_eth_soc` eth0) caps at MTU
2026 and so can't join `hi`'s jumbo (9000) fabric — and `hi`/`lo` are
both trusted client VLANs differing only by MTU.

Renumber the MikroTik AP `vibe` from `.13` to `.15` and give it the same
core/hi/lo records as `jim`/`dave` (was `hi`-only), matching its
on-device reconfiguration. `vibe` stays on `hi` since it can do jumbo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 09:46:13 +01:00
jackos1998 9b582bec7b home-manager/gui: Add pi-coding-agent
CI / Check, build and cache nixfiles (push) Failing after 2m29s
2026-07-26 18:55:20 +01:00
jackos1998andClaude Opus 4.8 8c4223af18 AGENTS.md: Document switches, deploy --boot, and memory policy
CI / Check, build and cache nixfiles (push) Successful in 45m13s
- Note `CLAUDE.md` is a symlink to `AGENTS.md` (edit the real file).
- Policy: prefer recording durable guidance here over agent memory.
- Add the "Home switches" section (`jim`/`dave`/`brian`, access,
  confirm-before-apply) pointing at `home-switches.md`.
- Document `deploy --boot` for staging a config without live-switching.
- Note the `ssh-agent` hang workaround for outbound SSH (`ssh-machine`/`deploy`).
- Add a comment convention: comment where useful, not for trivial code, and
  describe general purpose rather than the one-off reason for a change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 21:35:50 +01:00
jackos1998andClaude Opus 4.8 b95992735e nixos/home: Trunk Digiweb VLAN 10 to river instead of translating
With a single ONT the ISP's VLAN 10 is unique on the fabric, so there's no
need to swap it to a private fabric VLAN. Carry pon-isp (10) trunked straight
through the switches to river and run PPPoE directly on it, dropping the old
wan-pon-isp (141) translation. The ONT's untagged management is PVID'd onto
wan-pon-ont (140) at its edge switch (brian).

wan-pon-isp (141) is kept as a constant, reserved for the future multi-ONT
case where per-port VLAN translation disambiguates two VLAN-10 ONTs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 21:29:16 +01:00
jackos1998 0d1562d150 home-manager/gui: Add more LSPs
CI / Check, build and cache nixfiles (push) Successful in 44m33s
2026-07-23 01:37:33 +01:00
jackos1998andClaude Opus 4.8 49de78d47f nixos/home: De-share Virgin Media modem specifics from routing-common
The modem management subnet is stream-specific (it shares stream's `wan`
interface), so it no longer belongs in the shared routing-common. Drop the
`modem` network assignment and configure the address directly on stream's
`wan` (modemV4). The firewall reject and DNS wan-A-record skipBroadcasts that
existed only because of the modem move to per-box options
`my.homeRouter.{firewall.untrustedRejectV4,dns.wanSkipBroadcasts}`, set solely
by stream. river needs neither: its ONT sits on a separate interface already
blocked by the interface-based forward rules.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 01:35:08 +01:00
jackos1998andClaude Opus 4.8 832d0b5542 nixos/home: Rework river WAN to single-tag VLAN 140/141
Digiweb's ONT delivers its untagged management traffic (192.168.100.0/24)
alongside the tagged ISP VLAN 10. The switch feeding river now tags the ONT's
untagged port as wan-pon-ont (140) and swaps the ISP VLAN 10 to wan-pon-isp
(141) on ingress, so both reach river single-tagged: river takes an address in
the ONT's /24 on 140 to reach its web UI, and PPPoE runs directly on 141.

Replaces the old QinQ-into-131 (wanStacked) transport; the wan-pon (131) VLAN
constant is dropped and prefixes.ont added.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 01:35:08 +01:00
jackos1998 4d4c05ea70 Symlink CLAUDE.md to AGENTS.md
CI / Check, build and cache nixfiles (push) Successful in 49m29s
2026-07-22 18:44:03 +01:00
jackos1998andClaude Opus 4.8 0bd08c4a91 nixos/home: Recurse over IPv4 only on the home routers
CI / Check, build and cache nixfiles (push) Successful in 46m1s
The routers' IPv6 default route runs over the as211024 mesh as a
proto-static route that blackholes rather than withdrawing when the mesh
flaps (e.g. during ipsec churn on a deploy). With "::" in the recursor's
outgoing.source_address, pdns-recursor kept selecting IPv6 to reach
authoritative servers, stalled on timeouts, and took recursion down with
it whenever the mesh bounced. Drop "::" so upstream recursion goes out
the WAN over IPv4 and stays up; AAAA records are still served fine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 19:56:43 +01:00
jackos1998andClaude Opus 4.8 a86888a2c7 nixos/home: Use Digiweb static IP for river WAN
Digiweb assigned river a static IPv4 (84.203.124.128). Point river's
public address at it and have pppd actively request it as the IPCP local
address (local:remote form) rather than passively accepting whatever the
peer offers via noipdefault. The address stays sourced from the
routersPubV4 constant, so the ipsec l2 mesh peer, the nft DNS redirect,
and the cross-router route all follow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 18:06:21 +01:00
jackos1998andClaude Opus 4.8 dc1ec3bf5a docs: Ask before running fmt
CI / Check, build and cache nixfiles (push) Successful in 45m46s
fmt reindents non-canonically-formatted files wholesale, burying logical
changes in whitespace churn. Note to match surrounding style by hand.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 16:11:25 +01:00
jackos1998andClaude Opus 4.8 823ed83252 nixos/home: Unstack river WAN to single-tag VLAN 10
Digiweb's BRAS answers PADI only on a single-tagged ISP VLAN (pon-isp,
10); the double-stacked wan-pon (131) transport never got a PADO because
the UniFi access switch can't push the outer tag onto already-tagged
ingress frames (no QinQ/tag-stacking). Attach VLAN 10 directly to the
physical `lan` link for now.

Kept reversible via a `wanStacked` flag: flip it back to true to restore
the 131->10 stack once a QinQ-capable device sits in front of the ONT.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 16:11:25 +01:00
jackos1998andClaude Opus 4.8 300103f2ba nixos/home: Correct river wan-vlan-outer MTU to 1512
CI / Check, build and cache nixfiles (push) Successful in 45m9s
The outer WAN VLAN carries the inner VLAN's frames, whose 4B 802.1Q tag
counts as payload at this layer. To fit the inner's 1508B baby-jumbo
payload plus that tag it needs 1512, not 1508. Harmless before only
because the physical `lan` (9000) absorbed the extra bytes; this makes
the outer's MTU literally reflect what it transports.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 10:57:13 +01:00
jackos1998andClaude Opus 4.8 d33f32ce5b docs: Document home-router HA pattern and boxes terminology
CI / Check, build and cache nixfiles (push) Successful in 45m40s
Capture what this session surfaced: the routing-common indexed-module
active/backup pattern, VRRP VIPs for gateway+DNS, the wan-online.target
convention, the networkd helper locations, and the "boxes not fleet"
terminology. Also note the fish login shell caveat for ssh scripting.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:44:22 +01:00
jackos1998andClaude Opus 4.8 14d9bba4eb nixos/home: Serve DNS on VRRP VIP and fix ipsec WAN ordering
Clients were handed both routers' real addresses as resolvers, so a downed
router meant per-query resolver timeouts. Serve pdns-recursor on the VRRP
VIPs (with non-local bind so the backup can pre-bind them) and advertise the
VIP via kea and radvd, so DNS follows the master. untrusted advertises
Cloudflare over v6 to match its v4 config.

ipsec started before the WAN's public IP was up: stream's wan carries a
static modem address that satisfies wait-online before the DHCP lease, so
libreswan loaded its mesh conns (left=<public IP>) unoriented and never
initiated. Gate stream's wan-online.target on the DHCP default route
instead, and mkForce ipsec onto wan-online.target only (dropping the
strongswan/libreswan multi-user.target pull-in) so the gate actually holds
on both boxes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:38:02 +01:00
jackos1998andClaude Opus 4.8 e63cee7b09 nixos/home: Migrate river WAN to PPPoE over Digiweb
river's WAN moves to a PPPoE session (Digiweb, over VLAN 10 with baby-jumbo
1508 MTU) driven by pppd, with its ip-up/ip-down hooks toggling a new
wan-online.target. stream keeps its DHCP WAN, so the existing 50-wan /
50-wan-ifb networkd config moves out of routing-common into stream, and the
shared consumers (ipsec, ipv6-clear-default-route) now attach to
wan-online.target instead of depending on systemd-networkd-wait-online@wan
directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 22:37:05 +01:00
jackos1998 a8318d3de2 nixos/home: Separate HDD LV for frigate
CI / Check, build and cache nixfiles (push) Successful in 51m19s
2026-07-19 11:47:37 +01:00
jackos1998 aab4a193ae nixos/home: Add brian
CI / Check, build and cache nixfiles (push) Failing after 3h2m50s
2026-07-15 02:22:15 +01:00
jackos1998 541102f683 nixos/netboot: Switch to iPXE snp.efi
CI / Check, build and cache nixfiles (push) Successful in 45m47s
2026-07-14 22:42:04 +01:00
jackos1998 805590a705 nixos/routing-common: Fix mstpd missing bridge-stp script
CI / Check, build and cache nixfiles (push) Successful in 46m37s
2026-07-12 18:40:38 +01:00
jackos1998 f8dbd99a7b nixos/routing-common: Add missing ttl param to DDNS update 2026-07-12 17:15:57 +01:00
jackos1998 90cc2d53f1 Update CI workflow to Ubuntu 26.04
CI / Check, build and cache nixfiles (push) Successful in 46m23s
2026-06-14 20:37:53 +01:00
jackos1998andClaude Opus 4.8 b044504938 nixos/git: Update Gitea Actions runner
Bump runner labels to node 24 / Trixie and Ubuntu 26.04. The upstream
module now generates the runner config from the `settings` option and
wires `ExecStart` itself, so drop the hand-written config file and
`ExecStart` override.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 20:37:36 +01:00
jackos1998andClaude Opus 4.8 98ccc23ef5 devshell: Add check-system and ssh-machine utilities
`check-system` evaluates a NixOS config without building it; `ssh-machine`
SSHs to a system or home by name, resolving the target and ssh options
from its `deploy-rs` node. Document both in `AGENTS.md`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 20:36:15 +01:00
jackos1998andClaude Opus 4.8 d7e8ca52a0 Add AGENTS.md
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 19:31:59 +01:00
jackos1998 f1cc0fa25c nixos/estuary: Add Meta NL-ix peering
CI / Check, build and cache nixfiles (push) Has been cancelled
2026-06-14 03:15:28 +01:00
jackos1998 43828ad34c nixos/hass: Add West Wood integration
CI / Check, build and cache nixfiles (push) Has been cancelled
2026-06-14 03:08:33 +01:00
jackos1998 36d7e4a7e3 home-manager/gui: Add Claude status line 2026-06-14 03:08:00 +01:00
jackos1998 2f7d5d3908 nixos/castle: Add claude... 2026-06-14 00:24:05 +01:00
jackos1998 f3a0ca3f57 devshell: Allow deploy-multi without options
CI / Check, build and cache nixfiles (push) Has been cancelled
2026-06-13 22:11:23 +01:00
jackos1998 023b3f6605 nixos/tmproot: Add manpage cache 2026-06-13 21:53:29 +01:00
jackos1998 ecd3a46591 home-manager/gui: Add easyeffects
CI / Check, build and cache nixfiles (push) Failing after 1h52m48s
2026-06-13 20:42:12 +01:00
jackos1998 6bcca599e2 devshell: Fix json2nix warning 2026-06-13 20:36:46 +01:00
jackos1998 93529c578b "Release" 26.06 Irritating
CI / Check, build and cache nixfiles (push) Successful in 2h20m51s
2026-06-13 16:00:18 +01:00
jackos1998 bb32784962 nixos/jackflix: Update external port
CI / Check, build and cache nixfiles (push) Successful in 1h11m55s
2026-06-06 19:48:02 +01:00
jackos1998 6ffa35c414 nixos/chatterbox: Bump mautrix bridges
CI / Check, build and cache nixfiles (push) Successful in 1h14m35s
2026-06-01 20:19:51 +01:00
jackos1998 3cc5448410 nixos/user: Add to group disk
CI / Check, build and cache nixfiles (push) Successful in 1h4m36s
2026-04-18 21:50:36 +01:00
jackos1998 ee4178ee2d nixos/chatterbox: Update mautrix-whatsapp to 26.03
CI / Check, build and cache nixfiles (push) Successful in 1h7m26s
2026-04-12 18:36:06 +01:00
jackos1998 2bf18319c9 nixos/routing-common: Fix keepalived link-local addresses
CI / Check, build and cache nixfiles (push) Successful in 1h17m1s
2026-03-16 15:12:46 +00:00
jackos1998 a394b9124a nixos/routing-common: Fix Cloudflare 2026-03-16 13:37:16 +00:00
jackos1998 5bc48d33a3 nixos: Add tcpdump on all machines 2026-03-16 13:33:08 +00:00
jackos1998 365ef5d49d Update nixpkgs for terraria-server
CI / Check, build and cache nixfiles (push) Successful in 1h3m49s
2026-03-10 21:27:14 +00:00
jackos1998 0206d52fa2 nixos/netboot: Remove pinned iPXE
CI / Check, build and cache nixfiles (push) Successful in 1h15m47s
2026-03-08 14:36:07 +00:00
jackos1998 5526e07e65 Update harmonia
CI / Check, build and cache nixfiles (push) Failing after 2h25m26s
2026-03-07 17:09:50 +00:00
jackos1998 dde682390f nixos/castle: Add lan-lo
CI / Check, build and cache nixfiles (push) Failing after 6m27s
2026-03-04 21:30:53 +00:00
jackos1998 4ec59a64ce nixos/home/routing-common: Add DHCP pool for untrusted LAN 2026-03-03 20:15:45 +00:00
jackos1998 c9c788e261 nixos/estuary: Add john-valorant
CI / Check, build and cache nixfiles (push) Failing after 6m15s
2026-03-01 22:57:03 +00:00
jackos1998 21c24216b4 nixos/whale2: Update Graeme difficulty
CI / Check, build and cache nixfiles (push) Failing after 6m28s
2026-02-17 22:47:25 +00:00
jackos1998 2ecd350fcc nixos/whale2: Update graeme whitelist 2026-02-17 21:54:02 +00:00
jackos1998 3aa873d52a nixos/whale2: Add graeme
CI / Check, build and cache nixfiles (push) Failing after 6m31s
2026-02-16 22:49:22 +00:00
jackos1998 0a8ad18de8 nixos/jackflix: Add ffmpeg
CI / Check, build and cache nixfiles (push) Failing after 6m16s
2026-02-15 19:56:54 +00:00
jackos1998 b6b94fea5a Update nixpkgs-mine for Terraria 1.4.5.5
CI / Check, build and cache nixfiles (push) Failing after 6m18s
2026-02-11 22:16:07 +00:00
jackos1998 de9762b272 shill: Add Terraria server
CI / Check, build and cache nixfiles (push) Failing after 7m4s
2026-02-09 00:06:13 +00:00
jackos1998 8d1f4d51d0 nixos/deploy-rs: Fix systemd-util shellcheck 2026-02-08 21:17:00 +00:00
jackos1998 f1dc04ec4b Update inputs
CI / Check, build and cache nixfiles (push) Failing after 6m18s
2026-01-20 15:13:27 +00:00
jackos1998 7951c777cb nixos/sfh: Disable unifi
CI / Check, build and cache nixfiles (push) Successful in 1h13m56s
2025-12-06 21:59:34 +00:00
jackos1998 b031840f81 nixos/object: Fix harmonia
CI / Check, build and cache nixfiles (push) Failing after 3h13m40s
2025-12-06 15:39:47 +00:00
jackos1998 45861bef08 "Release" 25.11 Hooray 2025-12-06 15:18:36 +00:00
jackos1998 4433395125 nixos/chatterbox: Restore old WhatsApp display name template
CI / Check, build and cache nixfiles (push) Failing after 19s
2025-12-04 10:06:06 +00:00
jackos1998 3306aaab5e nixos/chatterbox: Upgrade mautrix bridges to v25.11 2025-12-04 10:06:06 +00:00
jackos1998 4480302c65 nixos/estuary: Remove old Frys-IX subnet
CI / Check, build and cache nixfiles (push) Failing after 21s
2025-12-01 22:41:13 +00:00
jackos1998 be7fb5a243 home-manager/common: Fix overlays
CI / Check, build and cache nixfiles (push) Successful in 2h39m0s
2025-10-06 10:54:12 +01:00
jackos1998 25758bae08 nixos/middleman: SNAT IPv6 to assigned address
CI / Check, build and cache nixfiles (push) Successful in 2h38m2s
2025-10-01 11:10:41 +01:00
jackos1998 7bfe9ad697 nixos/estuary: Add hillcrest WireGuard
CI / Check, build and cache nixfiles (push) Successful in 2h27m17s
2025-09-27 02:24:35 +01:00
jackos1998 7db5e18974 nixos/jackflix: copyparty: Move /pub to / and put stuff at /priv
CI / Check, build and cache nixfiles (push) Successful in 2h25m8s
2025-09-09 14:34:54 +01:00
jackos1998 20b7da74bf nixos/jackflix: Remove unnecessary insecure packages exception
CI / Check, build and cache nixfiles (push) Successful in 2h28m59s
2025-09-08 23:29:51 +01:00
jackos1998 adaf8b6a83 nixos/jackflix: Add copyparty 2025-09-08 23:28:31 +01:00
jackos1998 1f145334f3 nixos/britway: Disable override_local_dns for headscale
CI / Check, build and cache nixfiles (push) Failing after 12m38s
2025-09-08 21:29:20 +01:00
jackos1998 abf9f1b465 home-manager/gui: Add ffmpeg
CI / Check, build and cache nixfiles (push) Successful in 2h30m16s
2025-09-06 21:56:19 +01:00
jackos1998 f0740741a4 nixos/home/routing-common: Fix mstpd shellcheck
CI / Check, build and cache nixfiles (push) Successful in 2h44m21s
2025-09-06 21:40:05 +01:00
jackos1998 0c0b66b8db nixos/jackflix: Add FlareSolverr 2025-09-06 19:49:12 +01:00
jackos1998 bdf3c04595 nixos/git: Add NAT rules 2025-09-06 19:35:33 +01:00
jackos1998 02795a6ee4 nixos/nvme: Specify Host NQN on command line
CI / Check, build and cache nixfiles (push) Failing after 2h24m47s
2025-09-06 18:02:18 +01:00
jackos1998 8fa4a7ee60 "Release" 25.09 Giving
CI / Check, build and cache nixfiles (push) Failing after 31m46s
2025-09-06 17:14:09 +01:00
jackos1998 773674d879 nixos/chatterbox: Add adzerq to Instagram bridge
CI / Check, build and cache nixfiles (push) Failing after 29m47s
2025-07-23 19:42:35 +01:00
jackos1998 12c5ca126d nixos/middleman: kinkcraft Bluemap
CI / Check, build and cache nixfiles (push) Failing after 30m2s
2025-06-07 23:28:20 +01:00
jackos1998 b38a2a07e2 nixos/estuary: Update FrysIX BGP config to new /23
CI / Check, build and cache nixfiles (push) Failing after 30m16s
2025-06-03 11:06:58 +01:00
jackos1998 0dc474887f Add kinkcraft Minecraft server
CI / Check, build and cache nixfiles (push) Failing after 30m20s
2025-05-29 20:51:56 +01:00
jackos1998 c8bd63ec3e nixos: Add nixlight static IP and WLED hass integration
CI / Check, build and cache nixfiles (push) Failing after 29m45s
2025-05-26 23:25:05 +01:00
jackos1998 d7522f3f97 nixos/whale2: Op kev in kevcraft
CI / Check, build and cache nixfiles (push) Failing after 30m31s
2025-04-24 22:04:45 +01:00
jackos1998 58c76f822f home-manager/gui: Use tmux kill-session in brainrot screensavers
CI / Check, build and cache nixfiles (push) Failing after 29m19s
2025-04-14 13:27:01 +01:00
jackos1998 31bcde23b8 nixos/gui: Enable udisks2
CI / Check, build and cache nixfiles (push) Failing after 5m13s
2025-04-07 23:18:29 +01:00
jackos1998 fc2fa0666e nixos/middleman: Increase worker_processes
CI / Check, build and cache nixfiles (push) Failing after 5m10s
2025-03-28 16:42:54 +00:00
jackos1998 854cc48479 home-manager/gui: Add Brainrot story mode screensaver
CI / Check, build and cache nixfiles (push) Failing after 29m6s
2025-03-28 11:01:46 +00:00
jackos1998 85a4b124e5 pkgs: Remove own terminaltexteffects
CI / Check, build and cache nixfiles (push) Failing after 5m7s
2025-03-27 11:58:36 +00:00
jackos1998 f322f3ebac home-manager/gui: Longer and looping brainrot screensavers
CI / Check, build and cache nixfiles (push) Failing after 29m7s
2025-03-25 10:56:08 +00:00
jackos1998 bc74fb4968 home-manager/gui: Add brainrot screensavers
CI / Check, build and cache nixfiles (push) Failing after 30m15s
2025-03-24 15:09:46 +00:00
jackos1998 584abd4991 nixos/home/hass: Add USB webcam
CI / Check, build and cache nixfiles (push) Successful in 1h12m19s
2025-03-15 01:43:44 +00:00
jackos1998 05074a1fd9 nixos/home/hass: Basic Reolink camera setup
CI / Check, build and cache nixfiles (push) Has been cancelled
2025-03-15 01:07:12 +00:00
jackos1998 69060dfbff nixos/home/routing-common: Add static lease for hass-panel 2025-03-14 22:53:36 +00:00
jackos1998 8e288a9e2a nixos/home/hass: Include scenes.yaml
CI / Check, build and cache nixfiles (push) Successful in 1h17m11s
2025-03-14 17:48:18 +00:00
jackos1998 bb03b6fa76 nixos/home/hass: Add HEOS
CI / Check, build and cache nixfiles (push) Successful in 1h0m24s
2025-03-12 01:55:46 +00:00
jackos1998 fd92cfae6e nixos/home/hass: Include scripts.yaml
CI / Check, build and cache nixfiles (push) Successful in 1h1m12s
2025-03-11 14:35:10 +00:00
jackos1998 25267d09a2 nixos/home/hass: Add androidtv_remote and alarmo
CI / Check, build and cache nixfiles (push) Successful in 59m46s
2025-03-11 02:12:16 +00:00
jackos1998 f02f538ab2 nixos/home/routing-common: Add media DHCP reservations 2025-03-10 22:33:48 +00:00
jackos1998 d319657680 nixos/netboot: Use older iPXE with patch
CI / Check, build and cache nixfiles (push) Successful in 1h3m31s
2025-03-10 22:23:08 +00:00
jackos1998 dff5a4e6d8 nixos/home/hass: Add Irish Rail integration
CI / Check, build and cache nixfiles (push) Successful in 1h9m21s
2025-03-10 14:04:22 +00:00
jackos1998 2a8ced0fec nixos/home/routing-common: Add DNS blocklist
CI / Check, build and cache nixfiles (push) Successful in 1h6m52s
2025-03-10 10:46:21 +00:00
jackos1998 36c7096120 nixos/home/hass: Home Assistant CLI and automation fix
CI / Check, build and cache nixfiles (push) Successful in 2h47m3s
2025-03-10 01:28:14 +00:00
jackos1998 adfcf2f848 nixos/home/hass: Initial Home Assistant setup
CI / Check, build and cache nixfiles (push) Has been cancelled
2025-03-09 22:59:59 +00:00
jackos1998 a3870a4293 nixos/home/sfh: Introduce hass container
CI / Check, build and cache nixfiles (push) Has been cancelled
2025-03-09 20:07:28 +00:00
jackos1998 8f4b61fc2b Update inputs 2025-03-09 20:00:35 +00:00
jackos1998 44e3a3011a nixos/stream: Disable octoprint for now
CI / Check, build and cache nixfiles (push) Failing after 3m16s
2025-03-02 14:21:31 +00:00
jackos1998 45c972cca9 lib: Update public IPs 2025-03-02 13:40:22 +00:00
jackos1998 7bd5b8cbdf nixos/whale2: Add kevcraft
CI / Check, build and cache nixfiles (push) Failing after 2m33s
2025-02-18 17:15:03 +00:00
jackos1998 d1eb9cc981 nixos/toot: Add BlueSky PDS
CI / Check, build and cache nixfiles (push) Failing after 3m4s
2025-01-31 14:54:40 +00:00
jackos1998 7a2ebf6872 nixos: Add ADB stuff
CI / Check, build and cache nixfiles (push) Successful in 1h3m46s
2025-01-26 18:33:04 +00:00
jackos1998 72b8bd089c nixos/uk: Add WireGuard VPN for access
CI / Check, build and cache nixfiles (push) Successful in 1h15m33s
2025-01-22 19:19:03 +00:00
jackos1998 cff229f487 nixos: Add britway
CI / Check, build and cache nixfiles (push) Successful in 1h3m58s
2025-01-19 23:58:51 +00:00
jackos1998 f3ac3cd67f nixos/middleman: Add pubkey and HTTP access to p.nul.ie
CI / Check, build and cache nixfiles (push) Successful in 51m34s
2025-01-16 15:20:57 +00:00
jackos1998 820bb2de5b lib: River IP update
CI / Check, build and cache nixfiles (push) Successful in 1h4m34s
Installer / Build installer (push) Successful in 5m54s
2025-01-01 19:14:04 +00:00
jackos1998 7d3ad52a44 devshell: Add git config safe.directory for build-n-switch
CI / Check, build and cache nixfiles (push) Successful in 1h2m7s
2024-12-23 10:32:13 +00:00
jackos1998 2cdb98e898 nixos/common: Disable channels
CI / Check, build and cache nixfiles (push) Successful in 53m0s
2024-12-12 12:38:01 +00:00
jackos1998 b717b1ceb4 nixos/gui: Add /dev/player0 VID
CI / Check, build and cache nixfiles (push) Successful in 1h1m16s
2024-12-11 17:17:33 +00:00
jackos1998 f31ce61c2b Update borgthin
CI / Check, build and cache nixfiles (push) Successful in 2h31m34s
2024-11-30 19:31:58 +00:00
jackos1998 aec22942f7 Update latest Linux kernel to 6.12 2024-11-30 19:31:43 +00:00
jackos1998 fc8676c3bb devshell: Remove deprecated Nix command stuff 2024-11-30 19:19:23 +00:00
jackos1998 2915e42a1d ci: Group CI jobs
CI / Check, build and cache nixfiles (push) Failing after 33m39s
2024-11-30 18:05:22 +00:00
jackos1998 5783d3a51e Update nixpkgs-stable to 24.11 2024-11-30 17:45:59 +00:00
jackos1998 2fe94bba23 nixos/git: Add longer timeout for Gitea actions runner
CI / Check, build and cache Nix flake (push) Successful in 2h29m25s
2024-11-27 12:29:04 +00:00
jackos1998 4b42960d26 home-manager/gui: Update alacritty import setting to new section
CI / Check, build and cache Nix flake (push) Failing after 3h1m26s
2024-11-26 23:19:58 +00:00
jackos1998 56e9abf945 ci: Build and grab path for jobs in separate calls
CI / Check, build and cache Nix flake (push) Has been cancelled
The old build-n-parse seemed to output null sometimes.....
2024-11-26 22:45:19 +00:00
jackos1998 4e2c2f92f0 nixos/middleman: Remove config for Matrix sliding sync proxy
CI / Check, build and cache Nix flake (push) Failing after 6m29s
2024-11-26 22:15:53 +00:00
jackos1998 caa208b288 nixos/netboot: Use older version of iPXE for now
CI / Check, build and cache Nix flake (push) Failing after 6m33s
2024-11-26 22:01:42 +00:00
jackos1998 9e6f885c17 ci: Tweak log messages 2024-11-26 22:00:17 +00:00
jackos1998 d8ca87bfd8 pkgs: Remove glfw-wayland-minecraft
CI / Check, build and cache Nix flake (push) Failing after 6m15s
2024-11-26 21:23:50 +00:00
jackos1998 e9467e0cc7 ci: Build and cache CI jobs individually
CI / Check, build and cache Nix flake (push) Failing after 6m27s
2024-11-26 12:37:47 +00:00
jackos1998 6c98ef8944 Revert "nixos/home/routing-common: Move Tailscale to home routers"
CI / Check, build and cache Nix flake (push) Failing after 1h15m14s
This reverts commit 7c05b6158f.
2024-11-26 00:04:43 +00:00
jackos1998 18981e240b nixos/nvme: Update to libnvme v1.11.1 to fix LTS kernels 2024-11-25 23:58:15 +00:00
jackos1998 df7e5953eb Update nixpkgs-unstable (and other inputs)
CI / Check, build and cache Nix flake (push) Has been cancelled
2024-11-25 23:10:24 +00:00
jackos1998 71d1c3f9c2 Ensure borgbackup cache / config is persisted
CI / Check, build and cache Nix flake (push) Successful in 32m28s
2024-11-16 18:46:09 +00:00
jackos1998 1453a755c3 Add (now unused) Enshrouded server 2024-11-16 18:08:10 +00:00
jackos1998 970af805e9 home-manager/gui: Swap swaysome container binds
CI / Check, build and cache Nix flake (push) Successful in 23m18s
2024-11-08 11:47:35 +00:00
jackos1998 383e9a9b1e home-manager/gui: Add swaysome
CI / Check, build and cache Nix flake (push) Successful in 23m43s
2024-11-07 18:21:09 +00:00
jackos1998 26a16d0629 home-manager/gui: Disable ligatures in kitty
CI / Check, build and cache Nix flake (push) Successful in 29m30s
2024-11-06 13:16:56 +00:00
jackos1998 208de7654e home-manager/gui: Use rofi-wayland 2024-11-06 13:16:51 +00:00
jackos1998 f577e7d58a nixos/routing-common: Increase bandwidth for CAKE
CI / Check, build and cache Nix flake (push) Successful in 28m44s
2024-10-31 22:27:55 +00:00
jackos1998 6130ee73be nixos/tower: Add brightness keybinds
CI / Check, build and cache Nix flake (push) Successful in 29m59s
2024-10-26 20:24:27 +01:00
jackos1998 5d827aa00c home-manager/gui: Add xdg-utils to home.packages 2024-10-26 18:32:24 +01:00
jackos1998 173ffc0044 home-manager/gui: Add "Activate Linux" watermark
CI / Check, build and cache Nix flake (push) Successful in 30m5s
2024-10-16 11:32:14 +01:00
jackos1998 b113f2f48d home-manager/gui: Add Git LFS
CI / Check, build and cache Nix flake (push) Successful in 28m47s
2024-09-04 21:53:26 +01:00
jackos1998 7c67eaff21 nixos/colony: Add qclk management container
CI / Check, build and cache Nix flake (push) Successful in 34m42s
2024-09-01 19:22:03 +01:00
jackos1998 d1f1b84e82 Use fork of ragenix 2024-09-01 14:03:27 +01:00
jackos1998 e3cb2adbb6 nixos/castle: Add recursive-nix feature 2024-09-01 14:03:05 +01:00
jackos1998 736c406eb5 Update nixpkgs-mine for mautrix-whatsapp 0.10.9
CI / Check, build and cache Nix flake (push) Successful in 27m54s
2024-08-26 11:59:28 +01:00
jackos1998 8e9b750ac8 nixos: Set up remote printing
CI / Check, build and cache Nix flake (push) Successful in 27m42s
2024-08-20 10:36:21 +01:00
jackos1998 51c5578840 nixos/stream: Add OctoPrint
CI / Check, build and cache Nix flake (push) Failing after 2m16s
2024-08-20 01:03:49 +01:00
jackos1998 e174af45f6 nixos/castle: Emulate ARM 2024-08-17 12:39:36 +01:00
jackos1998 198e7188bd home-manager/gui: Use upstream unstable nixpkgs' chromium
CI / Check, build and cache Nix flake (push) Successful in 27m18s
2024-08-13 12:15:33 +01:00
jackos1998 571f8f1504 home-manager/gui: Add xournalpp
CI / Check, build and cache Nix flake (push) Successful in 18m42s
2024-07-31 11:28:24 +01:00
jackos1998 64c3fe682c nixos/home/routing-common: Only run Tailscale on active router
CI / Check, build and cache Nix flake (push) Successful in 26m33s
2024-07-31 10:20:19 +01:00
jackos1998 7c05b6158f nixos/home/routing-common: Move Tailscale to home routers
CI / Check, build and cache Nix flake (push) Successful in 18m12s
2024-07-22 16:22:08 +01:00
jackos1998 c9ab90547f Fix installer workflow short rev
CI / Check, build and cache Nix flake (push) Has been cancelled
Installer / Build installer (push) Successful in 4m23s
2024-07-21 13:01:03 +01:00
jackos1998 63d929c8e8 nixos: Include mutable flake in every system
CI / Check, build and cache Nix flake (push) Successful in 17m41s
Installer / Build installer (push) Successful in 4m20s
2024-07-21 12:37:32 +01:00
jackos1998 bbb87a2d69 devshell: Add deploy-multi command
CI / Check, build and cache Nix flake (push) Successful in 17m26s
2024-07-21 00:33:16 +01:00
jackos1998 e5d5847b89 nixos/middleman: Disable zstd in nginx for now
CI / Check, build and cache Nix flake (push) Successful in 25m3s
2024-07-20 22:41:01 +01:00
jackos1998 9e7294e871 nixos/shill: Rename atticd mount to harmonia 2024-07-20 21:19:25 +01:00
jackos1998 69216c6b4c Use harmonia instead of attic for binary cache
CI / Check, build and cache Nix flake (push) Successful in 2h1m7s
2024-07-20 19:04:51 +01:00
jackos1998 1ea172e690 nixos/vaultwarden: Use non-privileged port
CI / Check, build and cache Nix flake (push) Successful in 18m41s
2024-07-19 18:06:14 +01:00
jackos1998 b7be45715e nixos/britway: Update headscale config
CI / Check, build and cache Nix flake (push) Failing after 14m11s
2024-07-15 22:58:49 +01:00
jackos1998 3522a7078b Re-update nixpkgs 2024-07-15 22:58:42 +01:00
jackos1998 b44f0e74e8 Disable modrinth-app 2024-07-15 00:25:05 +01:00
jackos1998 7c57f00b27 nixos/britway: Update Headscale
CI / Check, build and cache Nix flake (push) Failing after 2h14m36s
2024-07-14 22:04:03 +01:00
jackos1998 c9d36ec65b home-manager/gui: New cursor theme
CI / Check, build and cache Nix flake (push) Has been cancelled
2024-07-14 21:49:37 +01:00
jackos1998 d8f97b9316 Update inputs 2024-07-14 21:21:43 +01:00
jackos1998 d5bb2f6787 nixos/routing-common: Start / stop radvd only for IPv6
CI / Check, build and cache Nix flake (push) Successful in 16m56s
2024-07-11 00:16:33 +01:00
jackos1998 ced82fc002 Update river public IP
CI / Check, build and cache Nix flake (push) Successful in 17m47s
2024-07-10 20:26:38 +01:00
jackos1998 3535d2fd90 nixos/shill: Use MemoryMax instead of MemoryMin
CI / Check, build and cache Nix flake (push) Successful in 17m4s
2024-07-07 12:02:50 +01:00
jackos1998 4e207c3397 nixos/colony: Disable KSM for now 2024-07-07 11:57:45 +01:00
jackos1998 bc4e75a6a5 nixos/middleman: Fix Element config.json
CI / Check, build and cache Nix flake (push) Successful in 17m37s
2024-07-05 16:30:34 +01:00
jackos1998 2ae922f3e8 home-manager/gui: Adjust brightness for wallpapers
CI / Check, build and cache Nix flake (push) Successful in 17m51s
2024-07-04 18:07:41 +01:00
jackos1998 f263fdca3e nixos/castle: Add left monitor wallpaper
CI / Check, build and cache Nix flake (push) Successful in 18m6s
2024-07-02 22:22:10 +01:00
jackos1998 1232e9cb30 Update nixpkgs
CI / Check, build and cache Nix flake (push) Successful in 49m21s
2024-07-02 12:07:52 +01:00
jackos1998 fbb29162ca nixos/colony: Enable KSM 2024-07-01 14:43:07 +01:00
jackos1998 7ab57a12b7 Reduce core count for CI
CI / Check, build and cache Nix flake (push) Successful in 1h27m30s
Installer / Build installer (push) Successful in 4m44s
2024-06-30 15:02:21 +01:00
jackos1998 4e947d4b1e nixos/unifi: Set up UniFi controller
CI / Check, build and cache Nix flake (push) Failing after 40m53s
2024-06-30 12:21:21 +01:00
jackos1998 b68e82ae03 nixos: Move castle to home
CI / Check, build and cache Nix flake (push) Successful in 42m12s
2024-06-30 04:01:56 +01:00
jackos1998 91489551b9 nixos: Working castle NVMe-oF root 2024-06-30 03:59:46 +01:00
jackos1998 86c99c2cbb nixos/build: Add Intel NIC drivers and increased timeout 2024-06-30 03:38:48 +01:00
jackos1998 7e2dfc21c6 nixos/sfh: Working containers
CI / Check, build and cache Nix flake (push) Successful in 44m19s
2024-06-30 01:52:52 +01:00
jackos1998 9ac63220d5 nixos/installer: Add NFS client
CI / Check, build and cache Nix flake (push) Successful in 42m53s
Installer / Build installer (push) Successful in 5m15s
2024-06-30 00:07:12 +01:00
jackos1998 ffa5d19854 home-manager/common: Add nix-tree package
Installer / Build installer (push) Has been cancelled
CI / Check, build and cache Nix flake (push) Has been cancelled
2024-06-29 23:42:31 +01:00
jackos1998 19fb29213e nixos/netboot: Mount /boot via kernel command line 2024-06-29 23:41:01 +01:00
jackos1998 f9870abc9e Working "shill From Home" full network boot 2024-06-29 23:12:21 +01:00
jackos1998 84ca556c47 nixos: Initial netbooting installer
CI / Check, build and cache Nix flake (push) Successful in 34m36s
Installer / Build installer (push) Successful in 4m34s
2024-06-24 00:42:26 +01:00
jackos1998 9f2651e352 nixos/installer: Disable GUI stuff 2024-06-23 19:00:29 +01:00
jackos1998 bce876ec42 Add release token to installer workflow
CI / Check, build and cache Nix flake (push) Has been cancelled
Installer / Build installer (push) Successful in 6m0s
2024-06-22 16:24:30 +01:00
jackos1998 bc8adcecad Update river public IP 2024-06-22 15:26:48 +01:00
jackos1998 8878ce56c4 nixos/kelder: MTU fix + disable all local redirects
CI / Check, build and cache Nix flake (push) Successful in 33m1s
2024-06-21 21:42:17 +01:00
jackos1998 dd9439b7fa nixos/shill: Add jam container
CI / Check, build and cache Nix flake (push) Successful in 33m30s
2024-06-20 23:43:07 +01:00
jackos1998 bc9f266ef0 nixos/containers: Remove workaround for systemd-nspawn@ drop-in 2024-06-20 23:37:43 +01:00
jackos1998 1b083d298b nixos/castle: Re-add boardie
CI / Check, build and cache Nix flake (push) Successful in 32m55s
2024-06-18 23:29:48 +01:00
jackos1998 83ba26735e nixos/colony: Add extra disk to darts VM
CI / Check, build and cache Nix flake (push) Failing after 6m28s
2024-06-15 20:05:27 +01:00
jackos1998 50bd96ccdf nixos/chatterbox: Add ffmpeg to mautrix bridges
CI / Check, build and cache Nix flake (push) Successful in 32m8s
2024-06-10 13:27:02 +01:00
jackos1998 a133cfb189 nixos/installer: Use my nixpkgs
CI / Check, build and cache Nix flake (push) Successful in 33m39s
2024-06-09 01:49:18 +01:00
jackos1998 051e68254e nixos/chatterbox: Add Instagram bridge 2024-06-09 01:46:00 +01:00
jackos1998 3fa8ab43ef nixos/chatterbox: Add Messenger bridge 2024-06-08 23:08:27 +01:00
jackos1998 c6720f87c1 nixos/chatterbox: Add WhatsApp bridge 2024-06-08 22:16:02 +01:00
jackos1998 55ecdddadb home-manager/gui: Fix screensaver top output, add cowsay to fortune
CI / Check, build and cache Nix flake (push) Failing after 1m20s
2024-06-07 16:45:35 +01:00
jackos1998 9b5173a587 home-manager/gui: More screensavers and options
CI / Check, build and cache Nix flake (push) Failing after 1m5s
2024-06-07 15:27:20 +01:00
jackos1998 73f5a690bb home-manager/gui: Add cmatrix and TTE screensavers
CI / Check, build and cache Nix flake (push) Failing after 1m23s
2024-06-07 03:11:55 +01:00
jackos1998 54db751e23 pkgs: Add terminaltexteffects 2024-06-07 02:36:12 +01:00
jackos1998 85299b65dc home-manager/gui: Working randomised doomsaver 2024-06-07 02:26:27 +01:00
jackos1998 45bda5b588 pkgs/chocolate-doom2xx: Add -demoloopi flag
CI / Check, build and cache Nix flake (push) Successful in 32m58s
2024-06-06 14:39:09 +01:00
jackos1998 9114f5ce74 home-manager/gui: Add Doom lock screen
CI / Check, build and cache Nix flake (push) Successful in 33m7s
2024-06-06 02:30:22 +01:00
jackos1998 3925c1090e pkgs: Add window2layer and swaylock-plugin 2024-06-06 02:08:35 +01:00
jackos1998 e74538a1a9 pkgs: Add chocolate-doom2xx 2024-06-06 02:02:28 +01:00
jackos1998 b8ee21b6e8 nixos/home/routing-common: More Disney+ IPv6 workarounds 2024-06-05 20:21:48 +01:00
jackos1998 41fd54cfad nixos/whale2: Update to netavark backend
CI / Check, build and cache Nix flake (push) Successful in 31m25s
2024-06-03 18:29:36 +01:00
jackos1998 1df34e0515 lib: Update latest kernel
CI / Check, build and cache Nix flake (push) Successful in 33m0s
Installer / Build installer (push) Failing after 5m31s
2024-06-01 17:21:27 +01:00
jackos1998 ce0c194761 Update all inputs (JackOS 24.06 "Carbrain")
CI / Check, build and cache Nix flake (push) Successful in 32m36s
2024-06-01 14:30:35 +01:00
jackos1998 a5e51ddd6b nixos/home: Filter out Disney+ IPv6 DNS queries
CI / Check, build and cache Nix flake (push) Successful in 36m4s
2024-05-16 21:05:48 +01:00
jackos1998 746e0b9dc4 nixos/castle: Fix PipeWire latency config
CI / Check, build and cache Nix flake (push) Failing after 58s
2024-05-11 16:10:15 +01:00
jackos1998 77600a64fc nixos/gui: Add udev rules for FT
CI / Check, build and cache Nix flake (push) Successful in 34m43s
2024-05-11 00:46:13 +01:00
jackos1998 c6d5705097 nixos/jackflix: Add PhotoPrism
CI / Check, build and cache Nix flake (push) Successful in 34m59s
2024-05-06 00:57:52 +01:00
jackos1998 6eefe97764 lib: Update river public IP
CI / Check, build and cache Nix flake (push) Successful in 35m59s
2024-04-13 15:04:52 +01:00
jackos1998 4bc4fe3ee8 Update my nixpkgs (spdk 24.01) 2024-04-13 15:02:54 +01:00
jackos1998 57ec2bfc1b nixos/home/routing-common: Make keepalived ping more resilient
CI / Check, build and cache Nix flake (push) Successful in 33m37s
2024-04-05 15:22:10 +01:00
jackos1998 d9d1150feb Update nixpkgs and home-manager
CI / Check, build and cache Nix flake (push) Successful in 1h21m12s
2024-04-04 19:08:12 +01:00
jackos1998 92896d8e52 nixos/stream: Un-hardcode deploy host
CI / Check, build and cache Nix flake (push) Successful in 35m24s
2024-03-25 11:20:58 +00:00
jackos1998 477ffca33e nixos/common: Update registry to point to nixpkgs flake 2024-03-25 11:17:30 +00:00
jackos1998 fdc65c544e nixos/home/routing-common: Add ping test to keepalived
CI / Check, build and cache Nix flake (push) Successful in 35m51s
2024-03-24 13:32:03 +00:00
jackos1998 945302b7c0 lib: Update river IP 2024-03-24 12:45:43 +00:00
jackos1998 5ccf19cab8 nixos/colony: Fix LVM activatio dependency cycle
CI / Check, build and cache Nix flake (push) Successful in 35m28s
2024-03-23 13:25:32 +00:00
jackos1998 7b61dd7f03 nixos/colony: Enable PCIe AER 2024-03-23 12:45:59 +00:00
jackos1998 682865a0e1 nixos/l2mesh: Add option to enable UDP encapsulation 2024-03-23 12:14:26 +00:00
jackos1998 a0e4cf2479 lib: Bump JackOS version
CI / Check, build and cache Nix flake (push) Successful in 24m28s
2024-03-22 21:23:18 +00:00
jackos1998 a5880d66f4 home-manager/gui: Use python3Packages instead of python310Packages
CI / Check, build and cache Nix flake (push) Successful in 1h12m52s
2024-03-21 23:32:01 +00:00
jackos1998 27a4583879 pkgs/modrinth-app: Fix deps hash
CI / Check, build and cache Nix flake (push) Has been cancelled
2024-03-21 23:10:42 +00:00
jackos1998 fdbf5f8aca lib: Update river IP 2024-03-21 21:16:01 +00:00
jackos1998 40c491aa14 nixos/home/routing-common: Add MSS clamping to work around PMTUD
CI / Check, build and cache Nix flake (push) Failing after 1h4m53s
2024-03-21 20:42:06 +00:00
jackos1998 1a8740fb9c nixos/home/routing-common: Increase RTT for CAKE 2024-03-21 20:41:28 +00:00
jackos1998 f857e751b5 nixos/home/routing-common: Restart kea on failure 2024-03-21 20:40:38 +00:00
jackos1998 b420f2377c Use fork of sharry for now
CI / Check, build and cache Nix flake (push) Failing after 1h2m37s
2024-03-18 21:22:52 +00:00
jackos1998 7d90b5ecb8 Fix API changes from updates
CI / Check, build and cache Nix flake (push) Failing after 16m14s
2024-03-18 20:23:52 +00:00
jackos1998 ace979c226 Update inputs
CI / Check, build and cache Nix flake (push) Failing after 6m13s
2024-03-18 17:41:41 +00:00
jackos1998 f540edb361 nixos/routing-common: Clear IPv6 local default route
CI / Check, build and cache Nix flake (push) Successful in 25m16s
2024-03-13 21:52:09 +00:00
jackos1998 6bc5cd79da lib: Update river IP 2024-03-13 21:31:05 +00:00
jackos1998 5ec77dfde6 nixos/routing-common: Add DNS for Shytzel and wave
CI / Check, build and cache Nix flake (push) Successful in 25m32s
2024-03-13 21:00:20 +00:00
jackos1998 52623d458e nixos/simpcraft: Update to Simpcraft 0.2.1
CI / Check, build and cache Nix flake (push) Successful in 26m17s
2024-01-27 14:36:40 +00:00
jackos1998 23b29f0707 nixos/acquisition: Add transmission workaround
CI / Check, build and cache Nix flake (push) Successful in 26m39s
2024-01-21 23:27:27 +00:00
jackos1998 338902497f nixos/simpcraft: Increase memory allocation to 8GiB
CI / Check, build and cache Nix flake (push) Successful in 26m19s
2024-01-20 12:07:43 +00:00
jackos1998 977846991a nixos/simpcraft: Disable autosave during backup
CI / Check, build and cache Nix flake (push) Successful in 26m20s
2024-01-19 20:06:23 +00:00
jackos1998 0e8aec58fb nixos/simpcraft: Update at odd intervals
CI / Check, build and cache Nix flake (push) Successful in 25m52s
2024-01-19 00:46:55 +00:00
jackos1998 0f1de58917 nixos/simpcraft: Add backup
CI / Check, build and cache Nix flake (push) Successful in 25m52s
2024-01-18 12:12:06 +00:00
jackos1998 32183bd331 devshell/commands: Overwrite home symlink if needed
CI / Check, build and cache Nix flake (push) Successful in 26m29s
2024-01-15 14:59:01 +00:00
jackos1998 1813ca1927 nixos/simpcraft: Add missing environment file
CI / Check, build and cache Nix flake (push) Successful in 25m59s
2024-01-15 13:21:25 +00:00
jackos1998 51d44e472a pkgs: Add working Minecraft on Wayland GLFW
CI / Check, build and cache Nix flake (push) Failing after 12m18s
2024-01-12 14:00:50 +00:00
jackos1998 44e87aa387 Add wastebin
CI / Check, build and cache Nix flake (push) Successful in 27m3s
2024-01-10 15:21:40 +00:00
jackos1998 f90deabb50 nixos/whale2: Update Simpcraft to 0.2.0
CI / Check, build and cache Nix flake (push) Successful in 25m49s
2024-01-10 01:10:13 +00:00
296 changed files with 22007 additions and 4155 deletions

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
---
name: flash-openwrt
description: >-
Flash a flake-built OpenWrt image onto one of the OpenWrt boxes (currently fergal): build the
image, pre-flight the box, back up its config, validate and stage the image, run sysupgrade, and
verify what came back. Use when the user wants to flash, reflash, upgrade or sysupgrade an OpenWrt
box, or after changing its baked-in package list.
---
# Flash an OpenWrt box
The canonical, agent-agnostic procedure lives in the repo at
[`docs/openwrt-flash.md`](../../../docs/openwrt-flash.md). Read it and follow the phases in order.
Key reminders (see the doc for the full steps):
- **Stop at the ⏸ before Phase 5.** Flashing reboots the box and cannot be interrupted partway.
Confirm with the user, and confirm a serial console is reachable, *before* writing anything.
- **Packages are baked into the image**, so a package change means a reflash. Edit the box's list in
[`openwrt/default.nix`](../../../openwrt/default.nix), rebuild, and check the built `.manifest` —
a package name that doesn't exist is not a build error, it just isn't in the image.
- **`scp` does not work** on these boxes (no `sftp-server`). Move files with
`ssh <box> 'cat > /dev/…' < file` and `ssh <box> 'cat …' > file`.
- **Detach the upgrade with `setsid`**, not `nohup` (absent on busybox). `sysupgrade` kills the SSH
session mid-run, and an attached run dies with it — possibly after the firmware is erased.
- **Never reach for `sysupgrade -c`.** It needs `/overlay/upper/etc` and aborts *after* erasing the
firmware when that is missing, which is exactly the initramfs case. Plain `sysupgrade` already
keeps everything in `/lib/upgrade/keep.d/`.
- **Poll SSH to detect the reboot, never ping.** Successful pings return in milliseconds, so a
"wait for down" loop completes instantly and reports nonsense. Sleep between probes; expect about
three minutes.
- **Verify after**, don't assume: revision, management address, package count against the manifest,
and that the new packages are present and running.
The images are declared in [`openwrt/default.nix`](../../../openwrt/default.nix); background on the
outputs and the pinned package feeds is in
[`docs/deployment.md`](../../../docs/deployment.md#openwrt-images).
+40
View File
@@ -0,0 +1,40 @@
---
name: install-box
description: >-
Install a new NixOS box into this flake, from bare hardware booted into the custom installer
through to a deployable system: probe the hardware, partition and format the disks, write the box
config and flake entry, run do-install, and document the box. Use when the user wants to install,
bootstrap, provision or add a new box/host/machine.
---
# Install a box
The canonical, agent-agnostic procedure lives in the repo at
[`docs/install-box.md`](../../../docs/install-box.md). Read it and follow the phases in order.
Key reminders (see the doc for the full steps):
- It is **guided, not automated** — stop at the ⏸ points: settling what the box actually is
(Phase 1), wiping and partitioning disks (Phase 3), and running `do-install` (Phase 6). The user
often wants to do the install step by hand.
- **Phase 1 is not derivable from the hardware.** Name, site, role, channel and whether the box gets
assignments now all have to come from the user. Ask before writing files.
- **`show-hw-config` is a shell alias**, so it needs `installer-shell bash -lic show-hw-config`.
Run it twice: once early for the kernel-module lists, once after mounting for the filesystems.
- **`git add` the new box directory before evaluating** — the flake reads through git, and an
untracked path fails as "Path … is not tracked by Git" rather than as a Nix error.
- **Validate with `check-system <host>`**, not `build-system` — evaluation catches module and option
errors cheaply.
- **Seed the SSH host key from the installer** (Phase 3) by copying `/etc/ssh/ssh_host_*` onto the
persist volume. The installer regenerates them each boot, so they are safe to adopt, and it means
`my.secrets.key` can be set and secrets encrypted before the install rather than after first boot.
- **Every box declares a secret even when its own config declares none** — `my.user` pulls in
`user-passwd.txt` by default — so setting `my.secrets.key` always requires
`ragenix --rekey-one secrets/user-passwd.txt.age`. Check with
`nix eval .#nixosConfigurations.<host>.config.age.secrets --apply builtins.attrNames` rather than
assuming there is nothing to do. Re-encrypt selectively; `ragenix --rekey` rewrites every secret
in `secrets/` and drowns the real change in churn.
- Take **everything** useful out of `show-hw-config`, not just the modules and filesystems — drop an
option only when a nixfiles module already sets it.
- Finish with Phase 8: box page, site index row, `networking.md` prose. Don't hand-edit anything
between `<!-- ... -->` markers.
+51
View File
@@ -0,0 +1,51 @@
---
name: upgrade-nixpkgs
description: >-
Upgrade all four nixpkgs channels (unstable, stable, mine, mine-stable) and home-manager for this
flake: check for a NixOS stable bump, rebase the devplayer0 nixpkgs fork, update kernel and
release metadata, refresh pins, sweep version-gated TODOs, and review compatibility of nixpkgs
apps and services and other flake inputs. Use when the user wants to update/bump nixpkgs,
refresh the pins, or do the periodic nixpkgs/home-manager upgrade.
---
# Upgrade nixpkgs
Read [`docs/nixpkgs-upgrade.md`](../../../docs/nixpkgs-upgrade.md), the canonical procedure, and
follow its phases in order.
Key reminders (see the doc for the full steps):
- Read and update the progress document, `docs/nixpkgs-upgrade-progress.md`, as you work.
On resume, reconcile it with the working copy and remote refs. Record what was reviewed,
what was approved, the reason and exit condition for each workaround, and the next open step.
Keep it out of the upgrade's commits. At wrap-up, move open follow-ups to TODOs, box pages or
commit messages, then delete it.
- Commit the pin and input refresh separately from procedure changes and from each service
migration, and list the notable version upgrades in the refresh's description.
- It is **guided, not automated** — do the mechanical and investigative work but stop at the ⏸
points: pushing the fork, resolving rebase conflicts, applying a stable-channel bump, choosing a
new release codename, deleting version guards, and choosing how to handle service compatibility
blockers. Present channel moves and migrations as choices before making either change.
If a temporary pin is chosen, add a TODO for the deferred migration.
- **Check the current NixOS stable first** (Phase 1) — the fork's `devplayer0-stable` rebase target
and the `flake.nix` stable pins must agree on one release.
- Use `../nixpkgs` relative to this flake's root as the default checkout of the
`devplayer0/nixpkgs` fork.
- **Fetch the upstream branches explicitly** and re-verify the fork patch stack with `git log`.
Check for requested backports on each rebase base before cherry-picking them.
Compare both patch stacks with `git range-diff` and summarize the changes before asking to push.
- After pushing the rebased fork branches, **wait for the GitHub mirror to catch up** before
refreshing flake pins. The `nixpkgs-mine*` inputs fetch from GitHub, not the fork's primary
remote; verify both GitHub branch tips match the pushed local tips first.
- After refreshing the pins, update `lib/constants.nix` to the current explicit LTS and latest
kernel package attributes, and update the `lib/default.nix` version overlay's `YY.MM` prefix to
the current month. Change its codename only when the stable channel advances.
- Review the apps and services supplied by each nixpkgs channel in use (Phase 3). Compare the old
and candidate versions and module options, and check release notes for removals, changed defaults,
compatibility with persisted data, and migrations that evaluation may miss.
- Compare each direct flake input's pin with its candidate for fixes and breaking changes.
Include the refreshes in the main upgrade. Ask before changing the release track, moving an
intentional compatibility pin, or deferring an update that needs a migration.
- After the cheap evaluations pass, build the actual devshell and one representative NixOS system
(prefer the local box). `nix flake check --no-build` does not expose dependency build failures;
this is especially important when updating build-tool inputs such as Determinate Nix.
+18
View File
@@ -0,0 +1,18 @@
{
"permissions": {
"allow": [
"Bash(nix eval:*)",
"Bash(nix flake check:*)",
"Bash(nix build:*)",
"Bash(check-system:*)",
"Bash(build-system:*)",
"Bash(build-home:*)",
"Bash(git status:*)",
"Bash(git diff:*)",
"Bash(git log:*)",
"Bash(git show:*)",
"Bash(drill:*)",
"Bash(ping:*)"
]
}
}
+1
View File
@@ -0,0 +1 @@
../.agents/skills
+4 -2
View File
@@ -1,2 +1,4 @@
watch_file devshell/{default,commands,install,vm-tasks}.nix
use flake
watch_file devshell/*
# --accept-flake-config trusts the flake's nixConfig (our Harmonia cache) non-interactively, so
# direnv doesn't stall on the trust prompt.
use flake . --accept-flake-config
+41 -23
View File
@@ -4,36 +4,54 @@ on:
push:
branches: [master]
# Only the newest commit is worth building and caching
concurrency:
group: ci
cancel-in-progress: true
jobs:
check:
name: Check, build and cache Nix flake
runs-on: ubuntu-22.04
name: Check, build and cache nixfiles
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- uses: actions/checkout@v6
- uses: DeterminateSystems/determinate-nix-action@v3
with:
# Gitea will supply a token in GITHUB_TOKEN, which this action will
# try to pass to Nix when downloading from GitHub
github_access_token: ${{ secrets.GH_PULL_TOKEN }}
extra_nix_config: |
# Gitea will supply a token in GITHUB_TOKEN, which this action passes to
# Nix (as access-tokens) when downloading from GitHub
github-token: ${{ secrets.GH_PULL_TOKEN }}
extra-conf: |
# Make sure we're using sandbox
sandbox-fallback = false
# Big C++ projects fill up memory...
cores = 6
extra-substituters = https://nix-cache.nul.ie/main
extra-trusted-public-keys = main:mMChkG8LwXrFirVfudqjSHasK1jV31OVElYD3eImYl8=
- name: Set up attic
run: |
nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \
login --set-default colony https://nix-cache.nul.ie "${{ secrets.NIX_CACHE_TOKEN }}"
# Determinate performance features
lazy-trees = true
eval-cores = 0
accept-flake-config = true
extra-substituters = https://nix-cache.nul.ie
extra-trusted-public-keys = nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4=
- name: Check flake
run: nix flake check
- name: Build the world
id: ifd
run: |
reasons="$(nix eval --option allow-import-from-derivation false --json .#ciIfdReasons.x86_64-linux)"
required="$(jq -r 'length > 0' <<< "$reasons")"
echo "required=$required" >> "$GITHUB_OUTPUT"
if [[ "$required" == true ]]; then
jq -r '.[] | "::warning::\(.). The flake check will run after the target builds."' <<< "$reasons"
else
nix flake check --no-build --option allow-import-from-derivation false
fi
- name: Build (and cache) the world
id: build
run: |
path=$(nix build --no-link .#ci.x86_64-linux --json | jq -r .[0].outputs.out)
echo "path=$path" >> "$GITHUB_OUTPUT"
- name: Push to cache
run: |
nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \
push main ${{ steps.build.outputs.path }}
env:
HARMONIA_SSH_KEY: ${{ secrets.HARMONIA_SSH_KEY }}
CI_IFD_REQUIRED: ${{ steps.ifd.outputs.required }}
run: >-
nix shell .#nixpkgs.unstable.x86_64-linux.python3 .#nixpkgs.unstable.x86_64-linux.nix-eval-jobs
--command python3 ci/build-and-cache.py
+20 -19
View File
@@ -7,29 +7,29 @@ on:
jobs:
installer:
name: Build installer
runs-on: ubuntu-22.04
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: https://github.com/actions/setup-go@v4
- uses: actions/checkout@v6
- uses: DeterminateSystems/determinate-nix-action@v3
with:
go-version: '>=1.20.1'
- uses: cachix/install-nix-action@v23
with:
github_access_token: ${{ secrets.GH_PULL_TOKEN }}
extra_nix_config: |
# Gitea will supply a token in GITHUB_TOKEN, which this action passes to
# Nix (as access-tokens) when downloading from GitHub
github-token: ${{ secrets.GH_PULL_TOKEN }}
extra-conf: |
# Make sure we're using sandbox
sandbox-fallback = false
extra-substituters = https://nix-cache.nul.ie/main
extra-trusted-public-keys = main:mMChkG8LwXrFirVfudqjSHasK1jV31OVElYD3eImYl8=
- name: Set up attic
# Determinate performance features
lazy-trees = true
eval-cores = 0
extra-substituters = https://nix-cache.nul.ie
extra-trusted-public-keys = nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4=
- name: Set up vars
id: setup
run: |
nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \
login --set-default colony https://nix-cache.nul.ie "${{ secrets.NIX_CACHE_TOKEN }}"
echo "short_rev=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Build installer ISO
run: |
nix build .#nixfiles.config.nixos.systems.installer.configuration.config.my.buildAs.iso
@@ -39,12 +39,13 @@ jobs:
run: |
nix build .#nixfiles.config.nixos.systems.installer.configuration.config.my.buildAs.netbootArchive
ln -s "$(readlink result)" \
jackos-installer-netboot-${{ steps.setup.outputs.short_rev }}.tar
jackos-installer-netboot-${{ steps.setup.outputs.short_rev }}.tar.zst
- name: Create release
uses: https://gitea.com/actions/release-action@main
uses: https://gitea.com/actions/gitea-release-action@main
with:
title: Latest installer
name: Latest installer
token: '${{ secrets.RELEASE_TOKEN }}'
files: |
jackos-installer-${{ steps.setup.outputs.short_rev }}.iso
jackos-installer-netboot-${{ steps.setup.outputs.short_rev }}.tar
jackos-installer-netboot-${{ steps.setup.outputs.short_rev }}.tar.zst
+47
View File
@@ -0,0 +1,47 @@
name: Build llm-agents
on:
pull_request:
branches: [master]
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
build:
# Only the update branch, whether dispatched by the updater or pushed by hand
if: >-
(github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/automation/llm-agents') ||
(github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.head.ref == 'automation/llm-agents')
runs-on: ubuntu-26.04
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: DeterminateSystems/determinate-nix-action@v3
with:
github-token: ${{ secrets.GH_PULL_TOKEN }}
extra-conf: |
sandbox-fallback = false
lazy-trees = true
eval-cores = 0
- name: Build installed agent packages
shell: bash
run: |
attrs="$(nix eval --accept-flake-config --no-update-lock-file --raw \
.#llmAgentPackages.x86_64-linux \
--apply 'packages: builtins.concatStringsSep "\n" (builtins.attrNames packages)')"
if [[ -n "$attrs" ]]; then
mapfile -t packages <<< "$attrs"
nix build --accept-flake-config --no-update-lock-file --no-link \
"${packages[@]/#/.#llmAgentPackages.x86_64-linux.}"
fi
+51
View File
@@ -0,0 +1,51 @@
name: Update docs
on:
push:
branches: [master]
jobs:
update:
if: "!contains(github.event.head_commit.message, 'docs: Update generated references')"
runs-on: ubuntu-26.04
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GH_PULL_TOKEN }}
extra_nix_config: |
extra-substituters = https://nix-cache.nul.ie
extra-trusted-public-keys = nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4=
- name: Update assignment tables
run: nix run .#update-docs-assignments
- name: Update option reference
run: nix run .#update-docs-options
- name: Update DNS reference
run: >
nix run .#update-docs-dns --
ams1.int.nul.ie
100.10.in-addr.arpa
2.d.4.0.0.c.7.9.e.0.a.2.ip6.arpa
h.nul.ie
168.192.in-addr.arpa
0.d.4.0.0.c.7.9.e.0.a.2.ip6.arpa
- name: Commit and push if changed
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
REPO_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
git remote set-url origin "${REPO_URL/https:\/\//https:\/\/oauth2:${GITEA_TOKEN}@}"
git add docs/
if ! git diff --cached --quiet; then
git commit -m "docs: Update generated references"
git push
fi
+36
View File
@@ -0,0 +1,36 @@
name: Update llm-agents
on:
schedule:
- cron: '19 */4 * * *'
workflow_dispatch:
concurrency:
group: update-llm-agents
jobs:
update:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-26.04
permissions:
contents: write
pull-requests: write
actions: write
steps:
- uses: actions/checkout@v6
with:
ref: master
persist-credentials: false
- uses: DeterminateSystems/determinate-nix-action@v3
with:
github-token: ${{ secrets.GH_PULL_TOKEN }}
- name: Update the dependency PR
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: >-
nix shell --accept-flake-config .#nixpkgs.unstable.x86_64-linux.python3
--command python3 ci/update-llm-agents.py
+3
View File
@@ -1,6 +1,9 @@
.direnv
/.cache
result*
/.vms/*
!/.vms/.gitkeep
/.keys/*.key
*.swp
__pycache__/
/.claude/settings.local.json
+1
View File
@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKXRXkYnBf2opIjN+bXE7HmhUpa4hyXJUGmBT+MRccT4 harmonia
+1
View File
@@ -0,0 +1 @@
age1f7vpehgfe3043y76kvmqnhs9h98gga3wangqv6hjfaqxjnac855sl23j6p
+339
View File
@@ -0,0 +1,339 @@
# AGENTS.md
This file provides guidance to coding agents when working with code in this repository.
`CLAUDE.md` at the repo root is a symlink to this file — edit `AGENTS.md`, not the symlink (some
tools refuse to write through a symlink and will error on `CLAUDE.md`).
**Prefer this file over agent memory.** When you learn something durable about this repo — a
convention, a workflow gotcha, a design rationale — record it here (or in a repo doc this file
points to, e.g. `docs/sites/home/switches.md`), not in agent memory. AGENTS.md is versioned and
shared; memory is not.
Keep this file lean: it should contain only rules, workflows, safety constraints and sharp gotchas
an agent needs before starting work. Detailed inventories, topology, service operation and design
rationale belong in the canonical document under `docs/`; summarize only the essential constraint
here and link to that document instead of maintaining a second copy.
Claude Code permissions live in two files: `.claude/settings.json` (versioned, shared — the
committed allow list of safe-to-auto-approve commands) and `.claude/settings.local.json` (personal,
gitignored — where interactive "always allow" grants accumulate). Put durable, generally-safe
commands in the shared file; leave one-off or workstation-specific grants in the local one.
Project skills live under `.agents/skills/`. Claude Code discovers them through the
`.claude/skills` symlink.
## Overview
Personal Nix flake managing NixOS systems and home-manager configurations for a set of
**boxes**, never a "fleet". It is built around a **custom module
system** layered on top of NixOS/home-manager, not the stock flake `nixosConfigurations` pattern.
## Commands
This repo provides a `numtide/devshell` (entered via `direnv` / `use flake`). The shell defines
named commands — prefer them over raw `nix` invocations. Run a bare command name with no args to
see its help, or browse `devshell/commands.nix` / `devshell/install.nix` / `devshell/vm-tasks.nix`.
Common ones:
- `fmt` — format Nix with `nixpkgs-fmt` (the canonical formatter here).
- `build-system <host> [nix args]` — build a NixOS system's `toplevel`.
- `build-n-switch <args>` — wraps `doas nixos-rebuild --accept-flake-config --flake .`.
- `build-home <name>` / `home-switch` — build / switch a home-manager config.
- `run-vm <host>` — build & boot a system as a dev VM (installs `.keys/dev.key` into the VM).
- `build-iso` / `build-kexec` / `build-netboot <host>` — alternate build outputs via `config.my.buildAs.*`.
- `check-system <host> [nix args]` — evaluate a system (catches eval errors without a full build).
**Prefer this over `build-system` to validate a config change** — evaluation surfaces module/option
errors quickly and cheaply; only do a full build when you specifically need the built artifact.
- `deploy <host>` — deploy-rs deployment (uses `.keys/deploy.key`, `--skip-checks`).
Use `deploy --targets .#<host1> .#<host2>` for multiple targets; shared options go directly
on the command, e.g. `deploy --boot --targets .#river .#stream`.
Pass the flake-qualified node, e.g. `deploy .#git`. The deploy node name is **always** the system
name (`deploy-rs.nix` keys nodes directly off `nixos.systems` / `home-manager.homes`); a system is
only a deploy target when `config.my.deploy.enable` is true (defaults true; auto-disabled for dev
VMs and containers). A container is **not** its own deploy node — it is generated as a
`container-<name>` profile on its **host** node. So `deploy .#<host>` deploys the host's `system`
profile and every one of its containers, whereas `deploy .#<host>.container-<name>` targets a
single container (e.g. `deploy .#shill.container-middleman`). Pass `--boot` to stage a config as the boot default **without** live-switching
(`deploy --boot .#<host>`) — the box keeps running its current generation until it reboots. Use this
when a live `switch` would break connectivity mid-change (e.g. a router's WAN VLAN rework), then
reboot to cut over.
- `ssh-machine <name> [cmd]` — connect to a box, home-manager config or NixOS container by name.
Uses SSH settings from the deploy-rs node, so the box or container host needs `my.deploy.enable`.
For containers use the instance name or `<host>.container-<name>` to get a root shell through
the host. Connection settings for all nodes are cached together and invalidated
by checkout changes (the jj working copy, else tracked Git changes); use
`ssh-machine --refresh` to force a refresh (see `docs/deployment.md#ssh-machine`).
Boxes default to the `fish` login shell, so pipe multi-statement remote
scripts through `bash` (e.g. `ssh-machine <name> bash -s < script.sh`) rather than `&&`/`for`.
If outbound SSH hangs at the publickey step (flaky `ssh-agent`), disable the agent for the call:
`SSH_AUTH_SOCK= ssh-machine …` (or add `-o IdentityAgent=none` to a raw `ssh`).
- `ragenix` — edit age secrets using `.keys/dev.key` as identity (see Secrets).
- `repl` — `nix repl .#`.
- `installer-shell` / `do-install <system>` — drive an install against a booted installer at
`$INSTALLER`. For bringing up a new box end to end follow the guided procedure in
[`docs/install-box.md`](docs/install-box.md).
- `update-nixpkgs` / `update-home-manager` — bump pinned inputs. For the full periodic upgrade
(rebasing the `devplayer0` nixpkgs fork, stable-release bumps, kernel and release-metadata
refreshes, version-gate sweep, input review) follow the guided procedure in
[`docs/nixpkgs-upgrade.md`](docs/nixpkgs-upgrade.md).
Use the narrowest relevant evaluation while iterating: `check-system <host>` for a box config,
`nix eval .#nixfiles.config.nixos.allAssignments --json` for assignment generation, or
`nix build --no-link .#nixfiles.config.nixos.optionsDoc` for the option reference. Runtime
dependency replacement can build store reference graphs during evaluation, so use
`nix flake check` for broad validation when replacements are enabled.
CI runs an eval-only flake check before building and caching `.#ci.x86_64-linux`. An active
`ciIfdReasons` entry allows import from derivation and moves the flake check after the builds.
See [CI in `docs/deployment.md`](docs/deployment.md#ci). A separate
workflow (`.gitea/workflows/update-docs.yaml`) regenerates the network assignments, NixOS option
reference and live DNS reference under `docs/`.
For DNS lookups use **`drill`** (ldns) — `dig` isn't installed in this environment (it fails with
exit 127, which is easy to miss if stderr is redirected). E.g. `drill -Q @<resolver> <name> A`.
For privilege escalation use **`doas`**, not `sudo` — the boxes don't install `sudo` (it fails with
`command not found`). E.g. `doas ip link set <if> up`.
For ad-hoc packages prefer **`pkgs#<name>`** over `nixpkgs#<name>` (e.g. `nix run pkgs#python3`):
`pkgs` is a system registry alias for the same pinned nixpkgs the boxes are built from, so it
resolves from the local store instead of fetching a different channel.
## Architecture
The mechanics in this section have expanded human-readable write-ups under `docs/`:
`docs/architecture.md` (module system), `docs/networking.md` (assignments, topology, meshes) and
`docs/deployment.md` (deploy-rs, devshell, secrets, CI). This section stays the terse agent
version; consult those for depth.
### The custom module system
`flake.nix` does **not** call `nixosSystem` per host directly. Instead it `evalModules` over
`./nixos`, `./home-manager`, `./deploy-rs.nix`, and the per-host files listed in the `configs`
list in `flake.nix`. That evaluation produces a top-level config (`self.nixfiles`) from which the
real flake outputs are derived:
- `nixos.systems.<name>` → `nixosConfigurations.<name>`
- `home-manager.homes.<name>` → `homeConfigurations.<name>`
- `nixos.modules` / `home-manager.modules` → `nixosModules` / `homeModules`
- `deploy-rs.rendered` → `deploy`
`nixos/default.nix` and `home-manager/default.nix` define the `systemOpts` / `homeOpts` submodules
and the `mkSystem` / `mkHome` functions that actually invoke `eval-config.nix` /
`homeManagerConfiguration`. **To add a new host:** create a box file that sets
`nixos.systems.<name> = { ... }`, then add its path to the `configs` list in `flake.nix`.
### Multiple nixpkgs channels
Four pkgs sets are threaded everywhere as `pkgsFlakes` / `pkgs'` (and `hmFlakes` for home-manager):
`unstable`, `stable`, `mine` (a personal nixpkgs fork), `mine-stable`. Each system/home picks its
channel via `nixpkgs` / `home-manager` / `hmNixpkgs` options (e.g. `nixpkgs = "mine-stable"`).
Modules receive `pkgs'` = an attrset of all channels for the current system.
For options absent from older channels, omit the attribute with `optionalAttrs` guarded by
the module's `options` argument. `mkIf false` still checks option existence. Add a `TODO`
comment explaining which older release needs the guard and which release upgrade allows
its removal, matching the existing release-gated TODOs.
### `lib.my` and the `my` option namespace
`lib/default.nix` extends `lib` with a `my` attrset (helpers like `mkOpt'`, `mkBoolOpt'`,
`mkDefault'`, `inlineModule'`, `mkDefaultSystemsPkgs`, `homeStateVersion`). It also pulls in:
- `lib.my.net` — network/CIDR helpers from the `libnetRepo` input. Used heavily for IP math.
- `lib.my.c` — shared constants from `lib/constants.nix` (UIDs/GIDs, kernel package selection,
nginx snippets, per-network domains/prefixes, etc.). Reuse these rather than hardcoding.
- `lib.my.dns` — DNS helpers (`lib/dns.nix`).
Custom modules add options under the `my.*` namespace (e.g. `my.secrets`, `my.build`,
`my.tmproot`, `my.server`). Use `mkOpt'`/`mkBoolOpt'` for option declarations to match style.
### Modules and module lists
Module sets are registered in `nixos/modules/_list.nix` and `home-manager/modules/_list.nix`
(name → path), which become `nixos.modules` / `home-manager.modules` and are applied to every
system/home. To add a shared module, drop the file in `nixos/modules/` (or `home-manager/modules/`)
and add an entry to the relevant `_list.nix`.
### Network assignments
Each system declares `assignments.<name>` (in its `nixos.systems.<host>` block) with IPv4/IPv6
addresses, gateways, domains, MTU, etc. These are aggregated into `allAssignments` (passed to every
module) and there is an assertion that fails on duplicate IPs. Host networking
(`networking.hostName`, `domain`) defaults from the `internal` assignment.
### Hosts / "boxes"
Per-host configs live under `nixos/boxes/<host>` (some are single `.nix` files, some directories
with nested VMs/containers under e.g. `colony/vms`). Many "systems" are VMs or containers managed
via the `vms` / `containers` modules and the `l2mesh` VXLAN module.
For a human-readable map of what is actually deployed (per-box roles, services and networking),
see `README.md` and `docs/` (index at `docs/README.md`; box pages under `docs/sites/`,
`docs/remote/`, `docs/mobile/`). Keep these in sync when adding, removing or repurposing a box or
service. The network-assignment tables are consolidated in `docs/networking.md` (one per site,
CI-generated from `allAssignments` between `<!-- assignments: <site> -->` markers); box pages
link to that section. Write the prose and let the updater refresh the tables.
### Home routers (`nixos/boxes/home/routing-common`)
`river` and `stream` share `routing-common`, a function of an `index`; keep common HA behavior there
and box-specific WAN behavior in the respective box file. Client-facing gateway and DNS services
must use the floating VIPs. `routing-common` only declares the inert `wan-online.target`; each box
wires its own reachability mechanism. See `docs/networking.md#router-ha` and the router box pages
for the design and operational detail. Keep pair-wide behavior in `docs/networking.md`; router
pages should document only their WAN, platform and other box-specific responsibilities.
The easy-to-mix-up implementation details are that `lib.my.networkdAssignment` and
`lib.my.mkVLAN` live under `lib.my`, networkd snippet constants such as `networkd.noL3` live under
`lib.my.c`, and interface MTU belongs in the `.network`'s `linkConfig.MTUBytes`.
### Home switches (`jim` / `dave` / `brian`)
These switches are not managed by the flake, and changing them is out-of-band and hard to revert.
Read `docs/sites/home/switches.md` before WAN or VLAN work, always confirm before applying a switch
change, and keep the documented layout and `lib.my.c.home.vlans` in sync.
### Home wireless APs (`vibe` / `wave`)
These APs are not managed by the flake; only their DNS records are. Read and update
`docs/sites/home/aps.md` when changing an AP or its VLAN layout.
## Working from `slop-cannon`
Agents on `slop-cannon` have no deploy or SSH keys, so `deploy` and `ssh-machine` don't work there.
Use `slop` instead; `slop guide` explains it. Run requests that need approval in the background
or give the tool enough time for the [approval window](docs/slop-broker.md#approval-timeout).
If a request expires and the task still depends on it, tell the user what is blocked and pause
for their direction. Continue any independent work you can do under the existing approvals.
- `slop status`, `slop logs` and `slop failed` look at a box without waiting for approval.
- `slop ssh <node> -- <cmd>` runs anything else. Nodes are the deploy-rs nodes on `master`;
`--host <user>@<host>` reaches other boxes.
- `slop deploy <node>…` builds and deploys a pushed commit; `--boot` stages it for the next boot.
- `slop build <attr>…` builds a pushed commit's flake attributes into the binary cache.
- `slop secret keys|read|set|generate|rekey <file>` changes age secrets instead of `ragenix`.
- `slop requests` lists your pending requests and leases.
- Push your work to a branch and open a pull request with `tea pulls create`; only Dev merges into
`master`. Git and `tea` use the bot user's token (see
[`docs/sites/home/slop-cannon.md`](docs/sites/home/slop-cannon.md#gitea)).
## Secrets
age-encrypted secrets in `secrets/`, managed with **ragenix**. Each module declares
`my.secrets.files.<name>` and `my.secrets.key` (the host pubkey to encrypt for). `secrets.nix`
(the ragenix rules file) is generated by reading every system's declared secrets and computing the
recipient key list (always including `.keys/dev.pub` and `.keys/slop-broker.pub`, the broker's
age identity on `palace`). Edit secrets with the `ragenix` devshell command, which supplies
`.keys/dev.key` as the identity. The `.keys/` directory (dev + deploy private keys) is required for
editing secrets, deploying, and running dev VMs.
When a recipient list changes, re-encrypt selectively with `ragenix --rekey-one <file>` for each
affected secret. `ragenix --rekey` rewrites **every** secret in `secrets/`, burying the real change
in churn.
## Conventions
- Prefer `jj` for status, diffs, history, commits, rebases and remote operations when it is
available and the checkout has a Jujutsu workspace. Use Git when `jj` is unavailable or the
checkout is Git-only, and for Git-specific tooling. The shared home config and devshell install
`jujutsu`; see [`docs/deployment.md#version-control`](docs/deployment.md#version-control) for
setup and the workflow. Inspect `jj status`, `jj diff` and `jj log` before editing; `jj`
snapshots working-copy changes automatically, so preserve existing user changes and use
explicit revisions when rewriting history or moving bookmarks.
- Format with `nixpkgs-fmt` (`fmt`). 2-space indent, `inherit (...)` blocks at the top of `let` —
prefer `inherit (lib) mkOption ...;` (and bare use) over qualifying inline as `lib.mkOption`.
**Ask before running `fmt`** — some files aren't canonically formatted, so `fmt` can reindent a
whole file and bury a logical change in whitespace churn. Match the surrounding style by hand and
leave formatting to the user unless they ask.
- Comment where it genuinely aids understanding, but not for trivial/obvious code — match the file's
existing (fairly sparse) comment density. When adding something general, comment its general
purpose, not the specific change or one-off reason it was introduced for.
- Separate logical steps in code with blank lines, in every language and inside function bodies: a
function that gathers its inputs, checks them, acts and reports should read as short paragraphs,
not one block. Keep closely related statements together, and leave a blank line before a comment
that introduces the next step.
- Prefer `lib.my` helpers (`mkOpt'`, `mkBoolOpt'`, `mkDefault'`) and `lib.my.c` constants over
reimplementing.
- New shared functionality → a module in `*/modules/` + entry in `_list.nix`, options under `my.*`.
- New host → box file under `nixos/boxes/` + entry in the `configs` list in `flake.nix`.
- Custom packages live in `pkgs/` and are registered in `pkgs/default.nix`; the overlay is exposed
as `overlays.default`.
- In prose and commit messages, quote code-like identifiers (commands, options, paths, package and
attribute names) in backticks.
- Keep docs and prose plain — avoid vague AI-tell filler. In particular use "layout"/"structure"
rather than "shape", and "General" rather than "cross-cutting topics"; name things directly
instead of reaching for umbrella words.
- For network connectivity, use the concrete term — "interface", "connection", "network
attachment" or the network's name — rather than calling it a "leg".
- Call the systems **"boxes"**, never "machines" or "fleet", except where "machine" is part of a
command, option or upstream technical term such as QEMU's machine type.
- Commit subjects follow `area/scope: Capitalized summary` (e.g. `nixos/home: ...`); keep logically
distinct changes in separate commits. Aim for 50-character subjects and do not exceed 72
characters. Hard-wrap commit body lines at 72 characters; `-m` preserves unwrapped text, so
include literal line breaks or use a commit-message file. Before reporting a commit, inspect
`jj log --no-graph -r <revision> -T description` (or `git show -s --format=%B HEAD` in a Git-only
checkout) and amend its description if any line exceeds 72 characters. A concise body describing
the change and its rationale is welcome when the subject alone does not provide enough context —
keep it to the essentials rather than restating the diff.
`Co-Authored-By` is the only trailer used here; do **not** add a `Claude-Session` link (or any
other session/tooling trailer).
- **"Logically distinct" means unrelated** — two different applications, two boxes that have nothing
to do with each other, a drive-by fix that happens to sit in a file you were editing anyway. One
piece of work stays in one commit even when it touches a config, several docs and a switch: if the
parts only make sense together, splitting them just makes each half unreviewable. Err towards one
commit and split when a reader would ask why two things arrived together.
## Documentation
**Work in progress goes in Gitea issues** on `dev/nixfiles`, not in `docs/` or in files on
branches: plans, status, next steps and handoffs for a piece of work, one issue each, with its
description kept current. When the work is done, move what lasts into `docs/` and close the issue.
Human-readable docs live under `docs/` (index: `docs/README.md`). Box pages are under
`docs/sites/<site>/`, `docs/remote/`, `docs/mobile/`. A box that itself hosts sub-systems
(containers/nested VMs) gets a **directory named for it** with a `README.md` and the child pages
beneath it (e.g. `shill/README.md` + `shill/containers/*.md`, `sfh/README.md`). When a site and its
physical box share a name, the site keeps the `README.md` and the box page stays alongside it (for
example `sites/colony/README.md` and `sites/colony/colony.md`).
**Box page layout** (match the existing pages): H1 + a one-line intro; a short bullet list of
`Source` / `Host` / `nixpkgs`; an optional hardware inventory or VPS resource-allocation section;
`## Role`; `## Network assignments` that **links** to
[`networking.md#box-assignments`](docs/networking.md#box-assignments) (never inline the table); one
`##` section per topic; `## Notable config files` last. Keep non-hardware platform details in their
topical sections rather than moving them with the inventory. A box without static assignments still
gets the section with a short explanation instead of a generated-table link.
**Structure and layout:**
- Use **tables** for lists of structured items (BGP peers, forwarded ports, vhosts, containers,
VMs, VLANs). Make the item **name the link**; don't add a separate `Page`/`Docs` column.
- Break up **long prose**. A bullet or numbered step running past ~3 lines over several facts
becomes a short lead (a bold phrase or one sentence) with nested bullets, a fact each; several
such points on one topic become a `###` subheading. A paragraph listing several facts becomes
bullets or a table. Restructure a long bullet you're adding to rather than lengthening it.
- Prefer durable concepts and named configuration identifiers over copying exact numbers that are
tunable, generated or likely to drift. Exact values are appropriate when they are useful parts of
the inventory or interface: VM resource allocations, hardware-fixed properties, network and
protocol identifiers, exposed service ports, and safety or recovery values. Describe mutable
implementation tunables by purpose and link to their source instead of duplicating the current
value.
- **Per-site index pages** (`docs/sites/*/README.md`, `docs/remote/README.md`, and
`docs/mobile/README.md`) use one table listing **boxes only**; don't repeat that inventory in a
diagram. A box's containers / nested VMs are tabulated on that box's own page. The global
`docs/README.md` is the exception: it may show them in high-level site diagrams, but should not
add a second detailed inventory outside those diagrams.
**De-dup by ownership** — each fact has one home:
- Shared cross-box **fabric** (the AS211024 mesh, Tailscale/headscale topology, the BGP overview,
the WireGuard-tunnel summary) is documented once in `docs/networking.md`; box pages give a
one-line summary and link to it.
- Site-wide network definitions (prefixes, VLANs, router VIPs and router HA) also live in
`docs/networking.md`; site pages summarize and link to the canonical section.
- **Box-specific** detail (a box's own BGP peers, the WireGuard tunnels it terminates, its
services) lives on the box page; `networking.md` carries only a per-box summary that links out.
- Addresses represented by generated `assignments` or `extraAssignments` live only in the
assignment tables; handwritten box and workload inventories link there instead of copying them.
Addresses outside that data model (such as external peers or service endpoints) stay with the
topic that owns them.
**Generated content:** the network-assignment tables in `networking.md`, the option reference
(`docs/reference/nixos-options.md`) and the live DNS tables (`docs/reference/dns.md`) are
CI-generated by the corresponding `update-docs-*` packages; the workflow supplies the DNS zones.
Don't hand-edit content between `<!-- ... -->` markers; write the surrounding prose or source
configuration and let the updater refresh the tables. The option-reference file is generated in
full.
**Keep docs current:** when you add, remove or repurpose a box or service, update its box page, the
relevant site-index `README.md`, and any affected prose in `networking.md` (the assignment/option
tables refresh via CI). This is the same "prefer docs over agent memory" rule from the top of this
file.
Symlink
+1
View File
@@ -0,0 +1 @@
AGENTS.md
+65
View File
@@ -0,0 +1,65 @@
# nixfiles
Personal Nix flake managing every box I run: hosted servers, home
infrastructure, routers, a remote site, VPSes and personal workstations. It is
built around a **custom module system** layered on top of NixOS and
home-manager rather than the stock per-host `nixosConfigurations` pattern.
For the module-system internals, see [`docs/architecture.md`](docs/architecture.md); for day-to-day
commands, deployment and secrets, see [`docs/deployment.md`](docs/deployment.md). This README is the
map of **what is actually deployed**; the per-box details live under [`docs/`](docs) (start at
[`docs/README.md`](docs/README.md)).
> **Note:** This documentation (the README and everything under `docs/`) is a
> work in progress and was **agent-generated** from the repository. It may be
> incomplete or out of date — treat the Nix configuration as the source of truth.
## The boxes at a glance
Boxes are grouped by deployment/location. Each group has its own directory
under `docs/` with a `README.md` overview and one page per box.
| Group | What it is |
| --- | --- |
| [**colony**](docs/sites/colony) | Hosted dedicated server in Amsterdam (`ams1`). A VM host running the public-facing infrastructure: routing, web, git, media, object storage, chat, game servers. |
| [**home**](docs/sites/home) | Home network: a VM host (`palace`), the home routers, storage, Home Assistant, and a workstation — plus the hand-configured switches and wireless APs tying it together. |
| [**remote**](docs/remote) | Edge VPSes (`britway`, `britnet`) and the remote `kelder` site. |
| [**mobile**](docs/mobile) | The `tower` laptop. |
The custom installer image is documented at [`docs/misc/installer.md`](docs/misc/installer.md).
The general topics — the module system, network and deployment — live next to the index:
[`docs/architecture.md`](docs/architecture.md), [`docs/networking.md`](docs/networking.md) and
[`docs/deployment.md`](docs/deployment.md). The generated custom-module option reference is at
[`docs/reference/nixos-options.md`](docs/reference/nixos-options.md).
The high-level site diagrams and box hierarchy live in [`docs/README.md`](docs/README.md).
Networking is largely defined by per-box `assignments` plus the AS211024 L2 VXLAN mesh; see
[`docs/networking.md`](docs/networking.md) for the full picture and
[`docs/architecture.md`](docs/architecture.md) for the implementation mechanics.
## Repo layout
```
README.md <- you are here
nixos/
boxes/ per-box configuration
colony/ colony host + its VMs (vms/) + shill's containers
home/ palace host + its VMs, routing-common, plus stream, castle
britway/ London VPS
kelder/ remote box + its containers
tower/ laptop
britnet.nix Birmingham VPS
installer.nix installer-image configuration
modules/ shared NixOS modules (my.* options); registered in _list.nix
home-manager/ home-manager modules + configs
lib/ lib.my helpers, constants (lib.my.c), net/dns helpers
pkgs/ custom packages (overlays.default)
secrets/ age-encrypted secrets (ragenix)
devshell/ devshell commands (build/deploy/check/ssh helpers)
ci/ CI helpers (binary-cache push, docs generators)
docs/ deployment documentation (index at docs/README.md)
```
A box is wired into the flake by adding its config file to the `configs` list
in `flake.nix`. See [the top-level evaluation](docs/architecture.md#the-top-level-evaluation) for
how `evalModules` turns these into `nixosConfigurations`, `homeConfigurations` and `deploy` nodes.
+158
View File
@@ -0,0 +1,158 @@
#!/usr/bin/env python3
"""Evaluate, build and cache every attribute of `.#ci.<system>`.
Then point the cache's `nixfiles` profile at a link farm of the results.
CI_IFD_REQUIRED=true allows import from derivation and runs the flake check
after the builds, when the evaluation-time reference graphs are available.
Expects `nix-eval-jobs` on PATH.
"""
import json
import os
import re
import subprocess
import sys
from contextlib import contextmanager
from pathlib import Path
from tempfile import TemporaryDirectory
SYSTEM = "x86_64-linux"
PUSH = "ci/push-to-cache.sh"
# Every evaluation worker first pays for a shared evaluation of the flake (a
# few GiB), so keep workers alive for several jobs. workers * memory is the
# evaluation budget; it must leave room on the runner for Gitea and for builds
# started by import from derivation.
EVAL_WORKERS = os.environ.get("CI_EVAL_WORKERS", "4")
EVAL_WORKER_MEMORY = os.environ.get("CI_EVAL_WORKER_MEMORY", "6144")
ANSI_ESCAPE = re.compile(r"\x1b\[[0-9;]*m")
@contextmanager
def group(title: str):
print(f"::group::{title}")
try:
yield
finally:
print("::endgroup::")
def annotate_error(title: str, message: str):
# Workflow commands are single lines, so escape multi-line messages
message = ANSI_ESCAPE.sub("", message)
for char, escape in (("%", "%25"), ("\r", "%0D"), ("\n", "%0A")):
message = message.replace(char, escape)
print(f"::error title={title}::{message}")
def succeeds(*command: str) -> bool:
return subprocess.run(command).returncode == 0
def evaluate(nix_options: list[str], work: Path) -> tuple[bool, list[dict]]:
"""Evaluate every CI job, returning whether all of them evaluated."""
result = subprocess.run(
[
"nix-eval-jobs", *nix_options,
"--workers", EVAL_WORKERS, "--max-memory-size", EVAL_WORKER_MEMORY,
"--gc-roots-dir", str(work / "gc-roots"),
"--flake", f".#ci.{SYSTEM}",
],
stdout=subprocess.PIPE,
text=True,
)
jobs = [json.loads(line) for line in result.stdout.splitlines() if line]
ok = result.returncode == 0
for job in jobs:
if "error" in job:
annotate_error(f"Evaluation of {job['attrPath'][0]} failed", job["error"])
ok = False
return ok, [job for job in jobs if "error" not in job]
def build(jobs: list[dict]) -> tuple[bool, dict[str, str]]:
"""Build the jobs' outputs, returning whether all built and the built ones by job."""
ok = succeeds(
"nix", "build", "--keep-going", "--no-link",
*(f"{job['drvPath']}^out" for job in jobs),
)
built = {}
for job in jobs:
name = job["attrPath"][0]
path = job["outputs"]["out"]
if succeeds("nix-store", "--check-validity", path):
built[name] = path
else:
annotate_error(f"Build of {name} failed", "See the build log above.")
ok = False
return ok, built
def link_farm(outputs: dict[str, str], work: Path) -> str:
"""Build a link farm of the outputs from their paths, without evaluating them again."""
outputs_file = work / "outputs.json"
outputs_file.write_text(json.dumps(outputs))
drv = subprocess.check_output(
[
"nix", "eval", "--impure", "--raw", f".#nixpkgs.unstable.{SYSTEM}",
"--apply",
f"""pkgs: (pkgs.linkFarm "ci" (builtins.mapAttrs (_: builtins.storePath)
(builtins.fromJSON (builtins.readFile {json.dumps(str(outputs_file))})))).drvPath""",
],
text=True,
)
return subprocess.check_output(
["nix", "build", "--no-link", "--print-out-paths", f"{drv}^out"],
text=True,
).strip()
def main():
allow_ifd = os.environ.get("CI_IFD_REQUIRED", "false") == "true"
nix_options = ["--option", "allow-import-from-derivation", str(allow_ifd).lower()]
with group("Collect cache garbage"):
subprocess.run([PUSH, "--gc"], check=True)
with TemporaryDirectory() as work:
work = Path(work)
with group("Evaluate"):
ok, jobs = evaluate(nix_options, work)
built = {}
if jobs:
with group("Build"):
built_all, built = build(jobs)
ok = ok and built_all
# Cache whatever built, even when the run fails
if built:
with group("Cache"):
subprocess.run([PUSH, *built.values()], check=True)
if not ok:
sys.exit(1)
if allow_ifd:
with group("Check flake"):
subprocess.run(["nix", "flake", "check", *nix_options], check=True)
with group("Update cache profile"):
farm = link_farm(built, work)
subprocess.run([PUSH, farm], env=os.environ | {"UPDATE_PROFILE": "1"}, check=True)
if __name__ == "__main__":
# Keep this script's output in order with its commands'
sys.stdout.reconfigure(line_buffering=True)
main()
+1
View File
@@ -0,0 +1 @@
object-ctr.ams1.int.nul.ie ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFdHbZErWLmTPO/aEWB1Fup/aGMf31Un5Wk66FJwTz/8
+29
View File
@@ -0,0 +1,29 @@
{ lib, inputs, nixfiles, system }:
let
inherit (builtins) any attrValues filter tryEval;
inherit (lib) concatMap filterAttrs getName groupBy isDerivation;
inherit (nixfiles.config) nixos home-manager;
systems = filter (box: box.system == system) (attrValues nixos.systems);
homes = filter (home: home.system == system) (attrValues home-manager.homes);
installedPackages =
concatMap
(box:
let cfg = box.rendered.config;
in cfg.environment.systemPackages
++ concatMap (home: home.home.packages) (attrValues cfg.home-manager.users))
systems
++ concatMap (home: home.configuration.config.home.packages) homes;
installedByName = groupBy getName installedPackages;
in
filterAttrs
(_: package:
# Check names before forcing output paths. Some unrelated upstream exports
# are helpers or packages that cannot be evaluated on this platform.
let name = tryEval (if isDerivation package then getName package else null);
in name.success && name.value != null
&& any (installed: installed.drvPath == package.drvPath)
(installedByName.${name.value} or [ ]))
(inputs.llm-agents.packages.${system} or { })
+45
View File
@@ -0,0 +1,45 @@
#!/bin/sh
set -e
REMOTE_STORE=/var/lib/harmonia
SSH_HOST="harmonia@object-ctr.ams1.int.nul.ie"
SSH_KEY=/tmp/harmonia.key
STORE_URI="ssh-ng://$SSH_HOST?ssh-key=$SSH_KEY&remote-store=$REMOTE_STORE"
remote_cmd() {
ssh -i "$SSH_KEY" "$SSH_HOST" env HOME=/run/harmonia NIX_REMOTE="$REMOTE_STORE" "$@"
}
collect_garbage() {
echo "Collecting garbage..."
remote_cmd nix-env \
-p "$REMOTE_STORE"/nix/var/nix/profiles/nixfiles \
--delete-generations 60d
remote_cmd nix-collect-garbage
}
umask_old=$(umask)
umask 0066
echo "$HARMONIA_SSH_KEY" | base64 -d > "$SSH_KEY"
umask $umask_old
mkdir -p ~/.ssh
cp ci/known_hosts ~/.ssh/
if [ "${1-}" = "--gc" ]; then
collect_garbage
exit
fi
if [ -n "${UPDATE_PROFILE-}" ] && [ $# -ne 1 ]; then
echo "UPDATE_PROFILE needs exactly one path" >&2
exit 1
fi
echo "Pushing $# path(s) to cache..."
nix copy --no-check-sigs --to "$STORE_URI" "$@"
if [ -n "${UPDATE_PROFILE-}" ]; then
echo "Updating profile..."
remote_cmd nix-env -p "$REMOTE_STORE"/nix/var/nix/profiles/nixfiles --set "$1"
fi
+194
View File
@@ -0,0 +1,194 @@
#!/usr/bin/env python3
"""Update the consolidated network-assignment tables in docs/networking.md.
Reads nixos.allAssignments from the flake and renders assignment-key subgroups for each site
(colony / home / remote / other) between per-site `<!-- assignments: <site> -->` markers. The
hand-written Notes column is preserved, keyed by (box, assignment).
"""
import json
import re
import subprocess
import sys
from pathlib import Path
DOCS = Path("docs")
TARGET = DOCS / "networking.md"
HEADER = "| Box | IPv4 | IPv6 | Domain | Notes |"
SEP = "|---|---|---|---|---|"
# Table order; also the set of valid `<!-- assignments: <site> -->` tokens.
SITE_ORDER = ["colony", "home", "remote", "other"]
# Per-site internal domains of the remote boxes (britway=lon1, britnet=bhx1, kelder=hentai).
REMOTE_DOMAINS = ("lon1.int.nul.ie", "bhx1.int.nul.ie", "hentai.engineer")
def site_of(assignments: dict) -> str:
"""Classify a box into a site table by its assignment domain.
Prefer the `internal` assignment's domain, else the first assignment that has one.
"""
dom = (assignments.get("internal") or {}).get("domain")
if not dom:
for a in assignments.values():
if a.get("domain"):
dom = a["domain"]
break
if not dom:
return "other"
if dom.endswith("ams1.int.nul.ie"):
return "colony"
if dom == "h.nul.ie" or dom.endswith(".h.nul.ie"):
return "home"
if any(dom.endswith(s) for s in REMOTE_DOMAINS):
return "remote"
return "other"
def fmt_ip(ip: dict) -> str:
addr = ip.get("address")
if addr is None:
return "—"
parts = [f"{addr}/{ip.get('mask')}"]
if ip.get("gateway") is not None:
parts.append(f"gw {ip['gateway']}")
return f"`{' '.join(parts)}`"
def find_page(box: str) -> str | None:
"""Doc page for a box (relative to docs/), if one exists."""
for pattern in (f"{box}.md", f"{box}/README.md"):
for p in sorted(DOCS.rglob(pattern)):
return p.relative_to(DOCS).as_posix()
return None
def box_cell(box: str) -> str:
page = find_page(box)
return f"[`{box}`]({page})" if page else f"`{box}`"
def box_name_from_cell(cell: str) -> str:
m = re.match(r"\[`?([^`\]]+)`?\]", cell)
return m.group(1) if m else cell.strip("`")
def parse_notes(lines: list[str]) -> dict[tuple[str, str], str]:
"""Existing Notes indexed by (box, assignment), from either table layout."""
notes: dict[tuple[str, str], str] = {}
assignment = None
for line in lines:
stripped = line.strip()
heading = re.match(r"^####\s+`([^`]+)`$", stripped)
if heading:
assignment = heading.group(1)
continue
if not stripped.startswith("|"):
continue
cells = [c.strip() for c in stripped.split("|")]
# "| a | b | ... |" splits to ['', 'a', 'b', ..., '']
if len(cells) >= 7 and assignment is not None:
# Current layout: one table under each assignment heading.
box, row_assignment, note = cells[1], assignment, cells[5]
elif len(cells) >= 8:
# Previous layout: one site table with an Assignment column.
box, row_assignment, note = cells[1], cells[2], cells[6]
else:
continue
# Skip header and separator rows.
if box == "Box" or set(box) <= {"-"}:
continue
notes[(box_name_from_cell(box), row_assignment)] = note
return notes
def render_site(boxes: list[str], all_assignments: dict, notes: dict) -> list[str]:
groups: dict[str, list[tuple[str, dict]]] = {}
for box in sorted(boxes):
for key, a in all_assignments[box].items():
groups.setdefault(key, []).append((box, a))
lines: list[str] = []
group_order = sorted(groups, key=lambda key: (key != "internal", key))
for key in group_order:
if lines:
lines.append("")
lines.extend([f"#### `{key}`", "", HEADER, SEP])
for box, a in groups[key]:
lines.append(
"| "
+ " | ".join(
[
box_cell(box),
fmt_ip(a.get("ipv4", {})),
fmt_ip(a.get("ipv6", {})),
a.get("domain") or "—",
notes.get((box, key), ""),
]
)
+ " |"
)
return lines
def update_target(all_assignments: dict) -> bool:
by_site: dict[str, list[str]] = {s: [] for s in SITE_ORDER}
for box, assignments in all_assignments.items():
if not assignments:
continue
by_site[site_of(assignments)].append(box)
text = TARGET.read_text()
lines = text.splitlines()
marker_re = re.compile(r"^<!--\s*assignments:\s*(\S+)\s*-->$")
# Walk the file line by line; at each `<!-- assignments: <site> -->` marker, replace
# everything up to the matching `<!-- assignments-end -->` with a freshly rendered table
# (carrying the hand-written Notes over), leaving all other lines untouched.
out: list[str] = []
i = 0
while i < len(lines):
m = marker_re.match(lines[i].strip())
if not m:
out.append(lines[i])
i += 1
continue
site = m.group(1)
end = i + 1
while end < len(lines) and lines[end].strip() != "<!-- assignments-end -->":
end += 1
if end >= len(lines):
out.append(lines[i])
i += 1
continue
notes = parse_notes(lines[i + 1 : end])
out.append(lines[i])
out.append("<!-- assignments-start -->")
out.extend(render_site(by_site.get(site, []), all_assignments, notes))
out.append("<!-- assignments-end -->")
i = end + 1
new_text = "\n".join(out) + "\n"
if new_text != text:
TARGET.write_text(new_text)
return True
return False
def main() -> int:
result = subprocess.run(
["nix", "eval", ".#nixfiles.config.nixos.allAssignments", "--json"],
capture_output=True,
text=True,
check=True,
)
all_assignments = json.loads(result.stdout)
if update_target(all_assignments):
print(f"updated {TARGET}")
return 0
if __name__ == "__main__":
sys.exit(main())
+362
View File
@@ -0,0 +1,362 @@
#!/usr/bin/env python3
"""Render docs/reference/dns.md from live authoritative DNS zone transfers.
The authoritative servers are queried directly over AXFR. Records owned by Kea are
identified by DHCID records and omitted together with their forward and reverse data.
"""
import argparse
import ipaddress
import re
import socket
import sys
from dataclasses import dataclass
from pathlib import Path
import dns.exception
import dns.name
import dns.query
import dns.resolver
import dns.rdatatype
OUT = Path("docs/reference/dns.md")
DEFAULT_PORT = 53
IGNORED_TYPES = {"DHCID", "SOA"}
POWERDNS_ALIAS = 65401
POWERDNS_LUA = 65402
@dataclass(frozen=True)
class Record:
zone: str
owner: str
type: str
value: str
def normalize_name(name: str) -> str:
return name.rstrip(".").lower()
def record_data(rdtype: int, rdata) -> tuple[str, str]:
if rdtype == POWERDNS_ALIAS:
target, _used = dns.name.from_wire(rdata.data, 0)
return "ALIAS", target.to_text()
if rdtype == POWERDNS_LUA:
logical_type = int.from_bytes(rdata.data[:2], byteorder="big")
return "LUA", dns.rdatatype.to_text(logical_type)
return dns.rdatatype.to_text(rdtype), rdata.to_text()
def server_addresses(server: str, port: int) -> list[str]:
addresses = []
try:
for result in socket.getaddrinfo(server, port, type=socket.SOCK_STREAM):
address = result[4][0]
if address not in addresses:
addresses.append(address)
except socket.gaierror as error:
raise RuntimeError(f"cannot resolve nameserver {server}: {error}") from error
return addresses
def transfer(server: str, port: int, zone: str) -> list[Record]:
addresses = server_addresses(server, port)
errors = []
for address in addresses:
try:
records = []
for message in dns.query.xfr(
address, zone, port=port, lifetime=60, relativize=False
):
for rrset in message.answer:
for rdata in rrset:
record_type, value = record_data(rrset.rdtype, rdata)
records.append(
Record(
zone=normalize_name(zone),
owner=normalize_name(rrset.name.to_text()),
type=record_type,
value=value,
)
)
if not any(record.type == "SOA" for record in records):
raise RuntimeError("transfer returned no SOA record")
return records
except (dns.exception.DNSException, OSError, RuntimeError) as error:
errors.append(f"{address}: {error}")
raise RuntimeError(f"AXFR of {zone} from {server} failed ({'; '.join(errors)})")
def system_nameservers(domain: str) -> list[str]:
try:
answer = dns.resolver.resolve(domain, "NS", lifetime=30)
except dns.exception.DNSException as error:
message = f"cannot discover authoritative servers for {domain}: {error}"
raise RuntimeError(message) from error
return [rdata.target.to_text() for rdata in answer]
def nameservers_via(server: str, port: int, domain: str) -> list[str]:
errors = []
for address in server_addresses(server, port):
resolver = dns.resolver.Resolver(configure=False)
resolver.nameservers = [address]
resolver.port = port
try:
answer = resolver.resolve(domain, "NS", lifetime=15, search=False)
return [rdata.target.to_text() for rdata in answer]
except dns.exception.DNSException as error:
errors.append(f"{address}: {error}")
raise RuntimeError(f"NS query for {domain} via {server} failed ({'; '.join(errors)})")
def discover_nameservers(domains: list[str], port: int) -> dict[str, list[str]]:
discovered = {}
unresolved = {}
candidates = []
for domain in domains:
try:
servers = system_nameservers(domain)
discovered[domain] = servers
for server in servers:
if server not in candidates:
candidates.append(server)
except RuntimeError as error:
unresolved[domain] = [str(error)]
for domain, errors in list(unresolved.items()):
for server in candidates:
try:
discovered[domain] = nameservers_via(server, port, domain)
del unresolved[domain]
break
except RuntimeError as error:
errors.append(str(error))
if unresolved:
details = "; ".join(
f"{domain}: {'; '.join(errors)}" for domain, errors in unresolved.items()
)
raise RuntimeError(details)
return discovered
def transfer_domain(
port: int, domain: str, servers: list[str], fallback: list[str] = ()
) -> list[Record]:
# A zone may be delegated publicly to servers that refuse AXFR (e.g. HE serving
# reverse DNS) while our own authoritative servers, discovered for other zones,
# will transfer it. Try the delegated servers first, then fall back to those.
ordered = list(servers)
for server in fallback:
if server not in ordered:
ordered.append(server)
errors = []
for server in ordered:
try:
return transfer(server, port, domain)
except RuntimeError as error:
errors.append(str(error))
raise RuntimeError(f"no authoritative server allowed AXFR for {domain} ({'; '.join(errors)})")
def dynamic_names(records: list[Record]) -> set[str]:
return {record.owner for record in records if record.type == "DHCID"}
def dynamic_addresses(records: list[Record], names: set[str]) -> set[str]:
return {
record.value.rstrip(".").lower()
for record in records
if record.owner in names and record.type in {"A", "AAAA"}
}
def reverse_address(owner: str) -> str | None:
if owner.endswith(".in-addr.arpa"):
labels = owner.removesuffix(".in-addr.arpa").split(".")
if len(labels) != 4:
return None
try:
return str(ipaddress.IPv4Address(".".join(reversed(labels))))
except ValueError:
return None
if owner.endswith(".ip6.arpa"):
labels = owner.removesuffix(".ip6.arpa").split(".")
if len(labels) != 32:
return None
try:
value = int("".join(reversed(labels)), 16)
return str(ipaddress.IPv6Address(value))
except ValueError:
return None
return None
def static_records(records: list[Record]) -> list[Record]:
names = dynamic_names(records)
addresses = dynamic_addresses(records, names)
static = []
for record in records:
if record.type in IGNORED_TYPES or record.owner in names:
continue
if record.type == "PTR":
target = normalize_name(record.value.split()[0])
address = reverse_address(record.owner)
if target in names or address in addresses:
continue
static.append(record)
return static
def relative_name(owner: str, zone: str) -> str:
if owner == zone:
return "@"
suffix = f".{zone}"
return owner[: -len(suffix)] if owner.endswith(suffix) else owner
def markdown_code(value: str) -> str:
escaped = value.replace("|", "\\|")
return f"`{escaped}`"
def display_record(record: Record) -> tuple[str, str]:
if record.type != "LUA":
return record.type, record.value
return f"{record.value} (LUA)", "generated at query time"
def render_forward(domain: str, records: list[Record]) -> list[str]:
domain = normalize_name(domain)
rows = []
for record in records:
if record.zone != domain or record.type == "PTR":
continue
record_type, value = display_record(record)
rows.append((relative_name(record.owner, record.zone), record_type, value))
rows.sort(key=lambda row: (row[0] != "@", row[0], row[1], row[2]))
lines = ["| Name | Type | Value |", "|---|---|---|"]
lines.extend(
f"| {markdown_code(name)} | {markdown_code(record_type)} | {markdown_code(value)} |"
for name, record_type, value in rows
)
return lines
def render_reverse(domain: str, records: list[Record]) -> list[str]:
domain = normalize_name(domain)
rows = []
for record in records:
if record.zone != domain or record.type != "PTR":
continue
rows.append((reverse_address(record.owner) or record.owner, record.value))
rows.sort(key=lambda row: ipaddress.ip_address(row[0]))
lines = ["| Address | Name |", "|---|---|"]
lines.extend(
f"| {markdown_code(address)} | {markdown_code(name)} |" for address, name in rows
)
return lines
def is_reverse(domain: str) -> bool:
domain = normalize_name(domain)
return domain.endswith(".in-addr.arpa") or domain.endswith(".ip6.arpa")
def rendered_zones(transferred: list[tuple[str, list[Record]]]) -> dict[str, list[str]]:
records = static_records([record for _domain, zone in transferred for record in zone])
rendered = {}
for domain, _raw_records in transferred:
if is_reverse(domain):
rendered[normalize_name(domain)] = render_reverse(domain, records)
else:
rendered[normalize_name(domain)] = render_forward(domain, records)
return rendered
def update_target(transferred: list[tuple[str, list[Record]]], target: Path) -> bool:
rendered = rendered_zones(transferred)
text = target.read_text()
lines = text.splitlines()
marker_re = re.compile(r"^<!--\s*dns:\s*(\S+)\s*-->$")
found = set()
output = []
i = 0
while i < len(lines):
match = marker_re.match(lines[i].strip())
if not match or normalize_name(match.group(1)) not in rendered:
output.append(lines[i])
i += 1
continue
domain = normalize_name(match.group(1))
end = i + 1
while end < len(lines) and lines[end].strip() != "<!-- dns-end -->":
end += 1
if end >= len(lines):
raise RuntimeError(f"missing <!-- dns-end --> for {domain}")
output.extend(
[
lines[i],
"<!-- dns-start -->",
*rendered[domain],
"<!-- dns-end -->",
]
)
found.add(domain)
i = end + 1
missing = rendered.keys() - found
if missing:
raise RuntimeError(f"missing DNS markers for: {', '.join(sorted(missing))}")
new = "\n".join(output) + "\n"
if new == text:
return False
target.write_text(new)
return True
def main() -> int:
parser = argparse.ArgumentParser(prog="update-docs-dns", description=__doc__)
parser.add_argument("domain", nargs="+", help="DNS zone to transfer")
parser.add_argument("--port", type=int, default=DEFAULT_PORT)
parser.add_argument("--output", type=Path, default=OUT)
args = parser.parse_args()
try:
nameservers = discover_nameservers(args.domain, args.port)
fallback = []
for servers in nameservers.values():
for server in servers:
if server not in fallback:
fallback.append(server)
transferred = [
(domain, transfer_domain(args.port, domain, nameservers[domain], fallback))
for domain in args.domain
]
except RuntimeError as error:
print(f"update-docs-dns: {error}", file=sys.stderr)
return 1
try:
changed = update_target(transferred, args.output)
except (OSError, RuntimeError) as error:
print(f"update-docs-dns: {error}", file=sys.stderr)
return 1
if changed:
print(f"updated {args.output}")
return 0
if __name__ == "__main__":
sys.exit(main())
+108
View File
@@ -0,0 +1,108 @@
#!/usr/bin/env python3
"""Render docs/reference/nixos-options.md from the `my.*` module options.
Builds the `optionsDoc` flake output (a `nixosOptionsDoc` JSON dump of the custom
`my.*` options) and renders it to a per-module table. The prose lives in the option
descriptions in `nixos/modules/`; this file is generated.
"""
import json
import re
import subprocess
import sys
from pathlib import Path
OPTIONS_DOC_ATTR = ".#nixfiles.config.nixos.optionsDoc"
OUT = Path("docs/reference/nixos-options.md")
HEADER = "| Option | Type | Default | Description |"
SEP = "|---|---|---|---|"
def collapse(text: str) -> str:
# Strip the flake's own /nix/store/<hash>-source/ prefix from rendered values so
# defaults like `./.keys/deploy.pub` are stable (the hash changes every time this
# generated file — part of the source tree — is rewritten).
text = re.sub(r"/nix/store/[a-z0-9]{32}-source/", "", text)
text = re.sub(
r'<link\s+xlink:href="([^"]+)">([\s\S]+?)</link>',
r"[\2](\1)",
text,
)
return re.sub(r"\s+", " ", text).strip().replace("|", "\\|")
def render_default(entry: dict) -> str:
if "default" not in entry:
return "—"
d = entry["default"]
# A dict default is a `defaultText` / `literalExpression` (pre-rendered Nix in `text`);
# anything else is a literal value we JSON-encode.
if isinstance(d, dict):
text = d.get("text")
if text is None:
text = json.dumps(d.get("value"))
else:
text = json.dumps(d)
text = collapse(text)
return f"`{text}`" if text else "—"
def build_options_json() -> dict:
# `optionsDoc` builds to a derivation containing share/doc/nixos/options.json; the last
# printed out-path is the derivation root.
out = subprocess.run(
["nix", "build", "--no-link", "--print-out-paths", OPTIONS_DOC_ATTR],
capture_output=True,
text=True,
check=True,
).stdout.strip().splitlines()[-1]
return json.loads((Path(out) / "share/doc/nixos/options.json").read_text())
def main() -> int:
opts = build_options_json()
by_module: dict[str, list[tuple[str, dict]]] = {}
for key, entry in opts.items():
decls = entry.get("declarations") or []
# Only document options declared in this repo's modules. Some `my.*` options
# (e.g. `my.buildAs`, which aliases `options.system.build`) pull in sub-options
# declared in nixpkgs; their declaration paths don't exist here — skip them.
if not decls or not Path(decls[0]).exists():
continue
by_module.setdefault(decls[0], []).append((key, entry))
lines = [
"# NixOS module options (`my.*`)",
"",
"> **Generated** from the module option descriptions by `nix run .#update-docs-options`;",
"> CI keeps it current. The source of truth is the `mkOpt'` / `mkBoolOpt'` declarations in",
"> `nixos/modules/` — edit those, not this file. For what each module is *for*, see the",
"> [shared-modules overview](../architecture.md#shared-modules).",
"",
]
for decl in sorted(by_module):
mod = Path(decl).stem
if decl != "(unknown)":
lines.append(f"## `{mod}` — [`{decl}`](../../{decl})")
else:
lines.append(f"## `{mod}`")
lines += ["", HEADER, SEP]
for key, entry in sorted(by_module[decl], key=lambda kv: kv[0]):
lines.append(
f"| `{key}` | {collapse(entry.get('type', ''))} | "
f"{render_default(entry)} | {collapse(entry.get('description', ''))} |"
)
lines.append("")
OUT.parent.mkdir(parents=True, exist_ok=True)
new = "\n".join(lines).rstrip() + "\n"
old = OUT.read_text() if OUT.exists() else ""
if new != old:
OUT.write_text(new)
print(f"updated {OUT}")
return 0
if __name__ == "__main__":
sys.exit(main())
+239
View File
@@ -0,0 +1,239 @@
#!/usr/bin/env python3
"""Keep the llm-agents update PR and its package build current."""
import base64
import json
import os
import subprocess
from itertools import count
from pathlib import Path
from tempfile import TemporaryDirectory
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import Request, urlopen
BASE = "master"
BRANCH = "automation/llm-agents"
REF = f"refs/heads/{BRANCH}"
TITLE = "flake: Update llm-agents"
LOCK = Path("flake.lock")
BUILD_WORKFLOW = "actions/workflows/llm-agents.yaml"
def git_output(*args: str) -> bytes:
return subprocess.check_output(["git", *args])
def versions(lock_file: Path | None = None) -> dict[str, str]:
command = [
"nix", "eval", "--accept-flake-config", "--no-update-lock-file", "--json",
".#llmAgentPackages.x86_64-linux",
"--apply", "builtins.mapAttrs (_: package: package.version)",
]
if lock_file is not None:
command.extend(["--reference-lock-file", str(lock_file)])
return json.loads(subprocess.check_output(command))
def api(path: str, *, method: str | None = None, query=None, data=None):
server = os.environ["GITHUB_SERVER_URL"].rstrip("/")
repo = os.environ["GITHUB_REPOSITORY"]
url = f"{server}/api/v1/repos/{repo}/{path}"
if query is not None:
url += "?" + urlencode(query)
headers = {"Authorization": f"token {os.environ['GITEA_TOKEN']}"}
payload = None
if data is not None:
headers["Content-Type"] = "application/json"
payload = json.dumps(data).encode()
request = Request(url, data=payload, headers=headers, method=method)
try:
with urlopen(request, timeout=30) as response:
body = response.read()
except HTTPError as error:
message = error.read(4096).decode(errors="replace")
raise RuntimeError(
f"{request.get_method()} {path} returned HTTP {error.code}: {message}"
) from None
return json.loads(body) if body else None
def find_pull_request(state: str, sort: str | None = None):
"""Return the first update PR in the listing, or None."""
repo = os.environ["GITHUB_REPOSITORY"]
query = {"state": state, "base_branch": BASE, "limit": 50}
if sort is not None:
query["sort"] = sort
for page in count(1):
pulls = api("pulls", query=query | {"page": page})
if not pulls:
return None
for pull in pulls:
head = pull["head"]
if head["ref"] == BRANCH and (head["repo"] or {}).get("full_name") == repo:
return pull
def version_changes(before: dict[str, str], after: dict[str, str]) -> list[tuple[str, str, str]]:
return [
(name, before.get(name, "absent"), after.get(name, "absent"))
for name in sorted(before.keys() | after.keys())
if before.get(name) != after.get(name)
]
def locked_source(lock: bytes) -> dict[str, str]:
nodes = json.loads(lock)["nodes"]
return nodes[nodes["root"]["inputs"]["llm-agents"]]["locked"]
def pull_request_body(
before: dict[str, str], after: dict[str, str], base_lock: bytes, proposed_lock: bytes,
) -> str:
rows = "\n".join(
f"| `{name}` | {old} | {new} |" for name, old, new in version_changes(before, after)
)
old, new = locked_source(base_lock), locked_source(proposed_lock)
source = f"`{old['rev'][:12]}` → `{new['rev'][:12]}`"
if new.get("type") == "github":
compare = f"https://github.com/{new['owner']}/{new['repo']}/compare/{old['rev']}...{new['rev']}"
source = f"[{source}]({compare})"
return (
f"Updates the `llm-agents` pin ({source}). Installed package versions:\n"
"\n"
f"| Package | `{BASE}` | Proposed |\n"
"| --- | --- | --- |\n"
f"{rows}\n"
"\n"
"Close this PR to skip these versions; a later release opens a new one."
)
def create_pull_request(body: str):
return api("pulls", data={"base": BASE, "head": BRANCH, "title": TITLE, "body": body})
def close_obsolete(pull) -> None:
if pull is None:
return
api(f"issues/{pull['number']}/comments", data={
"body": f"`{BASE}` already has the latest installed llm-agents versions.",
})
api(f"pulls/{pull['number']}", method="PATCH", data={"state": "closed"})
print(f"Closed the obsolete update PR {pull['html_url']}.")
def declined(after: dict[str, str], reference: Path) -> bool:
"""Check whether the most recently closed update PR rejected these versions."""
pull = find_pull_request("closed", sort="recentclose")
if pull is None or pull["merged"]:
return False
# Gitea keeps the PR's head at close time even if the branch moves on.
subprocess.run([
"git", "fetch", "--no-tags", "--depth=1", "origin", f"refs/pull/{pull['number']}/head",
], check=True)
reference.write_bytes(git_output("show", f"FETCH_HEAD:{LOCK}"))
if versions(reference) != after:
return False
print(f"Skipping the versions declined in {pull['html_url']}.")
return True
def publish(previous: str, before: dict[str, str], after: dict[str, str]) -> str:
changes = "\n".join(
f"{name} {old} -> {new}" for name, old, new in version_changes(before, after)
)
subprocess.run(["git", "add", "--", str(LOCK)], check=True)
subprocess.run([
"git", "-c", "user.name=github-actions[bot]",
"-c", "user.email=github-actions[bot]@users.noreply.github.com",
"commit", "-m", TITLE, "-m", changes,
], check=True)
# Pass the credential to Git without putting it in the remote URL.
auth = base64.b64encode(f"oauth2:{os.environ['GITEA_TOKEN']}".encode()).decode()
subprocess.run([
"git", "push", f"--force-with-lease={REF}:{previous}", "origin", f"HEAD:{REF}",
], check=True, env=os.environ | {
"GIT_CONFIG_COUNT": "1",
"GIT_CONFIG_KEY_0": "http.extraHeader",
"GIT_CONFIG_VALUE_0": f"Authorization: Basic {auth}",
})
return git_output("rev-parse", "HEAD").decode().strip()
def main() -> None:
# Capture the tip before evaluating so the lease protects concurrent updates.
previous = git_output("ls-remote", "origin", REF).decode().partition("\t")[0]
if previous:
subprocess.run(["git", "fetch", "--no-tags", "--depth=2", "origin", REF], check=True)
base_lock = git_output("show", f"HEAD:{LOCK}")
subprocess.run(["nix", "flake", "update", "--accept-flake-config", "llm-agents"], check=True)
candidate_lock = LOCK.read_bytes()
pull = find_pull_request("open")
if candidate_lock == base_lock:
print("The llm-agents pin is current.")
close_obsolete(pull)
return
with TemporaryDirectory() as temp:
reference = Path(temp) / LOCK.name
reference.write_bytes(base_lock)
before = versions(reference)
after = versions()
if before == after:
print("Installed llm-agents package versions are unchanged.")
close_obsolete(pull)
return
if pull is None and declined(after, reference):
return
pending = None
pending_lock = None
if previous and git_output("show", f"{previous}^:{LOCK}") == base_lock:
pending_lock = git_output("show", f"{previous}:{LOCK}")
reference.write_bytes(pending_lock)
pending = after if pending_lock == candidate_lock else versions(reference)
if pending == after:
head, proposed_lock = previous, pending_lock
else:
head, proposed_lock = publish(previous, before, after), candidate_lock
# Keep the description in step with the branch, including after master moves.
body = pull_request_body(before, after, base_lock, proposed_lock)
if pull is None:
pull = create_pull_request(body)
elif pull["body"] != body:
api(f"pulls/{pull['number']}", method="PATCH", data={"body": body})
print(f"Update PR {pull['html_url']}")
# Gitea suppresses events from the Actions token. Dispatch explicitly and
# recover on the next poll if there is still no build for this commit.
runs = api(f"{BUILD_WORKFLOW}/runs", query={"head_sha": head, "limit": 1})
if runs["total_count"] == 0:
api(f"{BUILD_WORKFLOW}/dispatches", data={"ref": BRANCH})
print(f"Queued the llm-agents build for {head[:12]}.")
if __name__ == "__main__":
main()
+19
View File
@@ -27,6 +27,11 @@ in
internal = true;
description = "Rendered deploy-rs configuration.";
};
sshConnections = mkOption {
type = attrsOf unspecified;
internal = true;
description = "SSH connection settings and container names for ssh-machine.";
};
};
config = {
@@ -53,6 +58,20 @@ in
# Filter out null values so deploy merges overriding options correctly
rendered = lib.my.deploy-rs.filterOpts cfg.deploy;
sshConnections = mapAttrs (name: node:
let
system = systems.${name}.configuration.config or null;
hostnames = if system == null then [ ] else system.my.deploy.sshHostnames;
instances = if system == null then { } else system.my.containers.instances;
in
{
inherit (node) sshUser;
sshOpts = cfg.rendered.sshOpts ++ node.sshOpts;
hostnames = if hostnames == [ ] then [ node.hostname ] else hostnames;
containers = attrNames instances;
sudo = node.sudo or (cfg.rendered.sudo or "sudo -u");
}) cfg.rendered.nodes;
};
};
}
+62 -19
View File
@@ -2,6 +2,11 @@
let
homeFlake = "$HOME/.config/home-manager/flake.nix";
devKey = ".keys/dev.key";
sshMachine = pkgs.writeShellApplication {
name = "ssh-machine";
runtimeInputs = with pkgs; [ git jujutsu netcat-openbsd openssh ];
text = ''exec ${pkgs.python3.interpreter} ${./ssh-machine.py} "$@"'';
};
in
{
commands = [
@@ -20,7 +25,7 @@ in
[ -e "${homeFlake}" ] && echo "${homeFlake} already exists" && exit 1
mkdir -p "$(dirname "${homeFlake}")"
ln -s "$(pwd)/flake.nix" "${homeFlake}"
ln -sf "$(pwd)/flake.nix" "${homeFlake}"
echo "Installed link to $(pwd)/flake.nix at ${homeFlake}"
'';
}
@@ -30,6 +35,27 @@ in
help = "Remove home-manager flake.nix link";
command = "rm -f ${homeFlake}";
}
{
name = "slop";
category = "utilities";
help = "Ask slop-broker for privileged operations (`slop guide`); uses `.keys/slop-request.key` if present";
# Built from this checkout, so it matches the branch. Without a key it uses `SLOP_BROKER`,
# `~/.config/slop/config.toml` or vsock, as the installed client does.
command = ''
key="$PRJ_ROOT/.keys/slop-request.key"
if [ -z "''${SLOP_BROKER-}" ] && [ -f "$key" ]; then
export SLOP_BROKER=ssh:slop@palace.h.nul.ie
export SLOP_SSH="ssh -i $key -o IdentitiesOnly=yes -o IdentityAgent=none"
fi
exec ${pkgs.slop-broker}/bin/slop "$@"
'';
}
{
name = "slop-approve";
category = "utilities";
help = "Answer slop-broker requests; its key stays outside the checkout, where agents can't read it";
command = ''exec ${pkgs.slop-broker}/bin/slop-approve "$@"'';
}
{
name = "ragenix";
category = "utilities";
@@ -48,11 +74,28 @@ in
help = "Print the ed25519 pubkey for a host";
command = "${pkgs.openssh}/bin/ssh-keyscan -t ed25519 \"$1\" 2> /dev/null | awk '{ print $2 \" \" $3 }'";
}
{
name = "ssh-machine";
category = "utilities";
help = "Connect to a box, home-manager config or NixOS container by name";
command = ''exec ${sshMachine}/bin/ssh-machine "$@"'';
}
{
name = "docs";
category = "utilities";
help = "Preview Markdown docs in the browser (default: `docs/README.md`)";
command = ''
if [ $# -eq 0 ] || [[ "$1" == -* ]]; then
set -- "$PRJ_ROOT/docs/README.md" "$@"
fi
exec ${pkgs.go-grip}/bin/go-grip "$@"
'';
}
{
name = "json2nix";
category = "utilities";
help = "Convert JSON to formatted Nix";
command = "nix eval --impure --expr 'builtins.fromJSON (builtins.readFile /dev/stdin)' | ${pkgs.nixfmt}/bin/nixfmt";
command = "nix eval --impure --expr 'builtins.fromJSON (builtins.readFile /dev/stdin)' | ${pkgs.nixfmt}/bin/nixfmt -";
}
{
@@ -73,11 +116,23 @@ in
help = "Build NixOS configuration";
command = ''nix build "''${@:2}" ".#nixosConfigurations.\"$1\".config.system.build.toplevel"'';
}
{
name = "check-system";
category = "utilities";
help = "Evaluate NixOS configuration (check validity without building)";
command = ''nix eval "''${@:2}" ".#nixosConfigurations.\"$1\".config.system.build.toplevel.drvPath"'';
}
{
name = "build-n-switch";
category = "tasks";
help = "Shortcut to nixos-rebuild for this flake";
command = ''doas nixos-rebuild --flake . "$@"'';
command = ''
# HACK: Upstream changes in Git + Nix makes this necessary
# https://github.com/NixOS/nix/issues/10202
doas git config --global --add safe.directory "$PWD"
# doas drops the devshell's NIX_USER_CONF_FILES, including accept-flake-config.
doas nixos-rebuild --accept-flake-config --flake . "$@"
'';
}
{
name = "run-vm";
@@ -106,8 +161,8 @@ in
{
name = "build-netboot";
category = "tasks";
help = "Build NixOS configuration as netboot archive";
command = ''nix build "''${@:2}" ".#nixfiles.config.nixos.systems.\"$1\".configuration.config.my.buildAs.netbootArchive"'';
help = "Build NixOS configuration as netboot tree";
command = ''nix build "''${@:2}" ".#nixfiles.config.nixos.systems.\"$1\".configuration.config.my.buildAs.netbootTree"'';
}
{
name = "build-home";
@@ -115,29 +170,17 @@ in
help = "Build home-manager configuration";
command = ''nix build "''${@:2}" ".#homeConfigurations.\"$1\".activationPackage"'';
}
{
name = "update-inputs";
category = "tasks";
help = "Update flake inputs";
command = ''
args=()
for f in "$@"; do
args+=(--update-input "$f")
done
nix flake lock "''${args[@]}"
'';
}
{
name = "update-nixpkgs";
category = "tasks";
help = "Update nixpkgs flake inputs";
command = ''update-inputs nixpkgs-{unstable,stable,mine,mine-stable}'';
command = ''nix flake update nixpkgs-{unstable,stable,mine,mine-stable}'';
}
{
name = "update-home-manager";
category = "tasks";
help = "Update home-manager flake inputs";
command = ''update-inputs home-manager-{unstable,stable}'';
command = ''nix flake update home-manager-{unstable,stable}'';
}
{
name = "update-installer";
+8 -3
View File
@@ -11,7 +11,10 @@ in
NIX_USER_CONF_FILES = toString (pkgs.writeText "nix.conf"
''
experimental-features = nix-command flakes ca-derivations repl-flake
experimental-features = nix-command flakes ca-derivations
lazy-trees = true
eval-cores = 0
accept-flake-config = true
connect-timeout = 5
fallback = true
${lib.my.c.nix.cache.conf}
@@ -22,12 +25,14 @@ in
packages = with pkgs; [
coreutils
nixVersions.stable
determinate-nix
rage
wireguard-tools
(pkgs.writeShellScriptBin "deploy" ''
exec ${deploy-rs.deploy-rs}/bin/deploy --skip-checks "$@"
'')
home-manager
attic-client
jujutsu
go-grip
];
}
+1 -1
View File
@@ -29,7 +29,7 @@ let
coreutils
gnugrep
openssh
nixVersions.stable
determinate-nix
jq
];
text =
+171
View File
@@ -0,0 +1,171 @@
import hashlib
import json
import os
import shlex
import subprocess
import sys
import tempfile
from pathlib import Path
CACHE = Path(".cache/ssh-machine/connections.json")
CACHE_VERSION = 2
def fingerprint():
# The jj working-copy commit covers the snapshotted tree, even in secondary workspaces.
if subprocess.run(["jj", "root"], capture_output=True).returncode == 0:
return subprocess.check_output(
["jj", "log", "--no-pager", "--color", "never", "--no-graph", "-r", "@", "-T", "commit_id"],
text=True,
).strip()
diff = ["git", "diff", "--no-ext-diff", "--no-textconv", "--binary"]
digest = hashlib.sha256()
for command in (["git", "rev-parse", "HEAD"], [*diff, "HEAD", "--"], [*diff, "--cached", "--"]):
digest.update(subprocess.check_output(command))
return digest.hexdigest()
def load_connections(refresh):
key = fingerprint()
if not refresh:
try:
cached = json.loads(CACHE.read_text(encoding="utf-8"))
except (OSError, ValueError):
cached = {}
if (
isinstance(cached, dict)
and cached.get("fingerprint") == key
and cached.get("version") == CACHE_VERSION
and isinstance(cached.get("nodes"), dict)
):
return cached["nodes"]
print("Refreshing ssh-machine connection cache…", file=sys.stderr)
nodes = json.loads(subprocess.check_output(
["nix", "eval", "--json", ".#nixfiles.config.deploy-rs.sshConnections"]
))
if fingerprint() != key:
sys.exit("Checkout changed during evaluation; retry ssh-machine.")
CACHE.parent.mkdir(parents=True, exist_ok=True)
with tempfile.NamedTemporaryFile(
mode="w", encoding="utf-8", dir=CACHE.parent, prefix=".connections.", delete=False
) as temporary:
try:
json.dump({"fingerprint": key, "version": CACHE_VERSION, "nodes": nodes}, temporary)
temporary.flush()
os.replace(temporary.name, CACHE)
finally:
Path(temporary.name).unlink(missing_ok=True)
return nodes
def resolve_target(nodes, name):
# deploy-rs mangles home configuration names containing @.
node_name = name.replace("@", "-at-")
if node_name in nodes:
return nodes[node_name], None
matches = {}
for host, node in nodes.items():
for container in node["containers"]:
qualified = f"{host}.container-{container}"
if name in (container, qualified):
matches[qualified] = (node, container)
if len(matches) == 1:
return next(iter(matches.values()))
if matches:
sys.exit(f"Ambiguous container name: {', '.join(sorted(matches))}")
sys.exit(f"Unknown deploy node or container: {name}")
def ssh_port(node, hostname):
config = subprocess.run(
["ssh", "-G", *node["sshOpts"], f"{node['sshUser']}@{hostname}"],
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True,
)
if config.returncode == 0:
for line in config.stdout.splitlines():
key, _, value = line.partition(" ")
if key == "port":
return value
return None
def select_hostname(node):
# Check preferred addresses before starting SSH so a remote command only runs once.
*preferred, fallback = node["hostnames"]
for hostname in preferred:
port = ssh_port(node, hostname)
if port is None:
continue
try:
probe = subprocess.run(
["nc", "-z", "--", hostname, port], timeout=2,
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
)
except subprocess.TimeoutExpired:
continue
if probe.returncode == 0:
return hostname
return fallback
def container_command(node, container, command, tty):
args = [
"root", "systemd-run", "--quiet", "--wait", "--collect",
"--expand-environment=no", "--working-directory=~",
"--pty" if tty else "--pipe",
f"--machine={container}", "--", "/run/current-system/sw/bin/bash", "-l",
]
if command:
# SSH joins command arguments with spaces before passing them to the remote shell.
args += ["-c", " ".join(command)]
return f"{node['sudo']} {shlex.join(args)}"
def main(args):
refresh = args[:1] == ["--refresh"]
if refresh:
args = args[1:]
if args[:1] == ["--help"] or (not refresh and not args):
print("Usage: ssh-machine [--refresh] <name> [cmd ...]")
print(" ssh-machine [--refresh] <host>.container-<name> [cmd ...]")
print(" ssh-machine --refresh")
return
# Resolve deploy's relative identity path from the checkout root.
project_root = os.environ.get("PRJ_ROOT")
if not project_root:
sys.exit("ssh-machine: PRJ_ROOT is unset. Enter the devshell first.")
os.chdir(project_root)
nodes = load_connections(refresh)
if not args:
return
name, *command = args
node, container = resolve_target(nodes, name)
hostname = select_hostname(node)
destination = f"{node['sshUser']}@{hostname}"
ssh = ["ssh", *node["sshOpts"]]
if container is not None:
tty = not command and sys.stdin.isatty()
if tty:
ssh.append("-t")
command = [container_command(node, container, command, tty)]
os.execvp("ssh", [*ssh, destination, *command])
if __name__ == "__main__":
try:
main(sys.argv[1:])
except subprocess.CalledProcessError as error:
sys.exit(error.returncode)
except (OSError, ValueError) as error:
sys.exit(f"ssh-machine: {error}")
+105
View File
@@ -0,0 +1,105 @@
# Deployment documentation
> **Note:** these pages are a work in progress and were **agent-generated** from the repository.
> They may be incomplete or out of date — treat the Nix configuration as the source of truth.
This directory documents the boxes managed by this flake: their roles, network assignments,
hierarchy, and the services they run. For the mechanics of the repo itself (conventions, module
system internals for contributors, agent guidance), see [`AGENTS.md`](../AGENTS.md).
The two big sites follow the pattern:
```
physical host (VM host)
└── VM (for things impractical to containerise)
└── container host VM
└── NixOS containers (one per application group)
```
Not every box fits this pattern, but **colony** and **home** are organised this way.
## General
- [`architecture.md`](architecture.md) — the custom module system, `my.*` namespace, multiple
nixpkgs channels, shared module inventory.
- [`networking.md`](networking.md) — network assignments, domains, site topologies, router HA,
the AS211024 L2 mesh, BGP, WireGuard, Tailscale.
- [`deployment.md`](deployment.md) — deploy-rs, devshell commands, `jj` workflow, secrets, CI.
- [`nixpkgs-upgrade.md`](nixpkgs-upgrade.md) — guided procedure for the periodic upgrade of the four
nixpkgs channels and home-manager (fork rebase, stable bumps, input review).
- [`install-box.md`](install-box.md) — guided procedure for installing a new box, from the booted
installer through partitioning, the box config, `do-install` and documentation.
- [`openwrt-flash.md`](openwrt-flash.md) — guided procedure for flashing a flake-built image onto an
OpenWrt box, from the build through pre-flight, `sysupgrade` and verification.
- [`reference/dns.md`](reference/dns.md) — generated forward and reverse DNS record reference.
- [`reference/nixos-options.md`](reference/nixos-options.md) — generated per-option reference for
the custom `my.*` NixOS modules.
## Site: colony (Amsterdam)
Physical host and public-infrastructure hub — see [`sites/colony/README.md`](sites/colony/README.md).
```
colony (physical VM host, ams1)
├── estuary ── edge router: WAN, firewall/NAT, DNS, BGP (AS211024), WireGuard
├── shill ──── NixOS container host ──┬── middleman (reverse proxy, ACME, Pocket ID, librespeed)
│ ├── vaultwarden (password manager)
│ ├── colony-psql (shared PostgreSQL)
│ ├── chatterbox (Matrix Synapse + bridges)
│ ├── jackflix (media stack)
│ ├── object (MinIO, Harmonia Nix cache, HedgeDoc, wastebin)
│ ├── toot (Bluesky PDS; Mastodon disabled)
│ ├── waffletail (Tailscale subnet router / exit node)
│ ├── qclk (WireGuard management appliance)
│ ├── gam (Terraria server)
│ └── jam (raw nspawn customer container)
├── whale2 ─── podman/OCI host for game servers
├── git ────── Gitea + Gitea Actions runner
├── mail ───── Debian VM running mailcow (not NixOS)
└── darts ──── third-party/customer VM (opaque, not NixOS)
portcullis (bare-metal edge box for Nikhef — staged, not yet in service)
└── fergal OpenWrt SFP+ switch, staged and moving with it
```
## Site: home
Redundant routers, VM host, storage, IoT containers and the workstation — see
[`sites/home/README.md`](sites/home/README.md). The hand-configured switch fabric
(`jim`/`dave`/`brian`/`shytzel`) and WAN paths are documented in
[`sites/home/switches.md`](sites/home/switches.md); the 5G modem being evaluated as a replacement
for `stream`'s WAN is in [`sites/home/wwan.md`](sites/home/wwan.md).
```
h.nul.ie
├── palace (physical VM host — AMD, 100G, SR-IOV)
│ ├── river ── primary router VM (PPPoE / Digiweb WAN)
│ ├── cellar ─ NVMe-oF / SPDK storage target VM
│ ├── sfh ──── container host VM ("shill from home")
│ │ ├── hass ── Home Assistant + Frigate + MQTT (container)
│ │ └── unifi ─ UniFi controller (container)
│ └── slop-cannon ─ coding agents via Paseo (VM, on untrusted)
├── stream (physical secondary router — Virgin Media WAN)
└── castle (workstation / gaming desktop — netboot, NVMe-oF root)
```
## Remote boxes
The edge VPSes and remote `kelder` site are indexed in [`remote/README.md`](remote/README.md).
## Mobile boxes
The laptop is indexed in [`mobile/README.md`](mobile/README.md).
## Misc
- [`misc/installer.md`](misc/installer.md) — the custom NixOS installer image.
- [`slop-broker.md`](slop-broker.md) — how these boxes use `slop-broker`, the agents' approval broker.
## A note on the assignment tables
The consolidated [`Box assignments`](networking.md#box-assignments) tables in
[`networking.md`](networking.md) (one per site, between `<!-- assignments: <site> -->` markers)
are **generated from the flake** (`nixos.allAssignments`) by `nix run .#update-docs-assignments` —
CI refreshes them on push. Individual box pages link to that section rather than carrying their
own table. Only the Notes column is hand-written; don't hand-edit the other cells.
+265
View File
@@ -0,0 +1,265 @@
# Architecture
This flake does **not** use the stock pattern of calling `nixosSystem` once per host in
[`flake.nix`](../flake.nix). Instead it runs a single `lib.evalModules` evaluation over its own
module tree, producing one big top-level config (`self.nixfiles`) from which the real flake
outputs (`nixosConfigurations`, `homeConfigurations`, `nixosModules`, `deploy`, …) are derived.
Per-host files declare *options* (`nixos.systems.<name>`); the machinery in
[`nixos/default.nix`](../nixos/default.nix) and
[`home-manager/default.nix`](../home-manager/default.nix) turns those into evaluated NixOS /
home-manager configurations.
## The top-level evaluation
`flake.nix`'s `outputs` builds a `nixfiles` attrset via `evalModules` over:
- An inline module that seeds `_module.args` (`lib`, `pkgsFlakes`, `hmFlakes`, `self`, `inputs`,
`pkgs'`), sets `nixos.secretsPath = ./secrets`, and sets the global deploy-rs SSH option
`deploy-rs.deploy.sshOpts = [ "-i" ".keys/deploy.key" ]`.
- `nixos/modules/misc/assertions.nix` from the unstable nixpkgs (so the top-level evaluation has
the standard `assertions` / `warnings` options).
- [`nixos/`](../nixos/default.nix) — defines `nixos.*` options (`systems`, `modules`,
`allAssignments`, `vpns`, `secretsPath`) and `mkSystem`.
- [`home-manager/`](../home-manager/default.nix) — defines `home-manager.*` options (`homes`,
`modules`) and `mkHome`.
- [`deploy-rs.nix`](../deploy-rs.nix) — defines `deploy-rs.*` and renders the deploy config.
- Every file in the `configs` list — the boxes themselves
([`nixos/boxes/`](../nixos/boxes) plus [`nixos/installer.nix`](../nixos/installer.nix); the
home-manager entries are currently commented out, see [Home-manager](#home-manager)).
The resulting `nixfiles.config` is mapped onto flake outputs:
| Top-level option (`nixfiles.config`) | Flake output |
|---|---|
| `nixos.systems.<name>.rendered` | `nixosConfigurations.<name>` |
| `home-manager.homes.<name>.configuration` | `homeConfigurations.<name>` |
| `nixos.modules` | `nixosModules` |
| `home-manager.modules` | `homeModules` |
| `deploy-rs.rendered` | `deploy` |
`nixfiles` itself is also a flake output, so anything in the top-level config can be addressed
directly — e.g. `build-iso` builds
`.#nixfiles.config.nixos.systems."<host>".configuration.config.my.buildAs.iso`. The flake also
exposes `lib` (the extended unstable nixpkgs lib, including `lib.my`), `inputs`, `nixpkgs`
(the `pkgs'` channel sets), and `overlays.default` (the custom packages from
[`pkgs/`](../pkgs/default.nix)).
Per platform (`eachDefaultSystem`), the flake produces:
- `packages` — everything from `pkgs/`, flattened.
- `checks` — every `homeConfigurations.*.activationPackage` plus deploy-rs's own `deployChecks`.
- `devShells.default` — the `numtide/devshell` from [`devshell/`](../devshell) (see
[deployment.md](deployment.md)).
- `ci.<system>` — one attr per buildable thing (`system-<name>`, `home-<name>` with `@` mangled
to `-at-`, `package-<name>`, plus `shell`), consumed by CI.
## Systems: `systemOpts` and `mkSystem`
Each entry of `nixos.systems` is a submodule defined by `systemOpts` in
[`nixos/default.nix`](../nixos/default.nix):
| Option | Type / default | Meaning |
|---|---|---|
| `system` | enum of `defaultSystems` | Nix platform string, e.g. `"x86_64-linux"`. |
| `nixpkgs` | one of `unstable`/`stable`/`mine`/`mine-stable`, default `"unstable"` | nixpkgs channel for the system. |
| `home-manager` | same enum, defaults to `nixpkgs` | home-manager channel. |
| `hmNixpkgs` | same enum, defaults to `nixpkgs` | nixpkgs channel used for home-manager's own pkgs when it doesn't share the system's. |
| `docCustom` | bool, default `false` | Include nixfiles' custom modules in the generated NixOS manual (slow). |
| `assignments` | attrsOf `assignmentOpts` | The box's network assignments (see [networking.md](networking.md)). |
| `extraAssignments` | attrsOf attrsOf `assignmentOpts` | Extra assignments for things not on the box itself (e.g. the routers' floating VIP entries). |
| `configuration` | custom merged type | The actual NixOS configuration module(s); merging runs `mkSystem`. |
| `rendered` | unspecified, default `configuration` | What ends up in `nixosConfigurations.<name>` — overridden for boxes built as something other than a plain system (e.g. `installer` renders `config.my.asISO`, containers render `config.my.asContainer`). |
`mkSystem` does the real work:
1. It selects the channel's nixpkgs flake (`pkgsFlakes.${config'.nixpkgs}`).
- It imports `nixos/lib/eval-config.nix` **by hand** because the flake force-sets `lib`;
otherwise `eval-config.nix` would import its own unextended copy.
- The supplied library is the channel's `pkgs.lib` extended with `lib.my` and a
`versionOverlay` that stamps `system.nixos` with the flake revision and channel.
2. `specialArgs` gives every module access to `self`, `inputs`, `pkgsFlakes`, the box's own
`pkgsFlake`, `allAssignments` (every box's assignments), and `systems` (all of
`nixos.systems`). Passing these via `specialArgs` (rather than module `imports`) avoids
infinite recursion.
3. The module list is: the home-manager channel's `nixosModules.default`, every module in
`nixos.modules` (the shared modules, see below), an inline module, and the box's own
`configuration` definitions (wrapped with `inlineModule'` so error messages keep file
provenance).
4. The inline module wires the plumbing:
- `_module.args`: `secretsPath`, `vpns` (the flake-level `nixos.vpns`), the box's own
`assignments`, and `pkgs'` — an attrset of **all four nixpkgs channels** for this box's
platform, so a module can grab a package from another channel (e.g. `pkgs'.stable.foo`).
- `system.name` is the attribute name of the box.
- `networking.hostName` / `networking.domain` default from the `internal` assignment (see
[networking.md](networking.md)).
- `nixpkgs.system` is set and the overlays computed at flake level (lib overlay + custom
packages) are passed through, so `pkgs` is imported modularly with config and overlays
applied.
- `home-manager.useGlobalPkgs` defaults to true when the system and home-manager channels
match; a warning is emitted when they deliberately differ.
- `home-manager.sharedModules` includes every module in `home-manager.modules` plus an inline
module. The inline module passes `pkgsPath` / `pkgs'`, disables the release check, and pins
`home.stateVersion` through `homeStateVersion` (`22.11` for stable-flavoured channels,
`23.05` otherwise).
5. Finally `applyAssertions` throws with all failed assertion messages (and shows warnings)
when the merged configuration is forced.
## The four nixpkgs channels
`flake.nix` builds `pkgsFlakes` (nixpkgs) and `hmFlakes` (home-manager):
| Channel | nixpkgs input | home-manager input |
|---|---|---|
| `unstable` | `nixpkgs/nixos-unstable` | `home-manager` (master) |
| `stable` | `nixpkgs/nixos-26.05` | `home-manager/release-26.05` |
| `mine` | `github:devplayer0/nixpkgs/devplayer0` (personal fork) | alias of `unstable` (no fork exists) |
| `mine-stable` | `github:devplayer0/nixpkgs/devplayer0-stable` | alias of `stable` |
Each channel's `lib` is extended with the `libOverlay` (`lib.my` + flake-utils). Two package
sets are built per channel:
- `pkgs'` — with the devshell/ragenix/deploy-rs/home-manager overlays; used for the dev shell
and `packages`, and exposed as the flake's `nixpkgs` output.
- `configPkgs'` — with just the lib + custom-packages overlays and an `allowUnfreePredicate`
(Widevine / Chromium); this is the `pkgs'` threaded into the top-level evaluation, from
which each box's `pkgs` and per-channel `pkgs'` module args (and home-manager's base
`pkgs`) are taken.
A box picks its channel with `nixpkgs = "mine"` (most boxes), `"mine-stable"` (e.g. `colony`),
etc. Inside a module, `pkgs` is the selected channel and `pkgs'` is the attrset of all four
(`pkgs'.<channel>.<attr>`).
## `lib.my` and the `my.*` namespace
[`lib/default.nix`](../lib/default.nix) extends nixpkgs `lib` with a `my` attrset. The
flake-level `lib` (`pkgsFlakes.unstable.lib` so extended) is for platform-independent flake
use only; each box gets its own channel's lib extended the same way. Contents:
- **Option helpers** — `mkOpt'`, `mkBoolOpt'`, `nullOrOpt'`, `mkDefault'` (slightly stronger than
`mkDefault`), `mkVMOverride'`, `inlineModule'` / `inlineModule`
(attach `_file` provenance), `commonOpts` (the shared `system`/`nixpkgs`/`home-manager`
options and the `moduleType` used for exported modules), `applyAssertions`, `duplicates`.
- **`lib.my.net`** — CIDR/IP math (`net.cidr.host`, `net.cidr.subnet`, `net.types.ipv4`, …)
from the `libnetRepo` input (`oddlama/nixos-extra-modules`' `netu.nix`). Used for nearly all
address arithmetic; addresses are almost never written literally.
- **`lib.my.c`** — shared constants from [`lib/constants.nix`](../lib/constants.nix): static
UID/GID assignments, kernel package selection (`kernel.lts`/`kernel.latest`), nginx config
snippets, networkd snippets (`networkd.noL3`), the binary-cache settings (`nix.cache`),
and the per-site domains/prefixes/VIPs described in [networking.md](networking.md).
- **`lib.my.dns`** — zone-generation helpers from [`lib/dns.nix`](../lib/dns.nix): `fwdRecords`
/ `ptrRecords` / `ptr6Records` rendered from `allAssignments`, plus the LUA-record helpers
(`ifaceA`, `lookupIP`) used by the home routers.
- **networkd helpers** — `networkdAssignment` (assignment → `systemd.network` network, see
[networking.md](networking.md)), `mkVLAN`, `dockerNetAssignment`.
### Misc
The remaining helpers are `mkDefaultSystemsPkgs`, `flakePackageOverlay` (wrap another flake's
package as an overlay), `isIPv6` / `parseIPPort` / `netBroadcast`, `nft` chain-name helpers,
`systemdAwaitPostgres`, `vm.*` LVM disk descriptors for the `vms` module, the typed `deploy-rs`
option definitions (`lib.my.deploy-rs`), `netbootKeaClientClasses` (iPXE/EFI DHCP client classes),
and `homeStateVersion`.
Custom NixOS / home-manager modules declare their options under the `my.*` namespace (the root
`options.my` is declared in `nixos/modules/common.nix` / `home-manager/modules/common.nix`) —
e.g. `my.secrets`, `my.build`, `my.tmproot`, `my.firewall`, `my.server`, `my.deploy`,
`my.vms`, `my.containers`.
## Shared modules
Registered in [`nixos/modules/_list.nix`](../nixos/modules/_list.nix) and applied to **every**
system (box files opt in per-feature via `my.*` options). The table below is the overview — what
each module is *for*; for the exhaustive, CI-generated per-option reference (types, defaults,
descriptions) see [`reference/nixos-options.md`](reference/nixos-options.md).
| Module | Provides |
|---|---|
| `common` | Baseline for all boxes: imports the impermanence, ragenix (age), copyparty and harmonia NixOS modules; pins `system.stateVersion`; `doas` instead of `sudo`; immutable users; nix settings (flakes, `ca-derivations`, the `nix-cache.nul.ie` substituter); declares the `my` option root. |
| `user` | `my.user` — the primary user: `users.users` + matching `home-manager.users` entry, wheel/doas, SSH authorized key from `.keys/me.pub`, shell taken from the home config, home persistence under tmproot. |
| `build` | `my.build` — alternate build targets via `extendModules`: `my.buildAs.devVM` (QEMU dev VM), `iso`, `container`, `kexecTree`, `netbootTree`/`netbootArchive`; `my.build.isDevVM` marker; `allHardware` profile toggle. |
| `dynamic-motd` | `my.dynamic-motd` — runs a script via `pam_exec` to generate the MOTD on login/ssh. |
| `tmproot` | `my.tmproot` — tmpfs `/` plus impermanence persistence (`persistence.dir`), with a `tmproot-unsaved` helper that walks the root tmpfs and lists files not covered by persistence. |
| `firewall` | `my.firewall` — nftables firewall: `tcp.allowed`/`udp.allowed` port lists, `trustedInterfaces`, NAT with `forwardPorts`, `extraRules` escape hatch; sane ICMP/ICMPv6/PMTUD rules baked in. |
| `server` | `my.server.enable` — server commonalities: getty autologin, LLMNR off, tightened fstrim timers, GUI and NixOS documentation off. |
| `deploy-rs` | `my.deploy` — per-box deploy-rs node/profile generation and the `deploy` user; see [deployment.md](deployment.md). |
| `secrets` | `my.secrets` — ragenix/agenix wiring: `files` to decrypt from `secrets/`, host `key` to encrypt for, identity paths derived from the OpenSSH host keys (persistence-aware), dev-key identity inside dev VMs. |
| `containers` | `my.containers.instances` — `systemd-nspawn` NixOS containers whose systems come from `nixos.systems` rendered `asContainer`, with bridge/macvlan networking, bind mounts, `hotReload` (reload instead of reboot) and a placeholder "dummy" init before first deploy. |
| `vms` | `my.vms.instances` — QEMU/KVM VMs as systemd units: TAP/bridge networking, LVM-backed disks, VFIO host-device passthrough (with udev tagging), UEFI, SPICE/TTY/QMP unix sockets under `/run/vms/`, clean shutdown via QMP `system_powerdown`. |
| `network` | Baseline networking: networkd only (`useDHCP = false`), IPv6 on, resolved domain/negative-cache settings; dev VMs get DHCP on `eth0` and an SSH port forward. |
| `pdns` | `my.pdns` — PowerDNS: authoritative server driven by BIND-style zone files (with templating and serial management) and recursor extra-settings wiring. |
| `pocket-id` | `my.pocket-id` — Pocket ID with user groups and OIDC clients declared in Nix; `pocket-id-sync` applies them through the API with a static API key. |
| `gui` | `my.gui.enable` (default on) — desktop baseline: graphics, polkit, swaylock PAM entry, Android udev rules, screenshot tmpdir. |
| `l2mesh` | Consumes `nixos.vpns.l2` — builds the VXLAN + IPsec layer-2 meshes between edge routers; see [networking.md](networking.md). |
| `borgthin` | `my.borgthin.jobs` — borg backups of thin-LVM snapshots to local or SSH repos on a systemd timer, with pruning. |
| `nvme` | `my.nvme` — sets the NVMe host NQN/hostid and, optionally, NVMe-oF-over-RDMA boot in the initrd. |
| `spdk` | `my.spdk` — SPDK target configuration (JSON RPC-driven) plus `spdk-rpc`/`spdk-setup`/`spdk-debug` helper tools. |
| `librespeed` | `my.librespeed` — a LibreSpeed speedtest: generated frontend (from the `librespeed-go` package in `pkgs/`) plus backend settings. |
| `netboot` | `my.netboot` — iPXE netboot server (TFTP/HTTP, menu) and the client-side loader that installs boot entries. |
Home-manager modules, registered in
[`home-manager/modules/_list.nix`](../home-manager/modules/_list.nix) and applied to every
home (including the per-user homes attached to systems via `my.user.homeConfig`):
| Module | Provides |
|---|---|
| `common` | Home baseline: `my.shell`, `my.ssh.authKeys`, `my.isStandalone` (home-manager running standalone vs inside NixOS), fish setup and completions generation, common programs. |
| `gui` | `my.gui` — the sway-based desktop: waybar, notifications, lock/saver plumbing (including the "doomsaver"), terminal and fonts. |
| `deploy-rs` | `my.deploy` for standalone homes — generates a `home` profile (home-manager activation) and deploy node; auto-disabled for NixOS-attached homes. |
| `swaync` | `my.swaync` — typed configuration module for Sway Notification Center. |
## Adding a box
1. Create a file (or directory with a `default.nix`) under [`nixos/boxes/`](../nixos/boxes)
that sets `nixos.systems.<name> = { system = "x86_64-linux"; nixpkgs = "mine"; assignments =
{ … }; configuration = { … }: { … }; };`. Nested boxes (VMs, containers) live under their
host's directory (e.g. `nixos/boxes/colony/vms/estuary/`).
2. Add the path to the `configs` list in [`flake.nix`](../flake.nix).
3. Give the box an `internal` assignment (name/domain) if it gets one — `hostName`/`domain`
default from it — and declare `my.secrets.key` if it has secrets.
4. Evaluate it with `check-system <name>` (cheap) before `build-system <name>`.
## Adding a shared module
1. Drop the file in [`nixos/modules/`](../nixos/modules) (or
[`home-manager/modules/`](../home-manager/modules)) with options under `my.*`, declared via
the `lib.my` helpers (`mkOpt'`, `mkBoolOpt'`).
2. Register it in the corresponding `_list.nix` (name → path). It is then applied to every
box and exported as `nixosModules.<name>` / `homeModules.<name>`.
## Home-manager
Home-manager follows the same option-definition and evaluation split as NixOS.
### `homeOpts`
[`home-manager/default.nix`](../home-manager/default.nix) defines each entry with these options:
| Option | Meaning |
|---|---|
| `system` | Target platform. |
| `nixpkgs` | nixpkgs channel used for the home packages. |
| `home-manager` | home-manager channel. |
| `homeDirectory` / `username` | User identity and home path. |
| `configuration` | The home-manager module definitions evaluated by `mkHome`. |
### `mkHome`
1. Calls the selected channel's `lib.homeManagerConfiguration`.
2. Supplies that channel's `pkgs'` with `config` emptied, allowing home-manager to apply package
configuration and overlays through its module system.
3. Passes `inputs`, `pkgsFlakes` and the selected `pkgsFlake` through `extraSpecialArgs`.
4. Loads every module in `home-manager.modules` plus an inline module that sets
`home.homeDirectory` / `home.username` and exposes every channel through the `pkgs'` module
argument.
5. Pins `home.stateVersion` through `homeStateVersion`.
### Standalone homes
Standalone homes live in [`home-manager/configs/`](../home-manager/configs) and are named
`<user>@<host>` (deploy-rs mangles the `@` to `-at-`). `macsimum` is a home-manager-only
config — an `x86_64-darwin` macOS box with no NixOS side.
No standalone homes are currently wired into the flake: `home-manager/configs/macsimum.nix` is
commented out of `configs`, while `home-manager/configs/castle.nix` is not listed. Consequently,
`nixfiles.config.home-manager.homes` evaluates to `{}`. Most user configuration instead accompanies
NixOS boxes through `my.user.homeConfig`.
+403
View File
@@ -0,0 +1,403 @@
# Deployment and workflows
How boxes get deployed, the devshell commands that drive everyday work, secrets, dev VMs, and
CI.
## deploy-rs
### Rendering
The top-level [`deploy-rs.nix`](../deploy-rs.nix) renders the flake's `deploy` output:
- It collects `nixos.systems` and `home-manager.homes` (mangling `@` in home names to
`-at-`, since deploy-rs node names can't contain `@`). An assertion rejects name collisions
between systems and homes.
- A system/home becomes a deploy node only when `configuration.config.my.deploy.enable` is
true. The node config is the *definitions* of the box's `my.deploy.node` option, re-imported
as a module so deploy-rs's submodule merging still applies.
- `autoRollback` and `magicRollback` are off globally; global `sshOpts` are
`[ "-i" ".keys/deploy.key" ]` (set in [`flake.nix`](../flake.nix)).
- The result is passed through `lib.my.deploy-rs.filterOpts`, which strips nulls so unset
options don't override deploy-rs defaults, and exposed as `deploy = deploy-rs.rendered`.
### Per-box nodes
The shared [`nixos/modules/deploy-rs.nix`](../nixos/modules/deploy-rs.nix) module provides
`my.deploy`:
- `my.deploy.enable` defaults to true, but is **automatically forced off for dev VMs and
NixOS containers** (`my.build.isDevVM` / `boot.isContainer` — containers are deployed
through their host instead, see below). The installer also disables it explicitly.
- Node defaults: `hostname` = the box's FQDN, `sshUser = "deploy"`, `user = "root"`,
`sudo = "doas -u"` (or `sudo -u`), `sshOpts` = the box's first OpenSSH port. The module
creates the `deploy` system user (bash shell, wheel, keys from `my.deploy.authorizedKeys`,
which defaults to `.keys/deploy.pub`).
Generated profiles deploy in this order:
1. **`system`** activates `config.system.build.toplevel` with `switch-to-configuration switch`,
applies the `/tmp` cwd and systemd-boot `loader.conf` workarounds, then prunes old generations.
`keepGenerations` controls how much history is retained; zero disables pruning.
2. **`container-<name>`** activates each `my.containers.instances` entry into
`/nix/var/nix/profiles/per-container/<name>/system`. With `hotReload` (the default), it reloads
`systemd-nspawn@<name>` and restarts only a stopped container or one still running the dummy
init; otherwise it restarts the unit. The same generation cleanup applies.
### Usage
- `deploy .#<host>` — the devshell's `deploy` is a wrapper that adds `--skip-checks`. Node
names are the system names (`deploy .#git`).
- `deploy --targets .#<host1> .#<host2>` — deploys several nodes in one invocation.
Pass shared options directly, e.g. `deploy --boot --targets .#river .#stream`.
- `deploy --boot .#<host>` — stages the config as the boot default **without** live-switching
(deploy-rs's `--boot` maps to the custom activation's `boot` phase, which also does the
generation cleanup). Use it when a live `switch` would cut the box off mid-change (e.g. a
router WAN rework), then reboot to cut over.
- `nix flake check` includes deploy-rs's own `deployChecks` for the whole `deploy` attrset.
#### `ssh-machine`
`ssh-machine <name> [cmd]` connects using the deploy-rs node's SSH user and merged global and
node `sshOpts`. Box and home targets use the same `my.deploy.enable` gate and `@` → `-at-`
mangling as `deploy`. If a box sets `my.deploy.sshHostnames`, the command checks the
addresses in order for a reachable SSH port and uses the last address if the earlier checks fail.
For NixOS containers, use `ssh-machine middleman` or `ssh-machine shill.container-middleman`.
The qualified name selects the host when multiple containers share a name or a deploy node has
the same name. The command connects to the host's deploy node and uses `systemd-run` to open a
root Bash shell in the container or run the supplied command there. Stdin and the command's
exit status are available to the caller.
Connection settings and container names are cached together in `.cache/ssh-machine/`.
Normal connections read the cache without running Nix. A fingerprint of the checkout
automatically invalidates it. In a Jujutsu workspace (including secondary workspaces without a
Git checkout) it is the working-copy commit ID, so any snapshotted change counts, including new
files that are not ignored. In a Git-only checkout it is HEAD plus staged/unstaged tracked
changes; untracked files only count after `git add`. Ignored files never affect the fingerprint.
Any such edit, even an unrelated one, causes the next connection to refresh all nodes. Use `ssh-machine --refresh` to force a
refresh, or `ssh-machine --refresh <name> [cmd]` to refresh and connect. Refresh failures stop
the command; the previous cache is never used as a fallback.
Boxes default to `fish`, so pipe multi-statement remote scripts through `bash`, for example
`ssh-machine <name> bash -s < script.sh`. If a flaky agent stalls public-key authentication, use
`SSH_AUTH_SOCK= ssh-machine …`.
## Coding agents
The shared GUI home-manager module installs Codex and Claude Code from the `llm-agents` input,
retaining that input's tested nixpkgs pin. [CI proposes version updates](#llm-agents-updates).
To refresh the pin manually, run `nix flake update llm-agents`, then switch the system or home
configuration to use the updated packages.
The shared cache settings in `lib.my.c.nix.cache` and the flake's `nixConfig` include
the [Numtide binary cache](https://github.com/numtide/llm-agents.nix#binary-cache), so
both agents can be downloaded prebuilt. Keep the input's tested nixpkgs pin to preserve cache hits.
They also include the [nix-community cache](https://nix-community.org/cache/), which builds
unfree packages that `cache.nixos.org` doesn't, such as the MongoDB used by UniFi.
`programs.codex.mutableSettings` merges the declared status-line settings into the writable
`~/.codex/config.toml` during activation. Declared values take precedence on each switch;
other settings, including model selection, providers and project trust, remain imperative.
## Devshell commands
The repo ships a `numtide/devshell` ([`devshell/`](../devshell), entered via `direnv`). Run a
command with no arguments for its help. From
[`devshell/commands.nix`](../devshell/commands.nix):
| Command | What it does |
|---|---|
| `check-system <host> [nix args]` | Evaluates `.#nixosConfigurations."<host>".config.system.build.toplevel.drvPath` — catches module/option errors without building. Prefer this to validate a config change. |
| `build-system <host> [nix args]` | Builds the system's `toplevel` (extra args pass through to `nix build`). |
| `build-n-switch <args>` | `doas nixos-rebuild --accept-flake-config --flake .` (accepts the flake's cache settings and adds the repo as a git `safe.directory` for root first). |
| `build-home <name> [nix args]` | Builds `.#homeConfigurations."<name>".activationPackage`. |
| `home-switch [args]` | `home-manager switch --flake .`. |
| `deploy [args]` | `deploy-rs --skip-checks` (wrapper package in `devshell/default.nix`). |
| `deploy --targets .#<node1> .#<node2>` | Deploys several nodes in one invocation. |
| `ssh-machine <name> [cmd]` | Connect to a box, home-manager config or NixOS container using deploy-rs SSH settings. |
| `run-vm <host>` | Boots a system as a dev VM: installs `.keys/dev.key` into a temp `xchg/`, then `nix run`s `config.my.buildAs.devVM`. |
| `build-iso <host>` | Builds `config.my.buildAs.iso`. |
| `build-kexec <host>` | Builds `config.my.buildAs.kexecTree`. |
| `build-netboot <host>` | Builds `config.my.buildAs.netbootTree`. |
| `ragenix [args]` | `ragenix --identity .keys/dev.key` (see [Secrets](#secrets)). |
| `repl` | `nix repl .#`. |
| `fmt [args]` | `nixpkgs-fmt` (the canonical formatter). |
| `update-nixpkgs` | `nix flake update nixpkgs-{unstable,stable,mine,mine-stable}`. |
| `update-home-manager` | `nix flake update home-manager-{unstable,stable}`. |
| `update-installer` | Force-pushes the `installer` tag to trigger the installer release workflow. |
| `home-link` / `home-unlink` | Symlink (or remove) this `flake.nix` at `~/.config/home-manager/flake.nix` for standalone `home-manager` use. |
| `qemu-genmac` | Prints a random QEMU-suitable MAC (`52:54:00:xx:xx:xx`). |
| `ssh-get-ed25519 <host>` | Prints a host's ed25519 pubkey via `ssh-keyscan`. |
| `json2nix` | Converts JSON on stdin to formatted Nix. |
| `docs [file] [go-grip args]` | Previews Markdown in the browser with `go-grip` (default `docs/README.md`), rendered locally with live reload. |
From [`devshell/install.nix`](../devshell/install.nix) (driven by `$INSTALLER`, the address of
a running custom installer, SSHing as root with `.keys/deploy.key`):
| Command | What it does |
|---|---|
| `installer-shell [cmd]` | Runs a command (default: a shell) inside the installer. |
| `do-install [--no-bootloader] [--no-substitute] <system>` | Builds the system's `toplevel`, `nix copy`s it into the installer's target store, sets the system profile, and activates it with `switch-to-configuration boot` (with `NIXOS_INSTALL_BOOTLOADER=1` unless `--no-bootloader`). |
### VM consoles
The [`my.vms` module](../nixos/modules/vms.nix) provides `doas vm-tty <vm>` on the VM host.
It opens the serial console in `minicom` via `/run/vms/<vm>/tty.sock`.
The [devshell commands](../devshell/vm-tasks.nix) forward the VM's Unix sockets from
`/run/vms/<vm>/` on `<host>` over SSH.
| Command | What it does |
|---|---|
| `vm-tty <host> <vm>` | Serial TTY of a VM in `minicom`. |
| `vm-monitor <host> <vm>` | QEMU monitor socket in `minicom`. |
| `vm-viewer <host> <vm>` | SPICE display in `virt-viewer` (not on Darwin). |
## Version control
The shared [Home Manager module](../home-manager/modules/common.nix) enables `programs.git`
and `programs.jujutsu`, including Git LFS and `diff-so-fancy`, for graphical and non-graphical
homes. Jujutsu uses the identity declared in `programs.git.settings.user`; Home Manager writes
its `jj/config.toml`. The [devshell](../devshell/default.nix) also installs `jujutsu`, which
provides `jj`. Prefer `jj` when it is available and the checkout has a Jujutsu workspace;
use Git for Git-only checkouts and Git-specific tooling such as the installer-tag command
and CI scripts.
To use an existing Git checkout with both tools, run `jj git init --colocate` at its root.
This creates local `.jj` metadata and keeps `.git` for Nix flake source discovery and existing
Git tooling. Switch the home configuration to install the managed identity. When using only
the devshell, configure your identity with `jj config set --user user.name '<name>'` and
`jj config set --user user.email '<email>'` before creating commits.
| Task | Command |
|---|---|
| Inspect the working copy and history | `jj status`, `jj diff`, `jj log` |
| Describe the current change | `jj describe -m 'area/scope: Capitalized summary'` |
| Start the next change | `jj new` |
| Inspect a completed description | `jj log --no-graph -r <revision> -T description` |
| Fetch remote history | `jj git fetch` |
| Name a revision for publishing | `jj bookmark create <name> -r <revision>` |
| Move an existing bookmark | `jj bookmark set <name> -r <revision>` |
| Publish a bookmark | `jj git push --bookmark <name>` |
`@` is the working-copy revision; after `jj new`, the completed change is normally `@-`.
Working-copy edits are snapshotted automatically, without a staging step. Inspect existing
changes before editing, keep unrelated work separate, and check the target revision before
rewriting history or moving a bookmark. Follow the commit-message conventions in
[`AGENTS.md`](../AGENTS.md#conventions).
See the upstream [Jujutsu CLI reference](https://docs.jj-vcs.dev/latest/cli-reference/)
for command options and [Git compatibility](https://docs.jj-vcs.dev/latest/git-compatibility/)
for colocation details.
## Nix implementation
Every context uses **Determinate Nix** as its `nix.package`, for its performance features
(parallel evaluation and lazy trees) — not `determinate-nixd`; the daemon and `nix.conf` model
are unchanged, and the Determinate NixOS module is deliberately not imported.
- **Input and package.** The [`determinate-nix`](../flake.nix) input is the `nix-src` flake
(`flakehub.com/f/DeterminateSystems/nix-src`), with `nixpkgs.follows = "nixpkgs-unstable"`. We
build it ourselves against our pinned nixpkgs — FlakeHub's own cache needs authentication, so
there is nothing to gain from leaving it unpinned — and it then flows through the Harmonia cache
like everything else. `determinateOverlay` exposes it under the stable attr `determinate-nix`,
added to both the devshell `pkgs'` and the config `configPkgs'` overlay lists, so systems, homes
and the devshell all resolve the same package (`pkgs'.mine.determinate-nix`).
- **Settings.** `lib.my.c.nix.determinateSettings` (`lazy-trees`, `eval-cores = 0`) is merged into
`nix.settings` for systems and homes and into the devshell's `nix.conf`. These keys are only
understood by the Determinate binary.
- **Consumers follow automatically.** Everything that shells out to Nix references
`config.nix.package` (deploy-rs, containers, `build`, netboot, Harmonia), so they inherit
Determinate without further change.
- **`accept-flake-config`.** Set true only in the devshell `nix.conf`, `.envrc` (as
`--accept-flake-config`, for direnv) and CI — the contexts that build this flake — so its
`nixConfig` (the Harmonia and Numtide caches) is trusted without an interactive prompt. It is
deliberately not set system-wide: boxes already trust those caches via `nix.settings`, so a global setting would only
blanket-trust every flake's `nixConfig` for no gain.
## Secrets
Secrets are age-encrypted files in [`secrets/`](../secrets), managed with **ragenix** (a fork
with a rekey flag, from the flake inputs).
### Per-box declarations
Each box declares `my.secrets.key`, the host public key its secrets encrypt to, and
`my.secrets.files.<name>`, whose values merge settings such as `owner` and `mode` into the agenix
secret. At runtime, identity paths come from the box's OpenSSH host keys. On tmproot boxes they are
read from the persistence directory because agenix runs before the persisted keys would otherwise
be available.
### Recipient rules
[`secrets.nix`](../secrets.nix) is generated from every system's `my.secrets.files` and `key`.
Each recipient list also includes `.keys/dev.pub`, so the development key can open every secret,
and `.keys/slop-broker.pub`, so [`slop-broker`](slop-broker.md#secrets) can change secrets for
agents.
Run `ragenix -r` after adding a box or secret to re-key the files.
### Local keys and editing
The `ragenix` devshell command wraps `ragenix --identity .keys/dev.key`. The `.keys/` directory
contains that development key, the deploy key authorized for every box's `deploy` user, and other
keys referenced by `lib.my.c.sshKeyFiles`; it is required for editing secrets, deploying and running
development VMs.
## Dev VMs
Any system can be built as a throwaway QEMU VM via `config.my.buildAs.devVM` (the `build`
module extends the config with `qemu-vm.nix` and sets `my.build.isDevVM`). `run-vm <host>`
creates a temp dir, installs `.keys/dev.key` as `xchg/dev.key`, and runs the VM; inside, the
`secrets` module switches `age.identityPaths` to that dev key (`my.secrets.vmKeyPath`,
default `/tmp/xchg/dev.key`), so dev VMs can decrypt the boxes' secrets without the real host
keys. Dev VMs also get DHCP on `eth0`, an SSH port forward (host 2222 → guest 22), and are
automatically excluded from deploy targets.
## OpenWrt images
The OpenWrt boxes are not NixOS and are not deployed by this flake, but their firmware is built
here. [`openwrt/default.nix`](../openwrt/default.nix) declares one image per box and packages it
through [`astro/nix-openwrt-imagebuilder`](https://github.com/astro/nix-openwrt-imagebuilder),
which drives OpenWrt's official ImageBuilder — prebuilt target packages assembled into a sysupgrade
image, with no cross-toolchain involved.
| Output | Box | Release |
|---|---|---|
| `openwrt-fergal` | [fergal](sites/colony/fergal.md) | `snapshot` |
| `openwrt-fergal-release` | The same, on the release branch | pinned in `openwrt/default.nix` |
Both are in `ci`, so images are built and pushed to the Harmonia cache like everything else. Build
one with `nix build .#openwrt-fergal`; the result holds the `-squashfs-sysupgrade.bin` to flash,
plus a package manifest and an SBOM. Getting it onto the box is a guided procedure of its own —
see [`openwrt-flash.md`](openwrt-flash.md).
Packages are baked into the image rather than installed on the box. OpenWrt's package server keeps
only the current build of each feed, so a box that installs packages at runtime stops being able to
do so as soon as the feed moves on from the firmware it is running. Adding a package means editing
the image's `packages` list and reflashing.
### The feed pin
OpenWrt's download server is never at rest: snapshot is rebuilt daily, and
`releases/<version>/packages/` is a symlink to the rolling `packages-<major>` feed shared by every
point release. Building straight against it fails on hash mismatches and, worse, resolves the
package list by import-from-derivation — which would drag *evaluation* of this flake onto the
network and let an OpenWrt feed rebuild break `check-system` for unrelated boxes.
The `openwrt-feeds` input exists to stop that. It holds expanded per-package metadata and vendors
the repository indexes themselves, so every `.apk` is a plain pinned `fetchurl`, image builds read
the indexes from the flake rather than OpenWrt's mutable URLs, and no import-from-derivation is
involved. Its generated files run to hundreds of thousands of lines and are rewritten wholesale on
each refresh, which is why they live in their own repository rather than here. Regenerate and push
that repository with `nix run .#update`, then refresh this flake's pin with
`nix flake update openwrt-feeds`; adding a release or target means adding it to that repository's
`pins` first.
## CI
GitHub/Gitea Actions workflows live in [`.gitea/workflows/`](../.gitea/workflows).
### `ci.yaml`
On pushes to `master`, this installs Determinate Nix on the runner (via
`DeterminateSystems/determinate-nix-action`, configured with the same performance settings and
Harmonia substituter as the boxes). A newer push cancels a run still in progress. CI normally
runs `nix flake check --no-build` first and keeps import from derivation disabled. It then runs
[`ci/build-and-cache.py`](../ci/build-and-cache.py), which builds every attribute of
`.#ci.x86_64-linux`: systems as `system-<name>`, homes as `home-<name>` (with `@` changed to
`-at-`), packages as `package-<name>`, and the development `shell`.
The script works in stages:
- **Collect garbage.** It deletes cache-profile generations older than their retention period,
then collects unreachable paths so a full cache cannot prevent collection from being reached.
Paths pushed by `slop build` survive collection through their own GC roots (see
[`slop-broker.md`](slop-broker.md#binary-cache)).
- **Evaluate.** [`nix-eval-jobs`](https://github.com/nix-community/nix-eval-jobs) evaluates the
attributes in a pool of workers. Each worker reuses one evaluation of the flake for several
jobs, and the worker count and per-worker memory bound (`CI_EVAL_WORKERS`,
`CI_EVAL_WORKER_MEMORY`) cap the evaluation's memory on the runner.
- **Build.** One `nix build --keep-going` builds every evaluated derivation, so a failing job
doesn't stop the others.
- **Cache.** Every output that built is pushed to the Harmonia cache with
[`ci/push-to-cache.sh`](../ci/push-to-cache.sh). Any evaluation or build failure fails the run
at this point.
- **Update the profile.** A `linkFarm` of all the outputs, built from their known store paths
rather than a second evaluation, is pushed with `UPDATE_PROFILE=1`. That updates the
`nixfiles` profile on the cache box.
When `.#ciIfdReasons.x86_64-linux` lists an active exception, CI logs a warning with the reason
and allows import from derivation for the evaluation. The evaluation workers then wait on those
builds in parallel. CI runs a build-capable flake check after caching and before updating the
profile. CI checks [the shared runtime replacement list](../lib/runtime-dependency-replacements.nix)
against the nixpkgs channels used by its systems and standalone homes. A matching entry
requires reading generated store reference graphs during evaluation.
The SSH store uses `/var/lib/harmonia`, `HARMONIA_SSH_KEY`, and pinned `ci/known_hosts`; clients
use `https://nix-cache.nul.ie` through `lib.my.c.nix.cache`.
### `installer.yaml`
Pushing the `installer` tag (refreshed by `update-installer`) builds `my.buildAs.iso` and
`my.buildAs.netbootArchive`, then attaches both to a release.
### llm-agents updates
[`update-llm-agents.yaml`](../.gitea/workflows/update-llm-agents.yaml) checks for updates every
four hours and can also be run manually on `master`. It matches packages directly installed
by the x86_64 Linux NixOS and home-manager configurations to derivations exported by
`llm-agents`. This discovers the tracked packages without building a whole system.
When an installed version changes, CI commits the updated lockfile on the dedicated
`automation/llm-agents` branch. The PR description tabulates the version changes and links
the upstream comparison, and the commit message lists them too. New versions refresh the branch
behind the existing open PR, and the updater rewrites the description to match. Upstream revisions with the same package
versions leave that branch alone.
- **Declining:** close the PR without merging. CI won't propose the same versions again, and
opens a new PR once a later version appears.
- **Obsolete PRs:** if `master` already has the latest installed versions, for example after a
manual update, CI comments on the open PR and closes it.
[`llm-agents.yaml`](../.gitea/workflows/llm-agents.yaml) builds the discovered packages for
the update commit using the flake's caches. The updater dispatches the build explicitly
because Gitea suppresses automatic workflow events from its job token. The updater needs
the repository's Actions token limits to allow writes to code, pull requests and Actions.
### `update-docs.yaml`
On pushes to `master`, excluding its own commits, this runs the assignment, option and DNS
reference generators and commits changed outputs as `docs: Update generated references`.
### The docs generators
The generators are registered in [`pkgs/default.nix`](../pkgs/default.nix) as wrappers around
Python scripts under [`ci/`](../ci). They leave the worktree unchanged when their output is current;
the workflow stages `docs/` and uses `git diff --cached --quiet` to decide whether to commit.
`update-docs-assignments` ([`ci/update-docs-assignments.py`](../ci/update-docs-assignments.py))
evaluates `.#nixfiles.config.nixos.allAssignments` to JSON and rewrites the consolidated
[`Box assignments`](networking.md#box-assignments) tables in `docs/networking.md` — one table
per site (`colony` / `home` / `remote`), each between a `<!-- assignments: <site> -->` marker
and a closing `<!-- assignments-end -->` line. Boxes are grouped by site from their assignment
domain, and each `Box` cell links to that box's page when one exists. Hand-written text in the
**Notes** column is preserved across runs (keyed by box + assignment), so notes survive
regeneration. Individual box pages don't carry tables; they link to the consolidated section.
`update-docs-options` ([`ci/update-docs-options.py`](../ci/update-docs-options.py)) builds the
`nixos.optionsDoc` output (declared in [`nixos/default.nix`](../nixos/default.nix)) — a
`nixosOptionsDoc` JSON dump of the custom `my.*` options (declared with `mkOpt'` / `mkBoolOpt'` in
`nixos/modules/`). It's evaluated against a **minimal synthetic system**, since the shared modules
apply to every box, so defaults don't pick up a real host's values. The renderer writes
[`docs/reference/nixos-options.md`](reference/nixos-options.md), one table per module file. The
whole file is generated; edit the option descriptions in the modules, not the reference. The
internal `asX` build-target options are marked `internal = true` so they're excluded.
`update-docs-dns` ([`ci/update-docs-dns.py`](../ci/update-docs-dns.py)) accepts forward and reverse
zone names, discovers their authoritative nameservers through NS queries, and transfers each zone
over AXFR. If a private reverse zone is not visible through the configured recursive resolver, it
asks the authoritative servers discovered for the other requested zones. It updates only the
matching `<!-- dns: <zone> -->` blocks in the [`DNS records`](reference/dns.md) reference; the page's
headings and prose remain handwritten. Kea-managed owners are identified by `DHCID` records and
removed together with their A, AAAA and PTR records; SOA records and TTLs are also omitted.
+212
View File
@@ -0,0 +1,212 @@
# Installing a box
Procedure for bringing a new NixOS box into this flake, from bare hardware booted into the custom
installer through to a deployable system. The shared agent skill is
[`install-box`](../.agents/skills/install-box/SKILL.md).
The install is **guided, not automated**: the mechanical steps (probing hardware, partitioning,
writing the config, evaluating it) can be done straight through, but stop at the judgment points
(marked ⏸) — what the box actually is, wiping disks, and running `do-install` itself. Keep a running
summary and present it before any destructive step.
For the installer image itself — what it contains, how it is built and released — see
[`misc/installer.md`](misc/installer.md).
## Setup facts
- **Installer access:** the box boots the custom installer (ISO, kexec or netboot) and is reached
over SSH as `root` with `.keys/deploy.key`. The devshell sets
`INSTALLER_SSH_OPTS = "-i .keys/deploy.key"`; set `INSTALLER` to the address, and
`INSTALLER_SSH_PORT` if it is not 22.
- **Devshell commands** (from [`devshell/install.nix`](../devshell/install.nix)):
`installer-shell [cmd]` and `do-install [--no-bootloader] [--no-substitute] <system>`.
- **`INSTALL_ROOT`** is `/mnt` in the installer's environment — everything is mounted under it and
`do-install` reads it from the installer rather than assuming.
- **`show-hw-config`** is a shell *alias* in the installer (wrapping
`nixos-generate-config --show-hardware-config --root $INSTALL_ROOT`), so it needs an interactive
shell: `installer-shell bash -lic show-hw-config`. A plain `installer-shell show-hw-config` will
not find it.
- **Validation:** `check-system <host>` evaluates a system without building it — use it while
iterating. Only `build-system` when you need the artifact.
- Nix reads the flake through git, so **`git add` new files before evaluating** — an untracked
box directory fails with "Path … is not tracked by Git", not a Nix error.
## Phase 1 — Establish what the box is
⏸ Settle these before writing anything; they decide where every file goes and they are not
recoverable from the hardware:
1. **Name and site** — the box name doubles as the `nixos.systems.<name>` attribute, the deploy node
name and the docs page name. The site decides the directory (`nixos/boxes/<site>/`), the
constants block in [`lib/constants.nix`](../lib/constants.nix) it draws prefixes from, and the
docs directory (`docs/sites/<site>/`, `docs/remote/`, `docs/mobile/`).
2. **Role** — what it does, which decides its modules, networking and firewall config.
3. **nixpkgs channel** — `unstable` / `stable` / `mine` / `mine-stable`; match the site's other
boxes unless there is a reason not to.
4. **Networking** — whether it gets `assignments` now, or bootstraps on DHCP because it is being
staged somewhere other than its final home. A box with no assignment still needs a reachable
`my.deploy.node.hostname`, since the default (`config.networking.fqdn`) will not resolve.
## Phase 2 — Reach the installer and inventory the hardware
With the box booted into the installer and `INSTALLER` set:
1. Confirm you are talking to the right thing — `installer-shell hostname` reports `installer`, and
`/etc/os-release` carries `VARIANT_ID=installer`.
2. Collect the inventory you will need for both the config and the docs page: `lscpu`, `free -h`,
`lsblk -o NAME,SIZE,TYPE,FSTYPE,MODEL,SERIAL`, `ip -br link`, `ip -br addr`,
`lspci -nn | grep -Ei 'ethernet|network|nvme|sata|raid'`, and whether `/sys/firmware/efi` exists.
3. Record every NIC's **permanent MAC** against its PCI address — interface naming in Phase 5 pins
names to MACs, and the PCI order tells you which physical port is which.
4. Run `installer-shell bash -lic show-hw-config` now for the kernel-module lists. Filesystems are
not mounted yet, so run it again in Phase 4 for those.
## Phase 3 — Partition, format and mount
⏸ Destructive. Check the target disks are the ones you think they are and that nothing on them is
wanted, then show the exact command sequence and get confirmation before running it.
The house layout is a tmpfs root (`my.tmproot`) with three mounts: an ESP at `/boot`, `/nix`, and
`/persist` (`neededForBoot = true`). Use **`sgdisk`** for partitioning and put `/nix` and `/persist`
on **LVM** so they can be resized later:
```sh
sgdisk -Z /dev/<disk>
sgdisk \
-n 1:0:+2G -t 1:ef00 -c 1:esp \
-n 2:0:0 -t 2:8e00 -c 2:lvm \
/dev/<disk>
partprobe /dev/<disk>
pvcreate /dev/<disk>p2
vgcreate main /dev/<disk>p2
lvcreate -L 48G -n <host>-nix main
lvcreate -l 100%FREE -n <host>-persist main
mkfs.vfat -n ESP /dev/<disk>p1
mkfs.ext4 -L nix /dev/main/<host>-nix
mkfs.ext4 -L persist /dev/main/<host>-persist
```
Conventions worth keeping: volume group `main`, logical volumes `<host>-nix` / `<host>-persist`,
and ext4 filesystem labels `nix` and `persist`. Size the ESP and `/nix` to the box — 2 GiB and
48 GiB suit a small single-disk box.
Then mount everything under `$INSTALL_ROOT`, with a tmpfs standing in for the eventual tmpfs root:
```sh
mount -t tmpfs -o size=2G tmpfs "$INSTALL_ROOT"
mkdir -p "$INSTALL_ROOT"/{nix,persist,boot}
mount /dev/main/<host>-nix "$INSTALL_ROOT/nix"
mount /dev/main/<host>-persist "$INSTALL_ROOT/persist"
mount /dev/<disk>p1 "$INSTALL_ROOT/boot"
```
### Seed the SSH host key
The installer generates fresh host keys on every boot, so adopt them as the box's own rather than
letting it generate another set on first boot. Copy them onto the persist volume now:
```sh
install -d -m 0755 "$INSTALL_ROOT/persist/etc/ssh"
for t in ed25519 rsa; do
install -m 0600 "/etc/ssh/ssh_host_${t}_key" "$INSTALL_ROOT/persist/etc/ssh/ssh_host_${t}_key"
install -m 0644 "/etc/ssh/ssh_host_${t}_key.pub" "$INSTALL_ROOT/persist/etc/ssh/ssh_host_${t}_key.pub"
done
```
`my.tmproot` persists `services.openssh.hostKeys` at exactly those paths, so the installed system
picks them up. This means the box's key is known **before** it first boots, so `my.secrets.key` can
be set and its secrets encrypted as part of the same pass — no install, boot, re-encrypt, re-deploy
round trip. (For a box already up, the `ssh-get-ed25519 <host>` devshell command prints the same
value in the form `my.secrets.key` wants.)
## Phase 4 — Capture the hardware config
Re-run `installer-shell bash -lic show-hw-config` with the filesystems mounted.
Read the whole generated file and carry over **anything** in it that the flake does not already
provide — it reflects what was actually detected on this hardware, and the list below is just what
usually shows up, not a limit:
- `boot.initrd.availableKernelModules` and `boot.initrd.kernelModules` (LVM adds `dm-snapshot`)
- `boot.kernelModules` (`kvm-intel` / `kvm-amd`) and the microcode attribute
- the ESP's `by-uuid` device, and the device paths for `/nix` and `/persist`
- anything else it emits — `boot.extraModulePackages`, `hardware.*` attributes, `swapDevices`,
additional detected filesystems, `imports` such as `not-detected.nix`
The test is conflict, not familiarity: drop an option only when a nixfiles module already sets it,
and keep it otherwise. The flake's own modules cover the bootloader, `initrd.systemd`,
`initrd.services.lvm`, the kernel package and `nixpkgs.hostPlatform` (see
[`nixos/modules/common.nix`](../nixos/modules/common.nix) and
[`nixos/default.nix`](../nixos/default.nix)), so those are the ones to leave out. Don't paste the
file in wholesale either — translate it into the box's own style, and reference LVM volumes as
`/dev/main/<host>-nix` rather than the generated `/dev/mapper/main-<host>--nix`.
## Phase 5 — Write the box config
Create `nixos/boxes/<site>/<host>/default.nix` (a directory, so per-topic files can be added
alongside it later) declaring `nixos.systems.<host>`, and add its path to the `configs` list in
[`flake.nix`](../flake.nix). Then `git add` it.
The minimum is `system`, `nixpkgs`, `home-manager` and a `configuration` with the hardware from
Phase 4, the three filesystems, and networking. Beyond that:
- **Interface naming:** pin names to hardware with `.link` files matching `PermanentMACAddress`,
named for speed and index — `et1g0`, `et2g5-0`, `et10g-1`. Never rely on predictable-interface
names in the `.network` files.
- **Servers** set `my.server.enable = true`.
- **Secrets:** set `my.secrets.key` to the ed25519 public key seeded in Phase 3 (the key only, no
`root@installer` comment). Note that **every box declares at least one secret** even if its own
config declares none: [`nixos/modules/user.nix`](../nixos/modules/user.nix) adds
`user-passwd.txt` whenever `my.user.enable` is on, which is the default. So setting
`my.secrets.key` always adds the box to that file's recipients, and
`ragenix --rekey-one secrets/user-passwd.txt.age` is required — skip it and the box cannot
decrypt its user password on first boot. Confirm what the box actually declares with
`nix eval .#nixosConfigurations.<host>.config.age.secrets --apply builtins.attrNames`, and
re-encrypt each of those files the same way. Create any new secrets with `ragenix -e <path>`.
Never use `--rekey`, which rewrites every secret in `secrets/`.
- **A box staged away from its final home** gets a bootstrap `.network` taking DHCP, plus
`systemd.network.wait-online.anyInterface = true` so boot does not block on unpatched ports, and
an explicit `my.deploy.node.hostname`. Comment it as temporary and say what replaces it.
Validate with `check-system <host>` and fix eval errors before going near the target.
## Phase 6 — Install
⏸ The maintainer may want to run this step themselves; ask rather than assume.
`do-install <host>` builds the system's `toplevel`, `nix copy`s the closure into the installer's
`$INSTALL_ROOT` store, points `/nix/var/nix/profiles/system` at it, touches `/etc/NIXOS`, and runs
`switch-to-configuration boot` with `NIXOS_INSTALL_BOOTLOADER=1`. It prompts for confirmation and
prints the target it resolved.
- `--no-bootloader` skips the bootloader install (for a box that boots by other means).
- `--no-substitute` copies everything from the local store instead of letting the target substitute.
## Phase 7 — First boot and post-install
1. Reboot the box off the installer and confirm it comes up: it should get its address, and
`hostname` should be the system name. Its SSH host key is the one seeded in Phase 3, so it
presents the same fingerprint the installer did.
2. **Secrets.** If Phase 5 set `my.secrets.key`, they already decrypt. [`secrets.nix`](../secrets.nix)
computes the ragenix recipient list from that key at evaluation time, so nothing needs
regenerating — but any secret added to the box later must be re-encrypted for the new recipient
list with `ragenix --rekey-one <path>`, one file at a time. Never reach for `ragenix --rekey`:
it rewrites every secret in `secrets/` and buries the actual change in churn.
3. **Deploy.** `deploy .#<host>` should now work over the `deploy` user. If the box is staged
somewhere without its final DNS name, `deploy --hostname <address> .#<host>` overrides the node
hostname for one run.
## Phase 8 — Document it
Per [`AGENTS.md`](../AGENTS.md), a new box means:
- a box page under the right docs directory, following the standard layout (H1 + one-line intro;
`Source` / `Host` / `nixpkgs` bullets; hardware inventory; `## Role`; `## Network assignments`
linking to [`networking.md#box-assignments`](networking.md#box-assignments), or a short
explanation if it has none yet; one `##` per topic; `## Notable config files` last);
- a row in the site index `README.md` boxes table;
- affected prose in [`networking.md`](networking.md) — the assignment tables themselves are
CI-generated, so write the prose and leave the tables alone;
- the site diagram in [`README.md`](README.md) if the box changes its layout.
+46
View File
@@ -0,0 +1,46 @@
# installer
The custom NixOS installer image used to bootstrap new boxes.
- **Source:** [`nixos/installer.nix`](../../nixos/installer.nix)
- **Host:** — (a build target, not a deployed box)
## Role
- Defines `nixos.systems.installer`, a minimal server system rendered as a bootable ISO via
`config.my.buildAs.iso` (`my.asISO`); the same base can also be built as a kexec or netboot
tree.
- Build it with the devshell commands: `build-iso installer` (or `build-kexec installer` /
`build-netboot installer`). The `update-installer` command force-tags `installer` to
trigger a release rebuild in CI.
## Image contents
- Broad hardware support (`my.build.allHardware` pulls in the nixpkgs all-hardware profile);
EFI- and USB-bootable, zstd-compressed squashfs. Volume ID
`jackos-<release>-<arch>`, menu label "/dev/player0 Installer", image base name
`jackos-installer`.
- Root SSH with the deploy key authorized (`PermitRootLogin prohibit-password`); a random
`installer-<hex>` hostname is set at boot.
- `INSTALL_ROOT=/mnt` in the session environment, plus a `show-hw-config` alias wrapping
`nixos-generate-config --show-hardware-config --root $INSTALL_ROOT`.
- NixOS documentation enabled, NetworkManager available but not started at boot (run
`systemctl start NetworkManager`, then `nmtui`), GC and memory-overcommit tuning for low-memory
targets, LVM thin and NFS support.
- Identifies itself as `VARIANT_ID=installer` in `/etc/os-release`, and leaves the target's
persistent pstore entries alone (`Unlink=no`) so an install doesn't evacuate them.
- No regular user (`my.user.enable = false`), no tmpfs-root management, no NAT, and not a
deploy target (`my.deploy.enable = false`).
## Installing a box
The end-to-end procedure — hardware inventory, partitioning, writing the box config, installing and
documenting it — is in [`install-box.md`](../install-box.md). The devshell's installer commands
([`devshell/install.nix`](../../devshell/install.nix)) drive an install over SSH against a booted
installer reachable at `$INSTALLER`:
- `installer-shell` — get a shell on the installer.
- `do-install <system>` — builds the system's toplevel, `nix copy`s the closure to the
installer's `$INSTALL_ROOT` remote store, sets the system profile, touches `/etc/NIXOS`,
and runs `switch-to-configuration boot` with `NIXOS_INSTALL_BOOTLOADER=1` (skip the
bootloader with `--no-bootloader`, skip substitution with `--no-substitute`).
+9
View File
@@ -0,0 +1,9 @@
# Mobile boxes
Portable workstations that move between networks — currently just `tower`. Mobile boxes have
no static network assignments; they use DHCP/NetworkManager and reach other boxes over the
tailnet.
| Box | What it is |
| --- | --- |
| [`tower`](tower.md) | Framework Laptop 13 workstation |
+52
View File
@@ -0,0 +1,52 @@
# tower
Portable workstation — a Framework Laptop 13 (Intel), running the full GUI environment.
- **Source:** [`nixos/boxes/tower/default.nix`](../../nixos/boxes/tower/default.nix)
- **Host:** physical (laptop)
- **nixpkgs:** `mine`
## Hardware / platform
| Component | Inventory |
|---|---|
| Platform | Framework Laptop 13 (12th Gen Intel Core) |
| CPU | Intel Core i5-1240P (12 cores / 16 threads) |
| Memory | 32 GiB |
| Storage | 2 TB WD Black SN850 NVMe SSD |
| Graphics | Integrated Intel Iris Xe |
| Connectivity | Intel AX210 Wi-Fi 6E, Bluetooth and Thunderbolt 4 |
The configuration enables Intel microcode updates, `kvm-intel`, `intel_iommu=on`,
`intel-media-driver` and the latest kernel (`lib.my.c.kernel.latest`). Thunderbolt security
(`bolt`), the fingerprint reader (`fprintd`) and `tlp` power management are also enabled.
## Role
- Personal portable workstation: `my.gui.enable`, with Sway managed by home-manager.
- Joins the tailnet through the headscale on [`britway`](../remote/britway.md) (fish abbr
`tsup` = `doas tailscale up --login-server=https://hs.nul.ie --accept-routes`).
## Network assignments
`tower` has no static assignment; it uses DHCP through NetworkManager and reaches the other boxes
over Tailscale.
## Storage
- Two LUKS-encrypted partitions, `persist` and `home` (both `allowDiscards`); `/nix` is a
separate ext4 filesystem, `/boot` is vfat.
- Persistent `/home` (`my.user.tmphome = false`) with a size-limited tmpfs root (`my.tmproot.size`).
## Networking / services
- NetworkManager (`wpa_supplicant` backend) with `systemd-resolved`; networkd `wait-online`
is disabled. The Wi-Fi interface is renamed to `wifi` by MAC.
- `ssh-machine tower` uses `tower.dyn.h.nul.ie` when its SSH port is reachable and
`tower.ts.nul.ie` over Tailscale otherwise.
- Steam and Wireshark enabled; `fstrim`, LVM thin provisioning.
- `nix.gc.automatic = false` — GC is run manually on the laptop.
## Notable config files
- [`nixos/boxes/tower/default.nix`](../../nixos/boxes/tower/default.nix) — the whole box (single file).
+606
View File
@@ -0,0 +1,606 @@
# Networking
This page describes how addressing works across the boxes: the assignment mechanism, the
per-site domains and prefixes, the home router HA pair, and the overlays/tunnels that tie the
sites together. Switch-level home topology (`jim`/`dave`/`brian`/`shytzel`, the WAN paths) lives in
[sites/home/switches.md](sites/home/switches.md).
## Assignments
Every box declares `nixos.systems.<name>.assignments`, an attrset of *assignments* (one per
network the box is attached to). The option definition (`assignmentOpts` in
[`nixos/default.nix`](../nixos/default.nix)):
- `name` (defaults to the attribute name) and `altNames` — DNS names for the assignment.
- `visible` (default `true`) — whether DNS helpers include it.
- `domain` — DNS suffix for this assignment.
- `mtu` — interface MTU (applied via the network's `linkConfig.MTUBytes`).
- `ipv4.address` / `ipv4.mask` (default 24) / `ipv4.gateway` (defaults to host 1 of the
prefix; set explicitly to `null` when there is no gateway) / `ipv4.genPTR`.
- `ipv6.address` (nullable — an assignment can be v4-only) / `ipv6.mask` (default 64) /
`ipv6.iid` (SLAAC static token instead of a full address) / `ipv6.gateway` / `ipv6.genPTR`.
`extraAssignments` is a second, nested level for addresses that belong *to* a network but not
to any single box — the home routers use it for their floating VIP entries (`router-hi`,
`router-lo`, `router-ut`).
All assignments are aggregated into `nixos.allAssignments` — every system's `assignments`
merged with every system's `extraAssignments` — and passed to every module as the
`allAssignments` argument, so any box can route to any other box's addresses without
hardcoding. A flake-wide assertion fails evaluation if any IPv4 or IPv6 address appears in
more than one assignment. Each box also receives its own assignments as the `assignments`
module argument.
Two pieces of machinery consume assignments:
- `lib.my.networkdAssignment` ([`lib/default.nix`](../lib/default.nix)) renders an assignment
as a `systemd.network` network: static `address`/`gateway`, MTU, LLDP, and IPv6 RA handling
(`IPv6AcceptRA` when there's no static gateway or a static `iid` is set, with
`Token = static:<iid>`).
- `mkSystem` defaults `networking.hostName` to `assignments.internal.name` (falling back to
the system name) and `networking.domain` to `assignments.internal.domain`. The shared
`network` module sets a fallback domain of `int.nul.ie` for boxes without one.
## Box assignments
Every box's `assignments` (plus the routers' floating VIP `extraAssignments`), grouped first by site
and then by assignment key. Generated from `nixos.allAssignments` by
`nix run .#update-docs-assignments`; CI keeps it current. Only the **Notes** column is hand-written —
edit prose there, never the other generated cells.
### colony
<!-- assignments: colony -->
<!-- assignments-start -->
#### `internal`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`chatterbox`](sites/colony/shill/containers/chatterbox.md) | `10.100.2.5/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::5/64` | ams1.int.nul.ie | |
| [`colony`](sites/colony/colony.md) | `94.142.241.224/32` | `2a0e:97c0:4d2:10::2/64` | ams1.int.nul.ie | |
| [`colony-psql`](sites/colony/shill/containers/colony-psql.md) | `10.100.2.4/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::4/64` | ams1.int.nul.ie | |
| `enshrouded-oci` | `10.100.3.5/24 gw 10.100.3.1` | `2a0e:97c0:4d2:13::5/64` | ams1.int.nul.ie | Enshrouded OCI container on [`whale2`](sites/colony/whale2.md#game-servers); disabled |
| [`estuary`](sites/colony/estuary.md) | `94.142.240.44/24 gw 94.142.240.254` | `2a02:898:0:20::329:1/64 gw 2a02:898:0:20::1` | ams1.int.nul.ie | |
| [`gam`](sites/colony/shill/containers/gam.md) | `10.100.2.11/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::b/64` | ams1.int.nul.ie | |
| [`git`](sites/colony/git.md) | `94.142.241.117/32` | `2a0e:97c0:4d2:11::4/64` | ams1.int.nul.ie | |
| `graeme-oci` | `10.100.3.8/24 gw 10.100.3.1` | `2a0e:97c0:4d2:13::8/64` | ams1.int.nul.ie | Minecraft OCI container on [`whale2`](sites/colony/whale2.md#game-servers) |
| [`jackflix`](sites/colony/shill/containers/jackflix.md) | `10.100.2.6/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::6/64` | ams1.int.nul.ie | |
| `kevcraft-oci` | `10.100.3.6/24 gw 10.100.3.1` | `2a0e:97c0:4d2:13::6/64` | ams1.int.nul.ie | Minecraft OCI container on [`whale2`](sites/colony/whale2.md#game-servers) |
| `kinkcraft-oci` | `10.100.3.7/24 gw 10.100.3.1` | `2a0e:97c0:4d2:13::7/64` | ams1.int.nul.ie | Minecraft OCI container on [`whale2`](sites/colony/whale2.md#game-servers) |
| [`middleman`](sites/colony/shill/containers/middleman.md) | `10.100.2.2/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::2/64` | ams1.int.nul.ie | |
| [`object`](sites/colony/shill/containers/object.md) | `10.100.2.7/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::7/64` | ams1.int.nul.ie | |
| [`qclk`](sites/colony/shill/containers/qclk.md) | `10.100.2.10/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::a/64` | ams1.int.nul.ie | |
| [`shill`](sites/colony/shill/README.md) | `94.142.241.225/32` | `2a0e:97c0:4d2:11::2/64` | ams1.int.nul.ie | |
| `simpcraft-oci` | `10.100.3.3/24 gw 10.100.3.1` | `2a0e:97c0:4d2:13::3/64` | ams1.int.nul.ie | Minecraft OCI container on [`whale2`](sites/colony/whale2.md#game-servers) |
| `simpcraft-staging-oci` | `10.100.3.4/24 gw 10.100.3.1` | `2a0e:97c0:4d2:13::4/64` | ams1.int.nul.ie | Minecraft staging OCI container on [`whale2`](sites/colony/whale2.md#game-servers); disabled |
| [`toot`](sites/colony/shill/containers/toot.md) | `10.100.2.8/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::8/64` | ams1.int.nul.ie | |
| `valheim-oci` | `10.100.3.2/24 gw 10.100.3.1` | `2a0e:97c0:4d2:13::2/64` | ams1.int.nul.ie | Valheim OCI container on [`whale2`](sites/colony/whale2.md#game-servers) |
| [`vaultwarden`](sites/colony/shill/containers/vaultwarden.md) | `10.100.2.3/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::3/64` | ams1.int.nul.ie | |
| [`waffletail`](sites/colony/shill/containers/waffletail.md) | `10.100.2.9/24 gw 10.100.2.1` | `2a0e:97c0:4d2:12::9/64` | ams1.int.nul.ie | |
| [`whale2`](sites/colony/whale2.md) | `94.142.241.226/32` | `2a0e:97c0:4d2:11::3/64` | ams1.int.nul.ie | |
#### `as211024`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`estuary`](sites/colony/estuary.md) | `10.100.50.1/24` | `2a0e:97c0:4df::1/64` | — | |
#### `base`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`estuary`](sites/colony/estuary.md) | `10.100.0.1/24` | `2a0e:97c0:4d2:10::1/64` | ams1.int.nul.ie | |
#### `ctrs`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`shill`](sites/colony/shill/README.md) | `10.100.2.1/24` | `2a0e:97c0:4d2:12::1/64` | ams1.int.nul.ie | |
#### `oci`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`whale2`](sites/colony/whale2.md) | `10.100.3.1/24` | `2a0e:97c0:4d2:13::1/64` | ams1.int.nul.ie | |
#### `qclk`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`qclk`](sites/colony/shill/containers/qclk.md) | `10.100.4.1/24` | — | — | |
#### `routing`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`colony`](sites/colony/colony.md) | `10.100.0.2/24 gw 10.100.0.1` | — | ams1.int.nul.ie | |
| [`git`](sites/colony/git.md) | `10.100.1.4/24 gw 10.100.1.1` | — | ams1.int.nul.ie | |
| [`shill`](sites/colony/shill/README.md) | `10.100.1.2/24 gw 10.100.1.1` | — | ams1.int.nul.ie | |
| [`whale2`](sites/colony/whale2.md) | `10.100.1.3/24 gw 10.100.1.1` | — | ams1.int.nul.ie | |
#### `tailscale`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`waffletail`](sites/colony/shill/containers/waffletail.md) | `100.64.0.5/32` | `fd7a:115c:a1e0::5/128` | — | |
#### `vms`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`colony`](sites/colony/colony.md) | `10.100.1.1/24` | `2a0e:97c0:4d2:11::1/64` | ams1.int.nul.ie | |
<!-- assignments-end -->
### home
<!-- assignments: home -->
<!-- assignments-start -->
#### `as211024`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`river`](sites/home/river.md) | `10.100.50.2/24` | `2a0e:97c0:4df:0:1::1/64 gw 2a0e:97c0:4df:0:2::1` | — | |
| [`stream`](sites/home/stream.md) | `10.100.50.3/24` | `2a0e:97c0:4df:0:1::2/64 gw 2a0e:97c0:4df:0:2::1` | — | |
#### `core`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`palace`](sites/home/palace.md) | `192.168.64.20/24` | — | h.nul.ie | |
| [`river`](sites/home/river.md) | `192.168.64.1/24` | — | h.nul.ie | |
| [`stream`](sites/home/stream.md) | `192.168.64.2/24` | — | h.nul.ie | |
| [`unifi`](sites/home/sfh/containers/unifi.md) | `192.168.64.21/24` | — | h.nul.ie | |
#### `hi`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`castle`](sites/home/castle.md) | `192.168.68.40/22 gw 192.168.71.254` | `2a0e:97c0:4d0:1::3:1/64` | h.nul.ie | |
| [`cellar`](sites/home/cellar.md) | `192.168.68.80/22 gw 192.168.71.254` | `2a0e:97c0:4d0:1::4:1/64` | h.nul.ie | |
| [`hass`](sites/home/sfh/containers/hass.md) | `192.168.68.103/22 gw 192.168.71.254` | `2a0e:97c0:4d0:1::5:3/64` | h.nul.ie | |
| [`palace`](sites/home/palace.md) | `192.168.68.22/22 gw 192.168.71.254` | `2a0e:97c0:4d0:1::2:1/64` | h.nul.ie | |
| [`portcullis`](sites/colony/portcullis.md) | `192.168.68.41/22 gw 192.168.71.254` | `2a0e:97c0:4d0:1::6:1/64` | h.nul.ie | |
| [`river`](sites/home/river.md) | `192.168.68.1/22` | `2a0e:97c0:4d0:1::1/64` | h.nul.ie | |
| `router-hi` | `192.168.71.254/22 gw 192.168.68.1` | `2a0e:97c0:4d0:1::ffff/64` | h.nul.ie | Floating VIP shared by [`river`](sites/home/river.md) and [`stream`](sites/home/stream.md) |
| [`sfh`](sites/home/sfh/README.md) | `192.168.68.81/22 gw 192.168.71.254` | `2a0e:97c0:4d0:1::4:2/64` | h.nul.ie | |
| [`stream`](sites/home/stream.md) | `192.168.68.2/22` | `2a0e:97c0:4d0:1::2/64` | h.nul.ie | |
| [`unifi`](sites/home/sfh/containers/unifi.md) | `192.168.68.100/22 gw 192.168.71.254` | `2a0e:97c0:4d0:1::5:1/64` | h.nul.ie | |
#### `lo`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`hass`](sites/home/sfh/containers/hass.md) | `192.168.72.103/21` | `2a0e:97c0:4d0:2::5:3/64` | h.nul.ie | |
| [`river`](sites/home/river.md) | `192.168.72.1/21` | `2a0e:97c0:4d0:2::1/64` | h.nul.ie | |
| `router-lo` | `192.168.79.254/21 gw 192.168.72.1` | `2a0e:97c0:4d0:2::ffff/64` | h.nul.ie | Floating VIP shared by [`river`](sites/home/river.md) and [`stream`](sites/home/stream.md) |
| [`stream`](sites/home/stream.md) | `192.168.72.2/21` | `2a0e:97c0:4d0:2::2/64` | h.nul.ie | |
#### `rdma`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`river`](sites/home/river.md) | `192.168.68.3/32` | — | h.nul.ie | |
#### `untrusted`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`river`](sites/home/river.md) | `192.168.80.1/24` | `2a0e:97c0:4d0:3::1/64` | h.nul.ie | |
| `router-ut` | `192.168.80.254/24 gw 192.168.80.1` | `2a0e:97c0:4d0:3::ffff/64` | h.nul.ie | Floating VIP shared by [`river`](sites/home/river.md) and [`stream`](sites/home/stream.md) |
| [`slop-cannon`](sites/home/slop-cannon.md) | `192.168.80.5/24 gw 192.168.80.254` | `2a0e:97c0:4d0:3::5/64` | h.nul.ie | |
| [`stream`](sites/home/stream.md) | `192.168.80.2/24` | `2a0e:97c0:4d0:3::2/64` | h.nul.ie | |
<!-- assignments-end -->
### remote
<!-- assignments: remote -->
<!-- assignments-start -->
#### `internal`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`kelder-acquisition`](remote/kelder/containers/kelder-acquisition.md) | `172.16.64.2/24 gw 172.16.64.1` | — | hentai.engineer | |
| [`kelder-spoder`](remote/kelder/containers/kelder-spoder.md) | `172.16.64.3/24 gw 172.16.64.1` | — | hentai.engineer | |
#### `allhost`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`britnet`](remote/britnet.md) | `77.74.199.67/24 gw 77.74.199.1` | `2a12:ab46:5344:99::a/64 gw 2a12:ab46:5344::1` | bhx1.int.nul.ie | |
#### `as211024`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`britway`](remote/britway.md) | `10.100.50.5/24` | `2a0e:97c0:4df:0:2::1/64` | — | |
#### `ctrs`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`kelder`](remote/kelder/README.md) | `172.16.64.1/24` | — | hentai.engineer | |
#### `estuary`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`kelder`](remote/kelder/README.md) | `94.142.242.254/32` | — | — | |
#### `vpn`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`britnet`](remote/britnet.md) | `10.200.0.1/24` | `fdfb:5ebf:6e84::1/64` | — | |
#### `vultr`
| Box | IPv4 | IPv6 | Domain | Notes |
|---|---|---|---|---|
| [`britway`](remote/britway.md) | `45.76.141.188/23 gw 45.76.140.1` | `2001:19f0:7402:128b::1/64` | lon1.int.nul.ie | |
<!-- assignments-end -->
## Domains
The public domain is `nul.ie` (`lib.my.c.pubDomain`). Each site has its own internal domain
(constants in [`lib/constants.nix`](../lib/constants.nix)):
| Site | Domain |
|---|---|
| colony | `ams1.int.nul.ie` |
| home | `h.nul.ie` |
| britway | `lon1.int.nul.ie` |
| britnet | `bhx1.int.nul.ie` |
| kelder | `hentai.engineer` |
## colony
The colony box is a hosted server in Amsterdam (`ams1`); its public edge is the `estuary` VM
(`94.142.240.44`, `2a02:898:0:20::329:1`), which NATs and filters for everything behind it.
The internal prefixes (`lib.my.c.colony.prefixes`) are carved from `10.100.0.0/16` and
`2a0e:97c0:4d2:10::/60`:
| Network | IPv4 | IPv6 | Purpose |
|---|---|---|---|
| `base` | `10.100.0.0/24` | `2a0e:97c0:4d2:10::/64` | Base/management LAN (bridge on the host; estuary is `.1`) |
| `vms` | `10.100.1.0/24` | `2a0e:97c0:4d2:11::/64` | VM network (host is `.1`, hands out RAs) |
| `ctrs` | `10.100.2.0/24` | `2a0e:97c0:4d2:12::/64` | `systemd-nspawn` containers on the `shill` VM |
| `oci` | `10.100.3.0/24` | `2a0e:97c0:4d2:13::/64` | Podman/OCI workloads on the `whale2` VM |
| `qclk` | `10.100.4.0/24` | — | WireGuard endpoint instances in the `qclk` container |
On top of that: `p2pTunnels` (`10.100.5.0/24`) holds point-to-point tunnel /30s (see
[WireGuard tunnels](#wireguard-point-to-point-tunnels)); the `as211024` mesh gets
`10.100.50.0/24` + `2a0e:97c0:4df::/64` (see [the L2 mesh](#the-as211024-l2-mesh)); and the
`cust` block (`10.100.100.0/24`, `2a0e:97c0:4d2:2000::/56`) plus the `vip1`/`vip2`/`vip3`
public blocks and the per-customer `mail` / `darts` / `jam` prefixes carry customer-facing
services with their own public addresses (announced by BGP, routed via the host).
This layout is expected to change: [`portcullis`](sites/colony/portcullis.md) is bare-metal edge
hardware headed for Nikhef that will take over most of `estuary`'s routing. It has no colony
assignments yet (only a home `hi` one, from being staged at home) and the replacement topology is
still being designed.
## home
The home site prefixes (`lib.my.c.home.prefixes`) come from `192.168.64.0/18` and
`2a0e:97c0:4d0::/60`, with VLAN IDs from `lib.my.c.home.vlans`:
| Network | VLAN | IPv4 | IPv6 | MTU | Purpose |
|---|---|---|---|---|---|
| `core` | — (macvlan) | `192.168.64.0/24` | — | 1500 | Router-to-router/core link |
| `hi` | 100 | `192.168.68.0/22` | `2a0e:97c0:4d0:1::/64` | 9000 | High-speed LAN (jumbo frames) |
| `lo` | 110 | `192.168.72.0/21` | `2a0e:97c0:4d0:2::/64` | 1500 | General LAN |
| `untrusted` | 120 | `192.168.80.0/24` | `2a0e:97c0:4d0:3::/64` | 1500 | Untrusted / IoT |
| `modem` | 130 (`wan`) | `192.168.0.0/24` | — | — | Virgin Media modem management (stream) |
| `ont` | 140 (`wan-pon-ont`) | `192.168.100.0/24` | — | — | Digiweb ONT management (river) |
Two more WAN-side VLANs exist: `pon-isp` (10), the ISP VLAN Digiweb delivers at the ONT and
which is trunked untranslated to river, and `wan-pon-isp` (141), reserved for a future
multi-ONT translation scheme — see
[sites/home/switches.md](sites/home/switches.md) for the fabric side.
The routers themselves (`river` = host 1, `stream` = host 2 in each prefix) are built from one
definition, [`nixos/boxes/home/routing-common`](../nixos/boxes/home/routing-common/default.nix),
parameterised by an index (`0` = river, `1` = stream) that derives per-box addresses, DHCP
pool splits, VRRP state/priority and DNS `ns` numbering.
### Router VIPs
Clients never use a router's real address: each client VLAN has a floating VIP
(`lib.my.c.home.vips`) that follows the VRRP master. The VIPs are also declared as
`extraAssignments` (`router-hi`/`router-lo`/`router-ut`) so they appear in `allAssignments`
and DNS:
| Assignment | IPv4 | IPv6 |
|---|---|---|
| `router-hi` | `192.168.71.254/22` | `2a0e:97c0:4d0:1::ffff/64` |
| `router-lo` | `192.168.79.254/21` | `2a0e:97c0:4d0:2::ffff/64` |
| `router-ut` | `192.168.80.254/24` | `2a0e:97c0:4d0:3::ffff/64` |
There is also a mesh-side VIP (`as211024`): `10.100.50.4` and `2a0e:97c0:4df:0:1::ffff`,
which the other sites use as their next-hop into the home prefixes.
### Router HA
#### Switch attachments
Both routers use `lan-dave` and `lan-jim` under an RSTP bridge named `lan`. The
[failover validation](sites/home/router-failover.md) covers router, attachment and switch outages.
[`routing-common`](../nixos/boxes/home/routing-common/default.nix) owns the bridge, `mstpd` setup and
explicit port costs: `dave` is preferred at cost 10 and `jim` is redundant at cost 100. Native
`core`, the client VLANs and `river`'s Digiweb VLANs sit above this bridge. The `jim` path can reach
the ONT through the RSTP-protected connection between `jim` and `brian` without traversing `dave`.
RSTP follows the fabric topology, including failures beyond a local cable that retains carrier;
an active-backup bond using only MII monitoring would miss those failures. The guest bridge has an
explicit jumbo MTU. Root priorities and port roles across the complete fabric must agree with the
intended preference; local port costs alone do not establish a working redundant path.
On networkd configuration events, the dispatcher inspects the current bridge ports and applies
the costs through `mstpctl`, retrying until the daemon has registered each port. The daemon's
configuration hook reapplies them on restart or reload. The shared DHCPv4 service
waits for IPv4 readiness on the client interfaces and retries delayed startup without exhausting
systemd's start limit.
`river` keeps its NVMe/RDMA traffic on a separate VF, outside the bridge; see
[river](sites/home/river.md#storage). The physical fabric is documented in
[switches.md](sites/home/switches.md).
#### VRRP
[`routing-common/keepalived.nix`](../nixos/boxes/home/routing-common/keepalived.nix) defines separate
v4/v6 instances (router IDs 51/52) on `lan-core`. Index 0 (`river`) starts as `MASTER`, priorities
are `255 - index`, and track scripts demote a router whose WAN checks fail. All VIPs of an address
family move together.
#### Client gateway and DNS
`kea` hands out `vips.<vlan>.v4` as both `routers` and `domain-name-servers`, with the two routers
serving disjoint pool halves. `radvd` advertises the v6 VIP as RDNSS (`untrusted` gets Cloudflare)
and keepalived's `notify_master`/`notify_backup` hooks ensure that only the master sends RAs.
Statically-addressed boxes (the servers on `hi`) don't run DHCP, so they'd otherwise learn a
resolver only from the v6 RA RDNSS — which vanishes when v6 is disabled, taking DNS with it. They
instead anchor DNS on the VIPs via the shared `lib.my.c.home.vlanDns "<vlan>"` fragment, which sets
`DNS` to `vips.<vlan>.{v4,v6}` and `Domains` to the advertised search list; the always-present
static v4 VIP keeps resolution working even with v6 down.
#### Untrusted clients
The routers restrict clients on the `untrusted` VLAN to Internet destinations. The filter also
blocks access to colony, where the home prefixes are trusted across the mesh.
- `forward-early` sends new connections from `lan-untrusted` to `untrusted-internal`, which rejects
everything in `lib.my.c.internalNets`: private, CGNAT (Tailscale), link-local, multicast and
reserved IPv4, IPv6 ULA / link-local / multicast, and our own global IPv6 prefixes. It runs
before `forward`, whose ICMP rules would otherwise let pings through.
- `filter-untrusted` then accepts `wan` and `as211024` (IPv6 Internet transit) and rejects the
rest.
- Rejecting rather than dropping makes clients fall back from colony's IPv6 addresses (such as
`git.nul.ie`'s) to IPv4 immediately.
- Replies to connections from `hi` and `lo` are allowed, so trusted boxes can still reach
`untrusted` hosts.
- Traffic to the routers themselves goes through the same `input` rules as `wan`.
- Clients on `untrusted` share layer 2 with each other; the routers can't filter that.
- [`slop-cannon`](sites/home/slop-cannon.md) uses a static address on the `untrusted` VLAN.
#### DNS binding
`pdns-recursor` binds the VIPs directly; see
[`routing-common/dns.nix`](../nixos/boxes/home/routing-common/dns.nix). The
`net.ipv4.ip_nonlocal_bind` / `net.ipv6.ip_nonlocal_bind` settings let the backup listen before it
owns the addresses, so failover does not depend on client resolver timeouts. The recursor forwards
the site's zones to authoritative PowerDNS on `127.0.0.1:5353`. The generated
[DNS reference](reference/dns.md) lists the live forward and reverse records; the authoritative
servers allow its AXFRs from the shared internal prefixes and the colony site's egress address.
#### `wan-online.target`
This shared, initially inert systemd target means "the public IPv4 WAN route is up".
`routing-common` only declares it: `stream` gates it on a oneshot that waits for the DHCP default
route on `wan`, while `river`'s `pppd` hooks start and stop it. Consumers such as `ipsec` attach with
`wantedBy` + `partOf` + `after`, never `requires`/`wants`, so they cannot pull the target in early
and they reload on WAN flap.
DDNS starts when this WAN gate opens, after the local authoritative server and recursor.
Its five-minute timer retries failed updates and refreshes the public records; timer and manual
starts skip the update while the WAN gate is inactive, without activating it. `river` also
updates immediately after PPPoE reconnects. `doas systemctl start ddns-update.service` retries
immediately once connectivity is available.
### WAN paths (summary)
#### `river`
The VM on `palace` runs Digiweb PPPoE directly on VLAN 10 (`vlans.pon-isp`), trunked untranslated
over its RSTP `lan` bridge. `dave` is the normal carrying path; `jim` provides the redundant path.
The VLAN interface is named `wan-pon-isp`; VLAN ID 141 with that name is reserved for a future
translation scheme. MTU 1508 preserves a 1500-byte PPP session, IPCP
requests the static address, and the `pppd` hooks own `wan-online.target`. `wan-pon-ont` (VLAN 140)
reaches the ONT management subnet at `192.168.100.0/24`, where `river` takes `.100`.
#### `stream`
The bare-metal backup uses DHCP from the Virgin Media modem on `wan` (VLAN 130), keeps a static
`192.168.0.100/24` management address beside the public lease, and applies CAKE shaping through
`wan-ifb`.
The full fabric story — which switch port carries what, why VLAN 10 is trunked untranslated,
and the multi-ONT plan — is in [sites/home/switches.md](sites/home/switches.md); the
`my.homeRouter.dns.wanSkipBroadcasts` option lets each box tell `routing-common` about subnets
sharing its WAN interface.
## The AS211024 L2 mesh
The edge routers are joined by a layer-2 mesh, defined once as `nixos.vpns.l2.as211024` in
[`nixos/boxes/colony/vms/estuary/default.nix`](../nixos/boxes/colony/vms/estuary/default.nix)
and realised on each member by the [`l2mesh` module](../nixos/modules/l2mesh.nix):
### Members
`estuary`, `river`, `stream` and `britway` peer on their public addresses.
### Transport
VXLAN (VNI 211024, UDP port 4789) uses static per-peer FDB entries and UDP-encapsulated IPsec in
Libreswan transport mode. It authenticates without encryption by default; `security.encrypt`
switches ESP from `null-sha256` to AES-GCM. The shared `l2mesh/as211024.key` PSK is expanded into
`/run/l2mesh.secrets` when `ipsec` starts.
### ESP throughput
ESP is the mesh's throughput limit rather than VXLAN — encapsulation is close to free, and on a
small box the crypto is what costs. The kernel processes a single SA on a single core, so per-peer
throughput is capped by one core however many the box has. That limit binds per peer rather than
per box, so a router spreads naturally across its peers.
Two things follow for configuration:
- The `esp4_offload` / `esp6_offload` modules provide GSO/GRO batching for ESP and are **not**
autoloaded when an SA is created. The [`l2mesh` module](../nixos/modules/l2mesh.nix) loads the
one matching each secured mesh's underlay family; without them throughput is around a third
lower, for more CPU.
- `security.encrypt = false` does not save CPU on hardware with AES-NI — it measured slower than
AES-GCM. GCM resolves to a single fused accelerated implementation, while the authenticate-only
path falls back to a generic `authenc(hmac(sha256),ecb(cipher_null))` composition.
#### NIC crypto offload
No mesh uses it, and the `esp4_offload` / `esp6_offload` modules above are unrelated to it — those
are software GSO/GRO batching. Hardware ESP offload is a separate XFRM feature that Libreswan only
requests for connections setting `nic-offload=yes`, which the
[`l2mesh` module](../nixos/modules/l2mesh.nix) does not.
[`portcullis`](sites/colony/portcullis.md)'s 82599ES ports advertise `esp-hw-offload` and the
offload does work, but not for anything the meshes could use. Measured on the box by installing
SAs directly with `ip xfrm` and watching `ixgbe`'s `tx_ipsec` counter:
| SA | Result |
|---|---|
| `et10g-0`, transport, AES-GCM-128 | offload active — `mode crypto` against the physical port |
| `et10g-0`, transport, AES-GCM-256 | rejected: *"IPsec hw offload only supports keys up to 128 bits with a 32 bit salt"* |
| `et10g-0`, **tunnel** mode | rejected: *"Unsupported mode for ipsec offload"* |
| `lan-hi` (a VLAN on `et10g-0`) | **accepted with the offload silently dropped** — software crypto |
| `et2g5-0` (I226-V) | accepted, offload silently dropped — `igc` has none |
Two traps are worth knowing. Binding an SA to a device that cannot offload is **not** an error:
`xfrm_dev_state_add` returns success having cleared the device, so the SA looks fine and quietly
runs in software. And a VLAN interface never offloads — it carries no `xfrmdev_ops`, and
`esp-hw-offload` reads `off [fixed]` on it even when its parent supports the feature.
The second trap is the decisive one here. Even with the offload genuinely active against
`et10g-0`, driving traffic through the SA left `tx_ipsec` at zero, because the packets egress
`lan-hi` and the kernel only offloads when the SA's device matches the egress device. Every address
`portcullis` holds is on a VLAN, so an SA would have to be bound to an untagged physical port to
see the hardware at all.
So adopting it would mean dropping to a 128-bit key to suit one NIC family, keeping the underlay
off VLANs, and forgoing `udpEncapsulation` — `xfrm_dev_offload_ok` refuses any SA carrying
`encap`. That is not a trade worth making for a mesh that has to run across boxes with no offload
at all.
#### pcrypt
`pcrypt` parallelises an SA's crypto across cores via padata and does lift the per-SA ceiling. It
is not enabled on any box here, and is recorded as an option rather than a recommendation:
- It cannot be named in the SA — `ip xfrm` and the kernel both validate AEAD names against a fixed
list. It is engaged instead by registering a `pcrypt(...)`-wrapped instance under the standard
algorithm name at a higher priority, over `NETLINK_CRYPTO` (`CONFIG_CRYPTO_USER`). `crconf` is
the usual tool for that and is not packaged in nixpkgs.
- The registration is global: it redirects every user of that algorithm on the box, not just the
mesh, and would have to run before `ipsec` starts.
- A single-threaded submit path remains, so it does not scale with core count, and it trades
latency and packet ordering for throughput.
### Overlay addressing
The overlay uses `10.100.50.0/24` / `2a0e:97c0:4df::/64`. Each router holds `10.100.50.<n>`:
`estuary` `.1`, `river` `.2`, `stream` `.3`, and `britway` `.5`. Interface MTU is calculated from
the physical MTU minus VXLAN/UDP/IPsec overhead.
### Routing
The home routers route colony prefixes via `estuary` and Tailscale prefixes via `britway`;
`estuary` and `britway` route home prefixes through the `10.100.50.4` VIP. The home IPv6 default
route also crosses the mesh through `britway`, which is why the recursor pins its upstreams to IPv4
as noted in [`routing-common/dns.nix`](../nixos/boxes/home/routing-common/dns.nix). The `nftTrust`
snippet in `lib.my.c.as211024` admits trusted colony, home, mesh and Tailscale prefixes at the edge
firewalls.
## BGP
Both edge routers run `bird2` as AS211024.
### RIPE routing policy and peering records
Maintain the routing policy in the RIPE `aut-num` object for AS211024, keeping peers grouped
under the existing upstream, direct-peering and IXP remarks. Keep plain `import` / `export`
attributes for IPv4 unicast and add `mp-import` / `mp-export` with `afi ipv6.unicast` for IPv6.
For example, when the same policy applies to both families:
```rpsl
import: from AS56393 accept AS-FRYS-IX-CONNECTED
export: to AS56393 announce AS211024:AS-DEVPLAYER0
mp-import: afi ipv6.unicast from AS56393 accept AS-FRYS-IX-CONNECTED
mp-export: afi ipv6.unicast to AS56393 announce AS211024:AS-DEVPLAYER0
```
`mp-*` means multiprotocol and can describe one or several address families. Keeping the IPv4
policy in the original attributes preserves compatibility with older or custom readers that
ignore `mp-*`, without overlapping the two policies. Use only the IPv6 pair for IPv6-only
peering. Address families describe the routes exchanged, independently of the BGP session's
transport address. See [RFC 4012](https://www.rfc-editor.org/rfc/rfc4012.html#section-2).
To update the policy, find `AS211024` in the [RIPE Database](https://apps.db.ripe.net/db-web-ui/query),
select **Update**, authenticate through `devplayer0-mnt`, add the entries under the appropriate
remarks and submit. Check the success response and query the object again to confirm the result.
These registry entries document policy; they do not configure BIRD.
For a new peering, also check the prefix authorisations and connection records:
- **IRR:** `AS211024:AS-DEVPLAYER0` lists the originating ASNs; `route` / `route6` objects associate
announced prefixes with their origin ASN. Prefix-filter generators can expand the AS-set and
route objects independently of the `aut-num` import/export policy.
- **RPKI:** ROAs authorise AS211024 to originate the announced prefixes and lengths. Existing
correct ROAs and route objects need no change just because a new IXP is added; the route-server
ASN does not become the origin. The assigned peering-LAN address is an interface address, not
a prefix to originate or create a ROA for.
- **PeeringDB:** record the exchange connection and assigned peering addresses.
- **BGP:** verify that both route servers accept and propagate the intended exports, as well as
establishing sessions.
### `estuary`
The colony edge takes a full table from ColoClue, IPv6 transit from iFog and Hurricane Electric,
and peers through the Clue-IX, Frys-IX, NL-ix and FogIXP route servers. It also has direct and monitoring
sessions; the complete peer table and originated routes live in [estuary.md](sites/colony/estuary.md#bgp).
### `britway`
The London edge uses secret-backed MD5 authentication for Vultr transit (AS64515), connects to
`bgp.tools`, and originates the internal, colony and home IPv6 prefixes. See
[britway.md](remote/britway.md) for its box-specific routing detail.
## WireGuard point-to-point tunnels
Separate from the mesh, a few boxes run their own WireGuard (private keys in per-box secrets):
- **estuary** terminates point-to-point tunnels to `kelder`, `hillcrest` and `john-valorant`,
addressed out of `p2pTunnels` — see
[estuary.md](sites/colony/estuary.md#wireguard-tunnels) for the per-tunnel ports and prefixes.
- **`qclk`** (container on `shill`) runs its own WireGuard on port 51821 out of `10.100.4.0/24`
— see [qclk.md](sites/colony/shill/containers/qclk.md).
- **`britnet`** hosts a road-warrior WireGuard VPN on port 51820 serving `10.200.0.0/24` /
`fdfb:5ebf:6e84::/64` — see [britnet.md](remote/britnet.md).
## Tailscale / headscale
Tailscale runs against a self-hosted **headscale** control plane on britway at `https://hs.nul.ie`
(OIDC, MagicDNS, split DNS — see [britway.md](remote/britway.md)). The tailnet prefixes are
`100.64.0.0/10` / `fd7a:115c:a1e0::/48`.
Notable nodes:
- **waffletail** (container on `shill`) — the colony subnet router: advertises the colony
prefixes, acts as an exit node, and SNATs tailnet traffic into the colony networks.
- **britway** — advertises the home prefixes (routed via the mesh) and is also an exit node.
- Other boxes join with the shared `tailscale-auth.key` auth-key secret.
+229
View File
@@ -0,0 +1,229 @@
# Upgrading nixpkgs
Procedure for the periodic upgrade of all four nixpkgs channels (`unstable`, `stable`, `mine`,
`mine-stable`) and home-manager. Written to be followed by a person or any coding agent; a
shared agent-skill entry point exists at `.agents/skills/upgrade-nixpkgs/`, but the steps below are
the canonical source.
The upgrade is **guided, not automated**: do the mechanical and investigative steps, but stop at
the judgment points (marked ⏸) — pushing the fork, resolving rebase conflicts, editing the
stable-channel configuration, choosing a new release codename, deleting version guards, and
choosing how to handle a service or package that no longer works on its current channel. Report
findings and let the maintainer decide.
Work the phases in order; skip one only if explicitly scoped to a subset.
## Progress document
Maintain `docs/nixpkgs-upgrade-progress.md` in the upgrade workspace. It is a working record, not
part of the upgrade's history: keep it in the topmost working-copy change, out of the commits that
make up the upgrade series, and delete it at [wrap-up](#wrap-up). At the start, record the baseline
revision, target channels, and scope. On resume, read it first and verify its revisions and
completed steps against the working copy, lockfile, and remote refs.
Update the document as each phase finishes and before a push, commit, or handoff. Include the
reviewed revision or version ranges, links to changelogs or commits, the practical effect on this
repo, and any unreviewed items. Record the decisions made and pending, including alternatives,
the rationale for a fix or workaround, and the condition for removing a temporary pin or
mitigation. Mark inherited choices separately from maintainer approvals. Record validation results
against the candidate revisions and leave a concrete next step for any outstanding work.
## Setup facts
- **Fork checkout** defaults to `../nixpkgs` relative to this flake's root. Verify `origin` points
to the `devplayer0/nixpkgs` fork and `upstream` to `NixOS/nixpkgs`. Ask for the location if needed.
- **Fork branches:** `devplayer0` (tracks `nixos-unstable`) and `devplayer0-stable` (tracks the
current NixOS stable). Each is a small stack of local patches rebased onto upstream.
- **Flake pins** in `flake.nix` (`inputs`):
- `nixpkgs-unstable.url = "nixpkgs/nixos-unstable"`
- `nixpkgs-stable.url = "nixpkgs/nixos-<STABLE>"` (e.g. `nixos-26.05`)
- `nixpkgs-mine.url = "github:devplayer0/nixpkgs/devplayer0"`
- `nixpkgs-mine-stable.url = "github:devplayer0/nixpkgs/devplayer0-stable"`
- `home-manager-unstable.url = "home-manager"`
- `home-manager-stable.url = "home-manager/release-<STABLE>"`
- **Devshell commands:** `update-nixpkgs` = `nix flake update nixpkgs-{unstable,stable,mine,mine-stable}`;
`update-home-manager` = `nix flake update home-manager-{unstable,stable}`.
- **Validation:** prefer `check-system <host>` while iterating and reserve the flake check for final validation.
## Phase 1 — Determine the current NixOS stable
Do this first: everything downstream (the fork's `devplayer0-stable` rebase target, the `flake.nix`
stable pins) has to agree on one NixOS stable release, so establish it up front.
1. Check the [NixOS stable release notes](https://nixos.org/manual/nixos/stable/release-notes.html)
and the release schedule. A `release-YY.NN` branch can exist during stabilization before that
release becomes the published stable channel.
2. Compare it to `<STABLE>` in the `flake.nix` `nixpkgs-stable` / `home-manager-stable` URLs.
3. **If they already match** (no new stable): note "stable is current" and carry `<STABLE>` into the
later phases.
4. ⏸ **If a newer stable has cut:** stop and report the coordinated change set before proceeding —
the pieces must all move to the same release together:
- Rebase `devplayer0-stable` onto the new `upstream/release-YY.NN` (Phase 2 uses this target).
- Edit `flake.nix`: `nixpkgs-stable.url` and `home-manager-stable.url` → the new release.
- Choose a new `lib/default.nix` `versionOverlay` codename (Phase 4 updates it).
- Bump each system's `stateVersion` / `home.stateVersion` only if the maintainer explicitly
wants to — that is a separate, deliberate decision; never auto-bump.
Don't edit `flake.nix` here without confirmation.
## Phase 2 — Rebase the nixpkgs fork
For **both** branches — `devplayer0` onto `upstream/nixos-unstable`, and `devplayer0-stable` onto
`upstream/release-<STABLE>` (the release established in Phase 1):
1. In the fork checkout, confirm a clean working tree (`git status`). If dirty, stop
and report — don't stash silently.
2. Fetch the branches explicitly. Some fork checkouts fetch only `master` from `upstream` by default.
Set `stable` to the release established in Phase 1.
```sh
git fetch upstream \
+refs/heads/master:refs/remotes/upstream/master \
+refs/heads/nixos-unstable:refs/remotes/upstream/nixos-unstable \
"+refs/heads/release-${stable}:refs/remotes/upstream/release-${stable}" \
"+refs/heads/nixos-${stable}:refs/remotes/upstream/nixos-${stable}"
git fetch origin --prune
```
The `release-${stable}` branch is the stable fork's rebase base. The published `nixos-${stable}`
branch is the source for the stock stable flake input and can lag behind it.
3. Enumerate the patch stack before rebasing:
`git log --oneline upstream/nixos-unstable..origin/devplayer0` (and the stable equivalent
against `upstream/release-<STABLE>`). For each commit, check whether it has landed upstream or
been superseded — e.g. `git log --oneline upstream/nixos-unstable -- <path>` or grep the
upstream tree for the package/option. Note any patch that now looks redundant.
4. Rebase: `git switch devplayer0 && git rebase upstream/nixos-unstable` (and the stable branch
onto `upstream/release-<STABLE>`).
- ⏸ **Conflicts:** stop. Report which patch conflicts and against what upstream change; let the
maintainer resolve, or drop the patch if it has been upstreamed.
- Clean rebase: continue.
5. If the upgrade includes requested upstream fixes, verify them on each new base. Cherry-pick
only where the fix is missing and use `git cherry-pick -x` to record the source commit. Check the
resulting package versions or patches on both fork branches and on the published channels.
6. Run `git range-diff <old-base>..<old-tip> <new-base>..<new-tip>` for both branches. Use the
fork's previous upstream bases for the old ranges. Present the comparison before asking to push,
identifying unchanged, modified, dropped, and added patches. For dropped or modified patches,
give the reason and cite the superseding upstream commit when applicable.
7. ⏸ **Push:** only after confirmation. `git push --force-with-lease origin devplayer0
devplayer0-stable` (force needed — rebase rewrites history).
8. Wait for the GitHub mirror used by the flake inputs to catch up with the primary fork remote.
Compare the local branch tips with
`git ls-remote https://github.com/devplayer0/nixpkgs.git refs/heads/devplayer0
refs/heads/devplayer0-stable` and do not continue until both match. Updating sooner can leave
`nixpkgs-mine` and `nixpkgs-mine-stable` pinned to the pre-rebase commits even though the push
succeeded.
## Phase 3 — Update nixpkgs and home-manager pins and review compatibility
Run together (they move as a set):
```
update-nixpkgs
update-home-manager
```
Then show the `flake.lock` diff for the nixpkgs/home-manager entries so the old→new revisions are
visible.
Review the NixOS and home-manager modules and packages used by this repo against the previous and
candidate pins for their assigned channels. Use release notes and version and option changes to
identify removals, end-of-life versions, major upgrades, and changed defaults. Include packages
selected by service modules and local overrides. Prioritize stateful services and check upstream
migration notes for data formats, supported upgrade paths, extensions, and client compatibility.
Record the affected boxes, versions, and any action needed before switching. Surface changes that
could break a running app even if its configuration evaluates and builds.
⏸ Discuss channel moves or migrations with the maintainer before editing the affected service.
Use the compatibility decision in Phase 7 for any blockers found here.
## Phase 4 — Refresh kernels and release metadata
Update the repository values that deliberately move with nixpkgs upgrades:
1. In `lib/constants.nix`, inspect the kernel attributes available from the refreshed nixpkgs pins
and update both explicit selections:
- `kernel.lts` → the newest upstream long-term-support kernel carried by nixpkgs.
- `kernel.latest` → the newest kernel series carried by nixpkgs.
Keep explicit `pkgs.linuxKernel.packages.linux_X_Y` attributes rather than replacing them with
moving aliases. Confirm both attributes exist in the unstable and stable package sets used by
the boxes; if the newest choice is unavailable on stable, report that instead of breaking the
shared constant.
2. In `lib/default.nix`, update the `versionOverlay` values:
- Set the leading `YY.MM` in `trivial.release` to the current year and month. Preserve the
`:u-${prev.trivial.release}` suffix.
- If Phase 1 found a new NixOS stable release, ⏸ ask the maintainer to choose or approve a new
`trivial.codeName`, then update it as part of the coordinated stable bump. Otherwise retain the
existing codename.
Show these edits alongside the input changes in the upgrade summary.
## Phase 5 — Sweep version-gated behavior
The repo carries branch-conditional logic and TODOs keyed to specific nixpkgs versions; some become
removable after an upgrade, especially after a stable bump. Surface them:
```
grep -rn "versionAtLeast\|versionOlder\|when 2[0-9]\.[0-9][0-9]\|TODO.*2[0-9]\.[0-9][0-9]" \
--include=*.nix nixos home-manager lib pkgs flake.nix
```
Known example: `nixos/modules/common.nix` carries a `# TODO: Remove if-else when 26.11 releases`
guard. For each hit, evaluate whether the now-current versions make the guard removable and list
candidates. ⏸ Don't delete guards without confirmation — some protect the still-supported stable.
## Phase 6 — Review remaining flake inputs
Don't blanket-update. Walk the other inputs deliberately:
1. List all direct inputs with their locked revisions and configured refs. Include fixed release
tags, fork branches, and non-GitHub inputs. Identify which inputs already follow one of the
refreshed nixpkgs pins and which carry independent pins.
2. Compare each locked revision with the candidate revision on the configured branch or release
track. Review the intervening changelog, release notes, advisories, and changes to the interfaces
this repo uses. Summarize relevant fixes, breaking changes, and required configuration or build
changes. Report any comparison you could not complete.
3. Refresh the moving inputs and applicable release pins in the main upgrade with targeted
`nix flake update <input>` commands. Verify the resulting lock revisions against the reviewed
candidates, especially if the fetcher used cached refs. ⏸ Ask before switching release tracks,
changing an intentional compatibility pin, or deferring an update that needs a migration.
## Phase 7 — Validate
1. `nix flake check --no-build` for broad validation. If `.#ciIfdReasons.x86_64-linux` lists
an active exception, use `nix flake check` so evaluation can build the required inputs.
2. `check-system <host>` on a representative box, and one exercising the stable channel if the
boxes mix channels. This must exercise the refreshed kernel constants on both channels.
3. Build the actual devshell with
`nix build --no-link --print-out-paths .#devShells.x86_64-linux.default`. Evaluation does not
build its dependencies, so it cannot catch packaging conflicts introduced by inputs such as
Determinate Nix.
4. After the evaluations pass, run `build-system <host>` for one representative NixOS box. Prefer
the local box when it is managed by this flake: its full closure is likely to exercise the most
relevant packages, home-manager configuration and upgraded kernel. Build only; do not switch.
5. Fix mechanical compatibility errors that preserve service behavior. ⏸ If a package was removed,
reached end of life, or needs a major upgrade, explain the choices before editing the affected
service. Include the current configured version, the deployed version if verified, and the
available paths, such as a temporary channel move, a migration during this upgrade, or a
separate service change. Describe effects on persisted data, dependent services, cutover, and
rollback where relevant. Ask for a decision for each affected service and continue independent
validation while waiting. If the maintainer chooses a temporary pin, add a TODO beside it naming
the deferred migration and the condition for removing the pin.
6. Report eval/build results and any blockers. A build confirms that the configuration compiles.
Confirm the migration prerequisites separately before deployment.
## Wrap-up
Present a final summary: fork rebase outcome (patches kept/dropped/conflicted), whether a stable
bump is pending or was applied, kernel and release-metadata changes, the lock diff, version-gate
cleanup candidates, inputs updated, and validation results. Leave committing to the maintainer
unless asked; if committing, follow the repo's `area/scope: Capitalized summary` convention.
Split the series into the procedure or skill changes, the pin and input refresh, and a separate
change for each service migration done during the upgrade. The refresh's description lists the
notable upgrades: kernels, stateful services that migrate data, other major version moves and
significant flake input releases, with old and new versions. This keeps the version history
readable in `jj log` after the progress document is gone.
Once the upgrade is deployed, move anything still open in the progress document to its durable
home: a TODO beside the pin or workaround it concerns, the affected box page, or a commit
message for a decision worth keeping. Then delete the progress document. The next upgrade starts
from those TODOs and pages rather than from an old progress document.
+105
View File
@@ -0,0 +1,105 @@
# Flashing an OpenWrt box
The shared agent skill is [`flash-openwrt`](../.agents/skills/flash-openwrt/SKILL.md).
Guided procedure for putting a flake-built OpenWrt image onto a box. The images themselves are
declared in [`openwrt/default.nix`](../openwrt/default.nix) and described in
[`deployment.md`](deployment.md#openwrt-images); the boxes are listed on their site pages (today
that is [fergal](sites/colony/fergal.md)).
Packages are baked into the image, so this runs whenever the package list changes — not only for
version upgrades. Work through the phases in order; ⏸ marks the point to stop and confirm.
## Phase 1 — Build
```sh
nix build .#openwrt-<box>
```
The result holds the `-squashfs-sysupgrade.bin` to flash, plus a `.manifest` listing every package
in the image and an SBOM. Check the manifest for the packages the change was meant to add — an
unknown package name is not an error at build time, it just silently isn't there.
## Phase 2 — Pre-flight
Confirm on the box:
```sh
grep -E 'RELEASE|REVISION' /etc/openwrt_release # what is running now
mount | grep -E ' / | /overlay | /rom ' # flash or RAM? (see below)
uci get network.lan.ipaddr # will it come back reachable?
cat /lib/upgrade/keep.d/* # what survives the flash
df -h /tmp # room for the image
```
**Flash or RAM matters.** A box booted normally shows a squashfs `/rom` plus a jffs2 `/overlay`;
one booted from an initramfs has `/` on tmpfs. The initramfs case has its own hazards — see
[Flashing from an initramfs](sites/colony/fergal.md#flashing-notes).
**Check the address is in UCI**, not just present on the interface. An address added by hand with
`ip` disappears on reboot and the box comes back unreachable.
`keep.d` normally lists `/etc/config/`, `/etc/dropbear/authorized_keys` and the dropbear host keys,
so an ordinary flash preserves both access and identity. Verify rather than assume — losing
`authorized_keys` on a box reachable only over SSH means a serial console recovery.
## Phase 3 — Back up
```sh
sysupgrade -b /tmp/<box>-config-backup.tar.gz
```
Fetch it with `ssh <box> 'cat /tmp/…' > local.tar.gz`. **`scp` does not work** — these boxes have no
`/usr/libexec/sftp-server`, so it fails with `Connection closed`. (`scp -O` forces the legacy
protocol if you prefer it.)
For a box being flashed off its **vendor** firmware for the first time, back up the whole flash
first — the vendor partitions hold per-unit MAC addresses and licence data that cannot be
regenerated. See [fergal's flash layout](sites/colony/fergal.md#flash-layout).
## Phase 4 — Stage and validate
```sh
ssh <box> 'cat > /tmp/sysupgrade.bin' < <image>.bin
ssh <box> 'sha256sum /tmp/sysupgrade.bin; sysupgrade -T /tmp/sysupgrade.bin'
```
Compare the sha256 against the local file, and require `sysupgrade -T` to exit 0. `-T` validates the
image and its device-compatibility metadata without writing anything, which is the last cheap chance
to catch a wrong-profile image.
## Phase 5 — Flash ⏸
Confirm before this point. It reboots the box and is not interruptible.
```sh
ssh <box> 'setsid sh -c "sleep 2; sysupgrade -v /tmp/sysupgrade.bin" \
</dev/null >/tmp/upgrade.log 2>&1 & echo detached'
```
**Detaching matters.** `sysupgrade` kills the SSH session partway through; without `setsid` the
upgrade dies with it, potentially after the flash has been erased. `nohup` is not available on these
boxes' busybox — use `setsid`.
Plain `sysupgrade` keeps the config in `keep.d`. Do not reach for `-c` out of caution: it needs
`/overlay/upper/etc` and aborts *after* erasing the firmware if that is missing.
## Phase 6 — Wait and verify
Poll SSH, not ping. A successful ping returns in milliseconds, so a naive "wait for it to go down"
loop finishes before the box has even started rebooting. Sleep between probes and wait on something
that only succeeds once userspace is up:
```sh
for i in $(seq 1 40); do
sleep 15
ssh -o ConnectTimeout=5 -o BatchMode=yes <box> 'grep REVISION /etc/openwrt_release' && break
done
```
Expect roughly three minutes. Then confirm the revision changed, the management address returned,
the package count matches the manifest, and the new packages are actually present and running.
Connecting without host-key overrides also confirms the host keys survived.
If the box does not return, it needs the serial console — have that confirmed as reachable *before*
Phase 5, not after.
+327
View File
@@ -0,0 +1,327 @@
# DNS records
The tables on this page are generated from live authoritative zone transfers by
`nix run .#update-docs-dns -- <zones...>`; CI keeps them current. The Nix DNS configuration is
the source of truth. Edit the prose and headings here, but not content between the DNS markers.
DHCP-managed records are excluded. The generator identifies them by `DHCID` and removes the
corresponding forward and reverse records. SOA records and TTLs are also omitted because they are
operational metadata rather than useful inventory.
## Colony
These zones are served by [`estuary`](../sites/colony/estuary.md); their source configuration is
[`estuary/dns.nix`](../../nixos/boxes/colony/vms/estuary/dns.nix).
### Forward zone: `ams1.int.nul.ie`
<!-- dns: ams1.int.nul.ie -->
<!-- dns-start -->
| Name | Type | Value |
|---|---|---|
| `@` | `ALIAS` | `estuary-vm.ams1.int.nul.ie.` |
| `@` | `NS` | `ns.ams1.int.nul.ie.` |
| `_acme-challenge` | `TXT (LUA)` | `generated at query time` |
| `andrey-cust` | `A` | `94.142.242.254` |
| `chatterbox-ctr` | `A` | `10.100.2.5` |
| `chatterbox-ctr` | `AAAA` | `2a0e:97c0:4d2:12::5` |
| `colony` | `A` | `94.142.241.224` |
| `colony` | `AAAA` | `2a0e:97c0:4d2:10::2` |
| `colony-psql` | `CNAME` | `colony-psql-ctr.ams1.int.nul.ie.` |
| `colony-psql-ctr` | `A` | `10.100.2.4` |
| `colony-psql-ctr` | `AAAA` | `2a0e:97c0:4d2:12::4` |
| `colony-routing` | `A` | `10.100.0.2` |
| `colony-vms` | `A` | `10.100.1.1` |
| `colony-vms` | `AAAA` | `2a0e:97c0:4d2:11::1` |
| `ctr` | `CNAME` | `shill-vm.ams1.int.nul.ie.` |
| `darts-cust` | `A` | `94.142.242.255` |
| `darts-cust` | `AAAA` | `2a0e:97c0:4d2:2001::1` |
| `enshrouded` | `A` | `94.142.240.44` |
| `enshrouded-oci` | `A` | `10.100.3.5` |
| `enshrouded-oci` | `AAAA` | `2a0e:97c0:4d2:13::5` |
| `estuary-vm` | `A` | `94.142.240.44` |
| `estuary-vm` | `AAAA` | `2a02:898:0:20::329:1` |
| `estuary-vm-base` | `A` | `10.100.0.1` |
| `estuary-vm-base` | `AAAA` | `2a0e:97c0:4d2:10::1` |
| `fw` | `CNAME` | `estuary-vm.ams1.int.nul.ie.` |
| `gam-ctr` | `A` | `10.100.2.11` |
| `gam-ctr` | `AAAA` | `2a0e:97c0:4d2:12::b` |
| `git-vm` | `A` | `94.142.241.117` |
| `git-vm` | `AAAA` | `2a0e:97c0:4d2:11::4` |
| `git-vm-routing` | `A` | `10.100.1.4` |
| `graeme` | `A` | `94.142.240.44` |
| `graeme` | `AAAA` | `2a0e:97c0:4d2:13::8` |
| `graeme-oci` | `A` | `10.100.3.8` |
| `graeme-oci` | `AAAA` | `2a0e:97c0:4d2:13::8` |
| `hillcrest-tun` | `A` | `10.100.5.2` |
| `http` | `A` | `94.142.240.44` |
| `http` | `AAAA` | `2a0e:97c0:4d2:12::2` |
| `jackflix-ctr` | `A` | `10.100.2.6` |
| `jackflix-ctr` | `AAAA` | `2a0e:97c0:4d2:12::6` |
| `jam-cust` | `A` | `10.100.100.4` |
| `jam-cust` | `AAAA` | `2a0e:97c0:4d2:2002::1` |
| `jam-fwd` | `A` | `94.142.241.225` |
| `john-valorant-tun` | `A` | `10.100.5.6` |
| `kevcraft` | `A` | `94.142.240.44` |
| `kevcraft` | `AAAA` | `2a0e:97c0:4d2:13::6` |
| `kevcraft-oci` | `A` | `10.100.3.6` |
| `kevcraft-oci` | `AAAA` | `2a0e:97c0:4d2:13::6` |
| `kinkcraft` | `A` | `94.142.240.44` |
| `kinkcraft` | `AAAA` | `2a0e:97c0:4d2:13::7` |
| `kinkcraft-oci` | `A` | `10.100.3.7` |
| `kinkcraft-oci` | `AAAA` | `2a0e:97c0:4d2:13::7` |
| `librespeed` | `CNAME` | `http.ams1.int.nul.ie.` |
| `mail-vm` | `A` | `94.142.241.227` |
| `mail-vm` | `AAAA` | `2a0e:97c0:4d2:2000::1` |
| `middleman-ctr` | `A` | `10.100.2.2` |
| `middleman-ctr` | `AAAA` | `2a0e:97c0:4d2:12::2` |
| `ns` | `ALIAS` | `estuary-vm.ams1.int.nul.ie.` |
| `object-ctr` | `A` | `10.100.2.7` |
| `object-ctr` | `AAAA` | `2a0e:97c0:4d2:12::7` |
| `oci` | `CNAME` | `whale-vm.ams1.int.nul.ie.` |
| `qclk-ctr` | `A` | `10.100.2.10` |
| `qclk-ctr` | `AAAA` | `2a0e:97c0:4d2:12::a` |
| `shill-vm` | `A` | `94.142.241.225` |
| `shill-vm` | `AAAA` | `2a0e:97c0:4d2:11::2` |
| `shill-vm-ctrs` | `A` | `10.100.2.1` |
| `shill-vm-ctrs` | `AAAA` | `2a0e:97c0:4d2:12::1` |
| `shill-vm-routing` | `A` | `10.100.1.2` |
| `simpcraft` | `A` | `94.142.240.44` |
| `simpcraft` | `AAAA` | `2a0e:97c0:4d2:13::3` |
| `simpcraft-oci` | `A` | `10.100.3.3` |
| `simpcraft-oci` | `AAAA` | `2a0e:97c0:4d2:13::3` |
| `simpcraft-staging` | `A` | `94.142.240.44` |
| `simpcraft-staging` | `AAAA` | `2a0e:97c0:4d2:13::4` |
| `simpcraft-staging-oci` | `A` | `10.100.3.4` |
| `simpcraft-staging-oci` | `AAAA` | `2a0e:97c0:4d2:13::4` |
| `terraria` | `A` | `94.142.240.44` |
| `terraria` | `AAAA` | `2a0e:97c0:4d2:12::b` |
| `toot-ctr` | `A` | `10.100.2.8` |
| `toot-ctr` | `AAAA` | `2a0e:97c0:4d2:12::8` |
| `valheim` | `A` | `94.142.240.44` |
| `valheim` | `AAAA` | `2a0e:97c0:4d2:13::2` |
| `valheim-oci` | `A` | `10.100.3.2` |
| `valheim-oci` | `AAAA` | `2a0e:97c0:4d2:13::2` |
| `vaultwarden-ctr` | `A` | `10.100.2.3` |
| `vaultwarden-ctr` | `AAAA` | `2a0e:97c0:4d2:12::3` |
| `vm` | `CNAME` | `colony.ams1.int.nul.ie.` |
| `waffletail-ctr` | `A` | `10.100.2.9` |
| `waffletail-ctr` | `AAAA` | `2a0e:97c0:4d2:12::9` |
| `whale-vm` | `A` | `94.142.241.226` |
| `whale-vm` | `AAAA` | `2a0e:97c0:4d2:11::3` |
| `whale-vm-routing` | `A` | `10.100.1.3` |
<!-- dns-end -->
### IPv4 reverse zone: `100.10.in-addr.arpa`
<!-- dns: 100.10.in-addr.arpa -->
<!-- dns-start -->
| Address | Name |
|---|---|
| `10.100.0.1` | `estuary-vm-base.ams1.int.nul.ie.` |
| `10.100.0.2` | `colony-routing.ams1.int.nul.ie.` |
| `10.100.1.1` | `colony-vms.ams1.int.nul.ie.` |
| `10.100.1.2` | `shill-vm-routing.ams1.int.nul.ie.` |
| `10.100.1.3` | `whale-vm-routing.ams1.int.nul.ie.` |
| `10.100.1.4` | `git-vm-routing.ams1.int.nul.ie.` |
| `10.100.2.1` | `shill-vm-ctrs.ams1.int.nul.ie.` |
| `10.100.2.2` | `middleman-ctr.ams1.int.nul.ie.` |
| `10.100.2.3` | `vaultwarden-ctr.ams1.int.nul.ie.` |
| `10.100.2.4` | `colony-psql-ctr.ams1.int.nul.ie.` |
| `10.100.2.5` | `chatterbox-ctr.ams1.int.nul.ie.` |
| `10.100.2.6` | `jackflix-ctr.ams1.int.nul.ie.` |
| `10.100.2.7` | `object-ctr.ams1.int.nul.ie.` |
| `10.100.2.8` | `toot-ctr.ams1.int.nul.ie.` |
| `10.100.2.9` | `waffletail-ctr.ams1.int.nul.ie.` |
| `10.100.2.10` | `qclk-ctr.ams1.int.nul.ie.` |
| `10.100.2.11` | `gam-ctr.ams1.int.nul.ie.` |
| `10.100.3.2` | `valheim-oci.ams1.int.nul.ie.` |
| `10.100.3.3` | `simpcraft-oci.ams1.int.nul.ie.` |
| `10.100.3.4` | `simpcraft-staging-oci.ams1.int.nul.ie.` |
| `10.100.3.5` | `enshrouded-oci.ams1.int.nul.ie.` |
| `10.100.3.6` | `kevcraft-oci.ams1.int.nul.ie.` |
| `10.100.3.7` | `kinkcraft-oci.ams1.int.nul.ie.` |
| `10.100.3.8` | `graeme-oci.ams1.int.nul.ie.` |
<!-- dns-end -->
### IPv6 reverse zone: `2.d.4.0.0.c.7.9.e.0.a.2.ip6.arpa`
<!-- dns: 2.d.4.0.0.c.7.9.e.0.a.2.ip6.arpa -->
<!-- dns-start -->
| Address | Name |
|---|---|
| `2a0e:97c0:4d2:10::1` | `estuary-vm-base.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:10::2` | `colony.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:11::1` | `colony-vms.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:11::2` | `shill-vm.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:11::3` | `whale-vm.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:11::4` | `git-vm.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::1` | `shill-vm-ctrs.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::2` | `middleman-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::3` | `vaultwarden-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::4` | `colony-psql-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::5` | `chatterbox-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::6` | `jackflix-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::7` | `object-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::8` | `toot-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::9` | `waffletail-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::a` | `qclk-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:12::b` | `gam-ctr.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:13::2` | `valheim-oci.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:13::3` | `simpcraft-oci.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:13::4` | `simpcraft-staging-oci.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:13::5` | `enshrouded-oci.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:13::6` | `kevcraft-oci.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:13::7` | `kinkcraft-oci.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:13::8` | `graeme-oci.ams1.int.nul.ie.` |
| `2a0e:97c0:4d2:2000::1` | `mail.nul.ie.` |
| `2a0e:97c0:4d2:2001::1` | `darts-cust.ams1.int.nul.ie.` |
<!-- dns-end -->
## Home
These zones are served by [`river`](../sites/home/river.md) and
[`stream`](../sites/home/stream.md); their shared source configuration is
[`routing-common/dns.nix`](../../nixos/boxes/home/routing-common/dns.nix).
### Forward zone: `h.nul.ie`
<!-- dns: h.nul.ie -->
<!-- dns-start -->
| Name | Type | Value |
|---|---|---|
| `@` | `NS` | `ns1.h.nul.ie.` |
| `@` | `NS` | `ns2.h.nul.ie.` |
| `boot` | `CNAME` | `river-hi.h.nul.ie.` |
| `brian` | `A` | `192.168.64.13` |
| `castle` | `A` | `192.168.68.40` |
| `castle` | `AAAA` | `2a0e:97c0:4d0:1::3:1` |
| `cellar` | `A` | `192.168.68.80` |
| `cellar` | `AAAA` | `2a0e:97c0:4d0:1::4:1` |
| `dave` | `A` | `192.168.68.11` |
| `dave` | `AAAA` | `2a0e:97c0:4d0:1::1:2` |
| `dave-core` | `A` | `192.168.64.11` |
| `dave-lo` | `A` | `192.168.72.11` |
| `dave-lo` | `AAAA` | `2a0e:97c0:4d0:2::1:2` |
| `dyn` | `NS` | `ns1.dyn.h.nul.ie.` |
| `dyn` | `NS` | `ns2.dyn.h.nul.ie.` |
| `frigate` | `CNAME` | `hass-ctr.h.nul.ie.` |
| `hass-ctr` | `A` | `192.168.68.103` |
| `hass-ctr` | `AAAA` | `2a0e:97c0:4d0:1::5:3` |
| `hass-ctr-lo` | `A` | `192.168.72.103` |
| `hass-ctr-lo` | `AAAA` | `2a0e:97c0:4d0:2::5:3` |
| `jim` | `A` | `192.168.68.10` |
| `jim` | `AAAA` | `2a0e:97c0:4d0:1::1:1` |
| `jim-core` | `A` | `192.168.64.10` |
| `jim-lo` | `A` | `192.168.72.10` |
| `jim-lo` | `AAAA` | `2a0e:97c0:4d0:2::1:1` |
| `nixlight` | `A` | `192.168.72.46` |
| `ns1` | `ALIAS` | `river.h.nul.ie.` |
| `ns1.dyn` | `ALIAS` | `river.h.nul.ie.` |
| `ns2` | `ALIAS` | `stream.h.nul.ie.` |
| `ns2.dyn` | `ALIAS` | `stream.h.nul.ie.` |
| `palace` | `A` | `192.168.68.22` |
| `palace` | `AAAA` | `2a0e:97c0:4d0:1::2:1` |
| `palace-core` | `A` | `192.168.64.20` |
| `palace-kvm` | `A` | `192.168.72.21` |
| `portcullis` | `A` | `192.168.68.41` |
| `portcullis` | `AAAA` | `2a0e:97c0:4d0:1::6:1` |
| `reolink-living-room` | `A` | `192.168.72.45` |
| `river` | `A (LUA)` | `generated at query time` |
| `river` | `AAAA` | `2a0e:97c0:4df:0:1::1` |
| `river-core` | `A` | `192.168.64.1` |
| `river-hi` | `A` | `192.168.68.1` |
| `river-hi` | `AAAA` | `2a0e:97c0:4d0:1::1` |
| `river-lo` | `A` | `192.168.72.1` |
| `river-lo` | `AAAA` | `2a0e:97c0:4d0:2::1` |
| `river-ut` | `A` | `192.168.80.1` |
| `river-ut` | `AAAA` | `2a0e:97c0:4d0:3::1` |
| `router-hi` | `A` | `192.168.71.254` |
| `router-hi` | `AAAA` | `2a0e:97c0:4d0:1::ffff` |
| `router-lo` | `A` | `192.168.79.254` |
| `router-lo` | `AAAA` | `2a0e:97c0:4d0:2::ffff` |
| `router-ut` | `A` | `192.168.80.254` |
| `router-ut` | `AAAA` | `2a0e:97c0:4d0:3::ffff` |
| `sfh` | `A` | `192.168.68.81` |
| `sfh` | `AAAA` | `2a0e:97c0:4d0:1::4:2` |
| `shytzel` | `A` | `192.168.64.12` |
| `slop-cannon` | `A` | `192.168.80.5` |
| `slop-cannon` | `AAAA` | `2a0e:97c0:4d0:3::5` |
| `stream` | `A (LUA)` | `generated at query time` |
| `stream` | `AAAA` | `2a0e:97c0:4df:0:1::2` |
| `stream-core` | `A` | `192.168.64.2` |
| `stream-hi` | `A` | `192.168.68.2` |
| `stream-hi` | `AAAA` | `2a0e:97c0:4d0:1::2` |
| `stream-lo` | `A` | `192.168.72.2` |
| `stream-lo` | `AAAA` | `2a0e:97c0:4d0:2::2` |
| `stream-ut` | `A` | `192.168.80.2` |
| `stream-ut` | `AAAA` | `2a0e:97c0:4d0:3::2` |
| `unifi-ctr` | `A` | `192.168.68.100` |
| `unifi-ctr` | `AAAA` | `2a0e:97c0:4d0:1::5:1` |
| `unifi-ctr-core` | `A` | `192.168.64.21` |
| `ups` | `A` | `192.168.72.20` |
| `vibe` | `A` | `192.168.68.15` |
| `vibe` | `AAAA` | `2a0e:97c0:4d0:1::1:6` |
| `vibe-core` | `A` | `192.168.64.15` |
| `vibe-lo` | `A` | `192.168.72.15` |
| `vibe-lo` | `AAAA` | `2a0e:97c0:4d0:2::1:6` |
| `wave` | `A` | `192.168.72.14` |
| `wave` | `AAAA` | `2a0e:97c0:4d0:2::1:5` |
| `wave-core` | `A` | `192.168.64.14` |
<!-- dns-end -->
### IPv4 reverse zone: `168.192.in-addr.arpa`
<!-- dns: 168.192.in-addr.arpa -->
<!-- dns-start -->
| Address | Name |
|---|---|
| `192.168.64.1` | `river-core.h.nul.ie.` |
| `192.168.64.2` | `stream-core.h.nul.ie.` |
| `192.168.64.20` | `palace-core.h.nul.ie.` |
| `192.168.64.21` | `unifi-ctr-core.h.nul.ie.` |
| `192.168.68.1` | `river-hi.h.nul.ie.` |
| `192.168.68.2` | `stream-hi.h.nul.ie.` |
| `192.168.68.22` | `palace.h.nul.ie.` |
| `192.168.68.40` | `castle.h.nul.ie.` |
| `192.168.68.41` | `portcullis.h.nul.ie.` |
| `192.168.68.80` | `cellar.h.nul.ie.` |
| `192.168.68.81` | `sfh.h.nul.ie.` |
| `192.168.68.100` | `unifi-ctr.h.nul.ie.` |
| `192.168.68.103` | `hass-ctr.h.nul.ie.` |
| `192.168.71.254` | `router-hi.h.nul.ie.` |
| `192.168.72.1` | `river-lo.h.nul.ie.` |
| `192.168.72.2` | `stream-lo.h.nul.ie.` |
| `192.168.72.103` | `hass-ctr-lo.h.nul.ie.` |
| `192.168.79.254` | `router-lo.h.nul.ie.` |
| `192.168.80.1` | `river-ut.h.nul.ie.` |
| `192.168.80.2` | `stream-ut.h.nul.ie.` |
| `192.168.80.5` | `slop-cannon.h.nul.ie.` |
| `192.168.80.254` | `router-ut.h.nul.ie.` |
<!-- dns-end -->
### IPv6 reverse zone: `0.d.4.0.0.c.7.9.e.0.a.2.ip6.arpa`
<!-- dns: 0.d.4.0.0.c.7.9.e.0.a.2.ip6.arpa -->
<!-- dns-start -->
| Address | Name |
|---|---|
| `2a0e:97c0:4d0:1::1` | `river-hi.h.nul.ie.` |
| `2a0e:97c0:4d0:1::2` | `stream-hi.h.nul.ie.` |
| `2a0e:97c0:4d0:1::ffff` | `router-hi.h.nul.ie.` |
| `2a0e:97c0:4d0:1::2:1` | `palace.h.nul.ie.` |
| `2a0e:97c0:4d0:1::3:1` | `castle.h.nul.ie.` |
| `2a0e:97c0:4d0:1::4:1` | `cellar.h.nul.ie.` |
| `2a0e:97c0:4d0:1::4:2` | `sfh.h.nul.ie.` |
| `2a0e:97c0:4d0:1::5:1` | `unifi-ctr.h.nul.ie.` |
| `2a0e:97c0:4d0:1::5:3` | `hass-ctr.h.nul.ie.` |
| `2a0e:97c0:4d0:1::6:1` | `portcullis.h.nul.ie.` |
| `2a0e:97c0:4d0:2::1` | `river-lo.h.nul.ie.` |
| `2a0e:97c0:4d0:2::2` | `stream-lo.h.nul.ie.` |
| `2a0e:97c0:4d0:2::ffff` | `router-lo.h.nul.ie.` |
| `2a0e:97c0:4d0:2::5:3` | `hass-ctr-lo.h.nul.ie.` |
| `2a0e:97c0:4d0:3::1` | `river-ut.h.nul.ie.` |
| `2a0e:97c0:4d0:3::2` | `stream-ut.h.nul.ie.` |
| `2a0e:97c0:4d0:3::5` | `slop-cannon.h.nul.ie.` |
| `2a0e:97c0:4d0:3::ffff` | `router-ut.h.nul.ie.` |
<!-- dns-end -->
+297
View File
@@ -0,0 +1,297 @@
# NixOS module options (`my.*`)
> **Generated** from the module option descriptions by `nix run .#update-docs-options`;
> CI keeps it current. The source of truth is the `mkOpt'` / `mkBoolOpt'` declarations in
> `nixos/modules/` — edit those, not this file. For what each module is *for*, see the
> [shared-modules overview](../architecture.md#shared-modules).
## `borgthin` — [`nixos/modules/borgthin.nix`](../../nixos/modules/borgthin.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.borgthin.enable` | boolean | `false` | Whether to enable borgthin jobs |
| `my.borgthin.jobs` | attribute set of (submodule) | `{ }` | borgthin jobs |
| `my.borgthin.jobs.<name>.archivePrefix` | string | `"${config.networking.hostName}-${name}-"` | Prefix to start new archives with |
| `my.borgthin.jobs.<name>.compression` | string | `"zstd,3"` | Compression options |
| `my.borgthin.jobs.<name>.dateFormat` | string | `"+%Y-%m-%dT%H:%M:%S"` | Format passed to the date command |
| `my.borgthin.jobs.<name>.environment` | attribute set of string | `{ }` | Extra environment variables to pass to borg |
| `my.borgthin.jobs.<name>.extraArgs` | list of string | `[ "--iec" ]` | Extra args to pass to all borg commands |
| `my.borgthin.jobs.<name>.extraCreateArgs` | list of string | `[ ]` | Extra args to pass to tcreate command |
| `my.borgthin.jobs.<name>.lvs` | list of string | `null` | Thin LVs to backup (vg/lv format) |
| `my.borgthin.jobs.<name>.passFile` | null or string | `null` | Path to file containing passphrase |
| `my.borgthin.jobs.<name>.prune.keep` | attribute set of (signed integer or string) | `{ }` | Borg pruning params |
| `my.borgthin.jobs.<name>.prune.pattern` | string | `"sh:${config.archivePrefix}*"` | Borg pattern to select archives for pruning |
| `my.borgthin.jobs.<name>.repo` | string | `null` | borg repository URL |
| `my.borgthin.jobs.<name>.timer.at` | string or list of string | `"5:00"` | systemd calendar time(s) to run backup at |
| `my.borgthin.jobs.<name>.timer.persistent` | boolean | `false` | Persistent systemd timer |
| `my.borgthin.lvmPackage` | package | `<derivation lvm2-2.03.41>` | Packge containing LVM tools |
| `my.borgthin.package` | package | `inputs.borgthin.packages.${system}.borgthin` | borgthin package |
| `my.borgthin.thinToolsPackage` | package | `<derivation thin-provisioning-tools-1.3.2>` | Package containing thin-provisioning-tools |
## `build` — [`nixos/modules/build.nix`](../../nixos/modules/build.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.build.allHardware` | boolean | `false` | Whether to enable a lot of firmware and kernel modules for a wide range of hardware.Only applies to some build targets. |
| `my.build.isDevVM` | boolean | `false` | Whether the system is a development VM. |
| `my.buildAs` | open submodule of lazy attribute set of unspecified value | `{ }` | Attribute set of derivations used to set up the system. |
## `common` — [`nixos/modules/common.nix`](../../nixos/modules/common.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.tmproot.persistence.config.users` | attribute set of (submodule) | `{ }` | A set of user submodules listing the files and directories to link to their respective user's home directories. Each attribute name should be the name of the user. For detailed usage, check the [documentation](https://github.com/nix-community/impermanence). |
## `containers` — [`nixos/modules/containers.nix`](../../nixos/modules/containers.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.containers.instances` | attribute set of (submodule) | `{ }` | Individual containers. |
| `my.containers.instances.<name>.autoStart` | boolean | `true` | Whether to start the container automatically at boot. |
| `my.containers.instances.<name>.bindMounts` | attribute set of (submodule) | `{ }` | An extra list of directories that is bound to the container. |
| `my.containers.instances.<name>.bindMounts.<name>.hostPath` | null or string | `"‹name›"` | Location of the host path to be mounted. |
| `my.containers.instances.<name>.bindMounts.<name>.mountPoint` | string | `"‹name›"` | Mount point on the container file system. |
| `my.containers.instances.<name>.bindMounts.<name>.readOnly` | boolean | `true` | Determine whether the mounted path will be accessed in read-only mode. |
| `my.containers.instances.<name>.containerSystem` | absolute path | `"/nix/var/nix/profiles/system"` | Path to NixOS system configuration from within container. |
| `my.containers.instances.<name>.hotReload` | boolean | `true` | Whether to apply new configuration by running `switch-to-configuration` instead of rebooting the container. |
| `my.containers.instances.<name>.networking.bridge` | null or string | `null` | Network bridge to connect to. |
| `my.containers.instances.<name>.networking.macVLAN` | null or string | `null` | Network interface to make MACVLAN interface from. |
| `my.containers.instances.<name>.system` | absolute path | `"/nix/var/nix/profiles/per-container/‹name›/system"` | Path to NixOS system configuration. |
| `my.containers.persistDir` | string | `"/persist/containers"` | Where to store container persistence data. |
## `deploy-rs` — [`nixos/modules/deploy-rs.nix`](../../nixos/modules/deploy-rs.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.deploy.authorizedKeys.keyFiles` | list of absolute path | `[ .keys/deploy.pub ]` | SSH public key files to add to the default deployment user. |
| `my.deploy.authorizedKeys.keys` | list of (optionally newline-terminated) single-line string | `[ ]` | SSH public keys to add to the default deployment user. |
| `my.deploy.enable` | boolean | `true` | Whether to expose deploy-rs configuration for this system. |
| `my.deploy.generate.containers.enable` | boolean | `true` | Whether to generate deploy-rs profiles for this system's containers. |
| `my.deploy.generate.containers.keepGenerations` | unsigned integer, meaning >=0 | `10` | Number of generations to keep when cleaning up old deployments (0 to disable deletion on deployment). |
| `my.deploy.generate.system.enable` | boolean | `true` | Whether to generate a deploy-rs profile for this system's config. |
| `my.deploy.generate.system.keepGenerations` | unsigned integer, meaning >=0 | `10` | Number of generations to keep when cleaning up old deployments (0 to disable deletion on deployment). |
| `my.deploy.generate.system.mode` | string | `"switch"` | switch-to-configuration mode. |
| `my.deploy.node` | submodule | `{ }` | deploy-rs node configuration. |
| `my.deploy.node.autoRollback` | null or boolean | `null` | Whether to roll back the profile if activation fails. |
| `my.deploy.node.confirmTimeout` | null or 16 bit unsigned integer; between 0 and 65535 (both inclusive) | `null` | Timeout for confirming activation succeeded. |
| `my.deploy.node.fastConnection` | null or boolean | `null` | Whether to copy the whole closure instead of using substitution. |
| `my.deploy.node.hostname` | string | `""` | Hostname deploy-rs will connect to. |
| `my.deploy.node.magicRollback` | null or boolean | `null` | Whether to roll back the profile if connectivity to the deployer is lost. |
| `my.deploy.node.profiles` | attribute set of (submodule) | `{ }` | Profiles to deploy. |
| `my.deploy.node.profiles.<name>.autoRollback` | null or boolean | `null` | Whether to roll back the profile if activation fails. |
| `my.deploy.node.profiles.<name>.confirmTimeout` | null or 16 bit unsigned integer; between 0 and 65535 (both inclusive) | `null` | Timeout for confirming activation succeeded. |
| `my.deploy.node.profiles.<name>.fastConnection` | null or boolean | `null` | Whether to copy the whole closure instead of using substitution. |
| `my.deploy.node.profiles.<name>.magicRollback` | null or boolean | `null` | Whether to roll back the profile if connectivity to the deployer is lost. |
| `my.deploy.node.profiles.<name>.path` | package | `""` | Derivation to build (should include activation script). |
| `my.deploy.node.profiles.<name>.profilePath` | null or string | `null` | Path to profile location |
| `my.deploy.node.profiles.<name>.sshOpts` | list of string | `[ ]` | Options deploy-rs will pass to ssh. Note: overriding at a lower level _merges_ options. |
| `my.deploy.node.profiles.<name>.sshUser` | null or string | `null` | Username deploy-rs will deploy with. |
| `my.deploy.node.profiles.<name>.sudo` | null or string | `null` | Command to elevate privileges with (used if the deployment user != profile user). |
| `my.deploy.node.profiles.<name>.tempPath` | null or string | `null` | Path that deploy-rs will use for temporary files. |
| `my.deploy.node.profiles.<name>.user` | null or string | `null` | Username deploy-rs will deploy with. |
| `my.deploy.node.profilesOrder` | null or (list of string) | `null` | Order to deploy profiles in (remainder will be deployed in arbitrary order). |
| `my.deploy.node.sshOpts` | list of string | `[ ]` | Options deploy-rs will pass to ssh. Note: overriding at a lower level _merges_ options. |
| `my.deploy.node.sshUser` | null or string | `null` | Username deploy-rs will deploy with. |
| `my.deploy.node.sudo` | null or string | `null` | Command to elevate privileges with (used if the deployment user != profile user). |
| `my.deploy.node.tempPath` | null or string | `null` | Path that deploy-rs will use for temporary files. |
| `my.deploy.node.user` | null or string | `null` | Username deploy-rs will deploy with. |
| `my.deploy.sshHostnames` | list of string | `[ ]` | Addresses for ssh-machine in order of preference. Defaults to the deploy-rs hostname. |
## `dynamic-motd` — [`nixos/modules/dynamic-motd.nix`](../../nixos/modules/dynamic-motd.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.dynamic-motd.enable` | boolean | `true` | Whether to enable the dynamic message of the day PAM module. |
| `my.dynamic-motd.script` | null or strings concatenated with "\n" | `null` | Script that generates message of the day. |
| `my.dynamic-motd.services` | list of string | `[ "login" "sshd" ]` | PAM services to enable the dynamic message of the day module for. |
## `firewall` — [`nixos/modules/firewall.nix`](../../nixos/modules/firewall.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.firewall.enable` | boolean | `true` | Whether to enable the nftables-based firewall. |
| `my.firewall.extraRules` | strings concatenated with "\n" | `""` | Arbitrary additional nftables rules. |
| `my.firewall.nat.enable` | boolean | `true` | Whether to enable IP forwarding and NAT. |
| `my.firewall.nat.externalInterface` | null or string | `null` | The name of the external network interface. |
| `my.firewall.nat.forwardPorts` | (list of (submodule)) or attribute set of list of (submodule) | `[ ]` | IPv4 port forwards |
| `my.firewall.tcp.allowed` | list of (16 bit unsigned integer; between 0 and 65535 (both inclusive) or string) | `[ ]` | TCP ports to open. |
| `my.firewall.trustedInterfaces` | list of string | `[ ]` | Traffic coming in from these interfaces will be accepted unconditionally. Traffic from the loopback (lo) interface will always be accepted. |
| `my.firewall.udp.allowTraceroute` | boolean | `true` | Whethor or not to add a rule to accept UDP traceroute packets. |
| `my.firewall.udp.allowed` | list of (16 bit unsigned integer; between 0 and 65535 (both inclusive) or string) | `[ ]` | UDP ports to open. |
## `gui` — [`nixos/modules/gui`](../../nixos/modules/gui)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.gui.enable` | boolean | `true` | Whether to enable GUI system options. |
## `l2mesh` — [`nixos/modules/l2mesh.nix`](../../nixos/modules/l2mesh.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.vpns.l2.pskFiles` | attribute set of string | `{ }` | PSK files for secured meshes. |
## `librespeed` — [`nixos/modules/librespeed`](../../nixos/modules/librespeed)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.librespeed.backend.enable` | boolean | `false` | Whether to enable librespeed backend. |
| `my.librespeed.backend.extraSettingsFile` | null or string | `null` | Extra settings file. |
| `my.librespeed.backend.settings` | attribute set of unspecified value | `{ }` | Backend settings. |
| `my.librespeed.frontend.servers` | list of attribute set of unspecified value | `{ }` | Server configs. |
| `my.librespeed.frontend.webroot` | package | — | Frontend webroot. |
## `netboot` — [`nixos/modules/netboot`](../../nixos/modules/netboot)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.netboot.client.configurationLimit` | unsigned integer, meaning >=0 | `10` | Max generations to show in boot menu. |
| `my.netboot.client.enable` | boolean | `false` | Whether network booting should be enabled. |
| `my.netboot.server.allowedPrefixes` | list of string | `null` | Prefixes clients should be allowed to connect from (NFS). |
| `my.netboot.server.enable` | boolean | `false` | Whether a netboot server should be enabled. |
| `my.netboot.server.host` | string | `config.networking.fqdn` | Hostname clients should connect to over HTTP / NFS. |
| `my.netboot.server.installer.storeSize` | string | `"16GiB"` | Total allowed writable size of store. |
| `my.netboot.server.instances` | list of string | `[ ]` | Systems to hold boot files for. |
| `my.netboot.server.ip` | string | `null` | IP clients should connect to via TFTP. |
## `nginx-sso` — [`nixos/modules/nginx-sso.nix`](../../nixos/modules/nginx-sso.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.nginx-sso.configuration` | attribute set of unspecified value | `{ }` | nginx-sso configuration. |
| `my.nginx-sso.enable` | boolean | `false` | Whether to enable custom nginx-sso. |
| `my.nginx-sso.extraConfigFile` | null or string | `null` | Path to configuration (e.g. for secrets). |
| `my.nginx-sso.includes.baseURL` | string | `null` | Base URL for redirects. |
| `my.nginx-sso.includes.endpoint` | string | `"http://localhost:8082"` | Upstream for proxied auth requests. |
| `my.nginx-sso.includes.instances` | attribute set of (submodule) | `{ }` | nginx includes instances. |
| `my.nginx-sso.includes.instances.<name>.auth.path` | string | `"/sso-auth"` | HTTP path for SSO auth. |
| `my.nginx-sso.includes.instances.<name>.auth.redirect` | string | `"$scheme://$http_host$request_uri"` | URL to redirect to upon successful login. |
| `my.nginx-sso.includes.instances.<name>.logout.path` | string | `"/sso-logout"` | HTTP path for SSO logout. |
| `my.nginx-sso.includes.instances.<name>.logout.redirect` | string | `"$scheme://$http_host/"` | URL to redirect to upon successful logout. |
| `my.nginx-sso.package` | package | `<derivation nginx-sso-0.27.9>` | nginx-sso package to use. |
## `nvme` — [`nixos/modules/nvme`](../../nixos/modules/nvme)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.nvme.boot.address` | string | `null` | Address of NVMe-oF target. |
| `my.nvme.boot.nqn` | null or string | `null` | NQN to connect to on boot |
| `my.nvme.uuid` | null or string | `null` | NVMe host ID |
## `paseo-relay` — [`nixos/modules/paseo-relay.nix`](../../nixos/modules/paseo-relay.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.paseo-relay.enable` | boolean | `false` | Whether to enable the Paseo relay. |
| `my.paseo-relay.environment` | attribute set of (string or signed integer or boolean) | `{ }` | Extra `PASEO_RELAY_*` environment variables (see the relay's README). |
| `my.paseo-relay.host` | string | `"127.0.0.1"` | Address to listen on. |
| `my.paseo-relay.package` | package | `<derivation paseo-relay-0.1.0-unstable-2026-10-28>` | Paseo relay package. |
| `my.paseo-relay.port` | 16 bit unsigned integer; between 0 and 65535 (both inclusive) | `4000` | Port to listen on (plain HTTP / WebSocket). |
## `pdns` — [`nixos/modules/pdns.nix`](../../nixos/modules/pdns.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.pdns.auth.bind.file-records.sshKey` | null or string | `null` | SSH public key for file record update user. |
| `my.pdns.auth.bind.options.also-notify` | list of string | `[ ]` | List of additional address to send DNS NOTIFY messages to. |
| `my.pdns.auth.bind.zones` | attribute set of (submodule) | `{ }` | BIND-style zones definitions. |
| `my.pdns.auth.bind.zones.<name>.also-notify` | list of string | `[ ]` | List of additional address to send DNS NOTIFY messages to. |
| `my.pdns.auth.bind.zones.<name>.masters` | list of string | `[ ]` | List of masters to retrieve data from (as slave). |
| `my.pdns.auth.bind.zones.<name>.path` | absolute path | `null` | Path to zone file. |
| `my.pdns.auth.bind.zones.<name>.template` | boolean | `true` | Whether to run the zone contents through a template for post-processing. |
| `my.pdns.auth.bind.zones.<name>.text` | null or strings concatenated with "\n" | `null` | Inline content of the zone file. |
| `my.pdns.auth.bind.zones.<name>.type` | one of "master", "slave", "native" | `"native"` | Zone type. |
| `my.pdns.auth.enable` | boolean | `false` | Whether to enable PowerDNS authoritative nameserver. |
| `my.pdns.auth.extraSettingsFile` | null or string | `null` | Path to extra settings (e.g. for secrets). |
| `my.pdns.auth.settings` | attribute set of (null or signed integer or string or boolean or absolute path or list of (signed integer or string or boolean or absolute path)) | `{ }` | Authoritative server settings. |
| `my.pdns.recursor.enable` | boolean | `false` | Whether to enable PowerDNS recursive nameserver. |
| `my.pdns.recursor.extraSettingsFile` | null or string | `null` | Path to extra settings (e.g. for secrets). |
## `secrets` — [`nixos/modules/secrets.nix`](../../nixos/modules/secrets.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.secrets.files` | attribute set of unspecified value | `{ }` | Secrets to decrypt with agenix. |
| `my.secrets.key` | null or string | `null` | Public key that secrets for this system should be encrypted for. |
| `my.secrets.vmKeyPath` | string | `"/tmp/xchg/dev.key"` | Path to dev key when in a dev VM. |
## `server` — [`nixos/modules/server.nix`](../../nixos/modules/server.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.server.enable` | boolean | `false` | Whether to enable common configuration for servers. |
## `spdk` — [`nixos/modules/spdk.nix`](../../nixos/modules/spdk.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.spdk.config.subsystems` | attribute set of list of (submodule) | `{ }` | Subsystem config / RPCs. |
| `my.spdk.config.subsystems.<name>.*.method` | string | `null` | RPC method name. |
| `my.spdk.config.subsystems.<name>.*.params` | attribute set of unspecified value | `{ }` | RPC params |
| `my.spdk.debug.ublkDisks` | list of string | `[ ]` | Bdevs `spdk-debug` exposes as `/dev/ublkb<n>`, numbered from 1, instead of serving the config. |
| `my.spdk.enable` | boolean | `false` | Whether to enable SPDK target. |
| `my.spdk.extraArgs` | string | `""` | Extra arguments to pass to spdk_tgt. |
## `tmproot` — [`nixos/modules/tmproot.nix`](../../nixos/modules/tmproot.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.tmproot.enable` | boolean | `true` | Whether to enable tmproot. |
| `my.tmproot.persistence.config` | submodule | `{ }` | Persistence configuration |
| `my.tmproot.persistence.dir` | null or string | `"/persist"` | Path where persisted files are stored. |
| `my.tmproot.size` | string | `"2G"` | Size of tmpfs root |
| `my.tmproot.unsaved.ignore` | list of string | `[ ]` | Path prefixes to ignore if unsaved. |
| `my.tmproot.unsaved.showMotd` | boolean | `true` | Whether to show unsaved files with `dynamic-motd`. |
## `user` — [`nixos/modules/user.nix`](../../nixos/modules/user.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.user.config` | submodule | `{ }` | User definition (as `users.users.*`). |
| `my.user.enable` | boolean | `true` | Whether to create a primary user. |
| `my.user.homeConfig` | Home Manager module | `{ }` | Home configuration (as `home-manager.users.*`) |
| `my.user.passwordSecret` | null or string | `"user-passwd.txt"` | Name of user password secret. |
| `my.user.tmphome` | boolean | `true` | Whether to persist home directory files under tmproot |
## `vms` — [`nixos/modules/vms.nix`](../../nixos/modules/vms.nix)
| Option | Type | Default | Description |
|---|---|---|---|
| `my.vms.instances` | attribute set of (submodule) | `{ }` | VM instances. |
| `my.vms.instances.<name>.autoStart` | boolean | `true` | Whether to start the VM automatically at boot. |
| `my.vms.instances.<name>.boot` | string or (attribute set of unspecified value) convertible to it | `{ menu = "on"; splash-time = 5000; }` | Boot options. |
| `my.vms.instances.<name>.cleanShutdown.enabled` | boolean | `true` | Whether to attempt to cleanly shut down the guest. |
| `my.vms.instances.<name>.cleanShutdown.timeout` | unsigned integer, meaning >=0 | `30` | Clean shutdown timeout (in seconds). |
| `my.vms.instances.<name>.cpu` | string | `"host"` | QEMU CPU model. |
| `my.vms.instances.<name>.drives` | list of (submodule) | `[ ]` | Drives to attach to VM. |
| `my.vms.instances.<name>.drives.*.backend` | string or (attribute set of unspecified value) convertible to it | `{ }` | Backend blockdev options. |
| `my.vms.instances.<name>.drives.*.format` | string or (attribute set of unspecified value) convertible to it | `{ }` | Format blockdev options. |
| `my.vms.instances.<name>.drives.*.formatBackendProp` | string | `"file"` | Property that references the backend blockdev. |
| `my.vms.instances.<name>.drives.*.frontend` | string | `"virtio-blk"` | Frontend device driver. |
| `my.vms.instances.<name>.drives.*.frontendOpts` | string or (attribute set of unspecified value) convertible to it | `{ }` | Frontend device options. |
| `my.vms.instances.<name>.drives.*.name` | string | `null` | Drive name. |
| `my.vms.instances.<name>.enableKVM` | boolean | `true` | Whether to enable KVM. |
| `my.vms.instances.<name>.enableUEFI` | boolean | `true` | Whether to enable UEFI. |
| `my.vms.instances.<name>.hostDevices` | attribute set of (submodule) | `{ }` | Host PCI devices to pass to the VM. |
| `my.vms.instances.<name>.hostDevices.<name>.bindVFIO` | boolean | `true` | Whether to automatically bind the device to vfio-pci. |
| `my.vms.instances.<name>.hostDevices.<name>.extraOptions` | string or (attribute set of unspecified value) convertible to it | `{ }` | Extra QEMU options for the vfio-pci QEMU device. |
| `my.vms.instances.<name>.hostDevices.<name>.hostBDF` | string | `null` | PCI BDF of host device. |
| `my.vms.instances.<name>.hostDevices.<name>.index` | unsigned integer, meaning >=0 | `null` | Index of device in guest (for root port chassis and slot). |
| `my.vms.instances.<name>.machine` | string | `"q35"` | QEMU machine type. |
| `my.vms.instances.<name>.memory` | unsigned integer, meaning >=0 | `1024` | Amount of RAM (mebibytes). |
| `my.vms.instances.<name>.networks` | attribute set of (submodule) | `{ }` | Networks to attach VM to. |
| `my.vms.instances.<name>.networks.<name>.bridge` | null or string | `"‹name›"` | Network bridge to connect to (null to not attach to bridge). |
| `my.vms.instances.<name>.networks.<name>.extraOptions` | string or (attribute set of unspecified value) convertible to it | `{ }` | Extra QEMU options to set for the NIC. |
| `my.vms.instances.<name>.networks.<name>.ifname` | string | `"vm-‹name›"` | TAP device to create / use. |
| `my.vms.instances.<name>.networks.<name>.mac` | string | `null` | Guest MAC address. |
| `my.vms.instances.<name>.networks.<name>.model` | string | `"virtio-net"` | Device type for network interface. |
| `my.vms.instances.<name>.networks.<name>.tapFD` | null or (unsigned integer, meaning >=0) | `null` | FD to use to pass existing TAP device. |
| `my.vms.instances.<name>.networks.<name>.waitOnline` | boolean or string | `true` | Whether to wait for networkd to consider the bridge / existing TAP device online. Pass a string to set the OPERSTATE will wait for. |
| `my.vms.instances.<name>.qemuBin` | absolute path | `"/nix/store/ziacjpynpg4536dll8ja4qs1la0fvn7l-qemu-host-cpu-only-11.1.2/bin/qemu-kvm"` | Path to QEMU executable. |
| `my.vms.instances.<name>.qemuFlags` | list of string | `[ ]` | Additional flags to pass to QEMU. |
| `my.vms.instances.<name>.smp.cpus` | unsigned integer, meaning >=0 | `1` | Number of CPU cores. |
| `my.vms.instances.<name>.smp.threads` | unsigned integer, meaning >=0 | `1` | Number of threads per core. |
| `my.vms.instances.<name>.spice.enable` | boolean | `true` | Whether to enable SPICE. |
| `my.vms.instances.<name>.uuid` | string | `null` | QEMU machine UUID. |
| `my.vms.instances.<name>.vga` | string | `"virtio"` | VGA card type. |
| `my.vms.ovmfPackage` | package | `<derivation OVMF-202608>` | OVMF package. |
+12
View File
@@ -0,0 +1,12 @@
# Remote boxes
The "remote" group covers the boxes that live outside the `colony` and `home` sites: the two
edge VPSes (`britway` in London, `britnet` in Birmingham) and the `kelder` site — a secondary
server at a remote location, linked back to colony over WireGuard and acting as a NixOS
container host.
| Box | What it is |
| --- | --- |
| [`britway`](britway.md) | Vultr VPS (London, `lon1`): Headscale control plane, Tailscale exit node, BGP edge, nginx |
| [`britnet`](britnet.md) | VPS (Birmingham, `bhx1`): Tailscale exit node / WireGuard hub |
| [`kelder`](kelder/README.md) | Secondary home server (`hentai.engineer`): container host, Samba, DDNS (containers on its page) |
+41
View File
@@ -0,0 +1,41 @@
# britnet
A small VPS in Birmingham (`bhx1`) acting as a second Tailscale/WireGuard egress point — a
narrower gateway role than [`britway`](britway.md) (no control plane, no BGP).
- **Source:** [`nixos/boxes/britnet.nix`](../../nixos/boxes/britnet.nix)
- **Host:** VPS (Birmingham, `bhx1`; provider uplink assignment `allhost`)
- **nixpkgs:** `mine`
## Platform
| Component | Allocation |
|---|---|
| Virtualisation | KVM/QEMU guest |
| Compute | 2 vCPUs and 2 GiB RAM |
| Storage | 32 GiB virtio disk with separate ext4 filesystems for `/boot`, `/nix` and `/persist`; root is tmpfs |
## Role
- **Tailscale exit node** — logs into the headscale on [`britway`](britway.md)
(`--login-server=https://hs.nul.ie`) with `--advertise-exit-node`.
- **WireGuard hub** — `wg0` listens on UDP 51820 on the `vpn` assignment, with a single static
peer.
- **NAT gateway** — traffic arriving on `tailscale0`/`wg0` is forwarded out `veth0` and SNATed
to the `allhost` v4/v6 addresses.
## Network assignments
See the consolidated [network assignments](../networking.md#box-assignments) table (this box: `britnet`).
## Networking
- The provider interface is renamed to `veth0` by MAC. Its IPv6 default gateway sits off-subnet, so
a link-scope route is added to reach it.
- `wg0` is a networkd WireGuard netdev keyed from `britnet/wg.key`; RA is disabled on it.
- Upstream DNS is hardcoded to Cloudflare (`1.1.1.1` / `1.0.0.1`).
- `iperf3` runs with an open port for bandwidth testing.
## Notable config files
- [`nixos/boxes/britnet.nix`](../../nixos/boxes/britnet.nix) — the whole box (single file).
+54
View File
@@ -0,0 +1,54 @@
# britway
A Vultr VPS in London (`lon1`) acting as the network edge node: the self-hosted Tailscale
control plane, a tailnet exit node, and the BGP speaker for AS211024.
- **Source:** [`nixos/boxes/britway/`](../../nixos/boxes/britway)
- **Host:** VPS at Vultr (London, `lon1`)
- **nixpkgs:** `mine`
## Platform
| Component | Allocation |
|---|---|
| Virtualisation | Vultr VC2 virtual guest on a QEMU-compatible platform |
| Compute | 2 vCPUs and 2 GiB RAM |
| Storage | 65 GiB virtio disk with separate ext4 filesystems for `/boot`, `/nix` and `/persist`; root is tmpfs |
## Role
- **Headscale** — the self-hosted Tailscale control plane at `hs.nul.ie`; every other box's
`tailscaled` logs in here (`--login-server=https://hs.nul.ie`). Google OIDC for auth,
SQLite state, MagicDNS under `ts.nul.ie`, and split DNS pointing the colony/home domains
at their internal resolvers.
- **Tailscale exit node** — advertises `--advertise-exit-node` plus routes to the home v4/v6
prefixes; tailnet traffic is SNATed out `veth0` (v4 to the Vultr public IP, v6 to the
`as211024` mesh address).
- **BGP edge** — `bird2` speaks BGP as AS211024 to Vultr transit (AS64515, separate v4/v6
sessions authenticated with a password from `britway/bgp-password-vultr.conf`) and exports
everything to a `bgp.tools` monitoring session. It originates the internal, colony and home
IPv6 prefixes documented in [networking](../networking.md#domains).
- **nginx** — reverse proxy fronting headscale (`hs.nul.ie` → `localhost` headscale port),
with a wildcard ACME cert for `nul.ie` issued via Cloudflare DNS.
## Network assignments
See the consolidated [network assignments](../networking.md#box-assignments) table (this box: `britway`).
## Networking
- Two assignments: `vultr` on the provider interface `veth0` (renamed by MAC), and `as211024`
on the `l2mesh` VXLAN interface (`my.vpns.l2`) — member of the shared mesh (see
[The AS211024 L2 mesh](../networking.md#the-as211024-l2-mesh)).
- Static routes steer colony/home v4 traffic over the `as211024` mesh. A separate `ts-extra`
routing table with a policy rule on `tailscale0` ingress sends Tailscale-sourced v6
traffic for colony via `estuary`, while the box's own v6 uses WAN.
- The firewall trusts the `as211024` prefixes (`lib.my.c.as211024.nftTrust`) and
`tailscale0`; `iperf3` runs with an open port for bandwidth testing.
## Notable config files
- [`nixos/boxes/britway/default.nix`](../../nixos/boxes/britway/default.nix) — system, assignments, networkd, firewall/SNAT.
- [`nixos/boxes/britway/bgp.nix`](../../nixos/boxes/britway/bgp.nix) — `bird2` config (Vultr transit, `bgp.tools`).
- [`nixos/boxes/britway/nginx.nix`](../../nixos/boxes/britway/nginx.nix) — nginx vhosts + ACME.
- [`nixos/boxes/britway/tailscale.nix`](../../nixos/boxes/britway/tailscale.nix) — headscale + the tailnet node itself.
+72
View File
@@ -0,0 +1,72 @@
# kelder
Secondary home server at a remote site, domain `hentai.engineer`. Linked back to colony over
WireGuard and acting as a NixOS container host (like `shill`/`sfh`).
- **Source:** [`nixos/boxes/kelder/`](../../../nixos/boxes/kelder)
- **Host:** physical (Intel; LTS kernel, `kvm-intel`, IOMMU on)
- **nixpkgs:** `mine`
## Role
- **Container host** — runs two NixOS containers on the `ctrs` bridge
(`my.containers.instances`): `kelder-acquisition` and `kelder-spoder` (below).
- **Public services via colony** — a WireGuard tunnel (`estuary` netdev) connects to colony's
`estuary` box, which DNATs public traffic to kelder's tunneled assignment; connection-mark-based
policy routing sends replies back through the tunnel while ordinary traffic uses the LAN.
kelder's own NAT forwards `http`/`https` on to `kelder-spoder`.
- **Nextcloud host** — served from the `kelder-spoder` container.
- **Samba** — the `storage` share backed by `/mnt/storage`, with `nmbd` and `samba-wsdd` for
Windows discovery.
- **DDNS** — a `ddns-update` timer runs `dns_update.py` periodically to sync the
`hentai.engineer` and `kelder-local.hentai.engineer` Cloudflare records with the address on
`et1g0`.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `kelder`).
## Containers
| Container | Role |
| --- | --- |
| [`kelder-acquisition`](containers/kelder-acquisition.md) | Media stack (Transmission over AirVPN, Jackett/Radarr/Sonarr, Jellyfin) |
| [`kelder-spoder`](containers/kelder-spoder.md) | Nextcloud + nginx reverse proxy |
The containers are not deploy targets (`my.deploy.enable = false`); they're managed through
the host.
## Networking
- LAN on `et1g0` (renamed by MAC) with DHCP and MTU 1460 (`lib.my.c.kelder.ipv4MTU`); the
kelder v4 prefixes are masqueraded out of it.
- The `estuary` WireGuard peer is combined with rules that keep LAN traffic on the main table and
only route tunnel-marked or owned traffic through the tunnel's dedicated table.
## Services
- `netdata` (proxied as `monitor.hentai.engineer` by `kelder-spoder`), `smartd`, `fstrim`,
LVM thin provisioning.
- `minecraft-server` is present but **disabled** (`enable = false`); the firewall still opens
25565 tcp/udp.
- Primary user `kontent` (in the `storage`/`media` groups).
- Sets `system.nixos.distroName = "KelderOS"`, a custom Plymouth theme and an `amogus-beep`
boot jingle ([`boot.nix`](../../../nixos/boxes/kelder/boot.nix)).
## Returning to service
kelder is out of service and missed the November 2026 upgrade's live checks. Before its first
deploy after it returns:
- Back up the `kelder-acquisition` state. The deploy moves Jellyfin to 12, Radarr to 7 and
Sonarr to 5, and each migrates its database on start. Check playback, a search, download and
import, and the Samba share afterwards.
- Plan the `kelder-spoder` Nextcloud migration from its
[page](containers/kelder-spoder.md) and the TODO beside its `mine-stable` pin.
## Notable config files
- [`nixos/boxes/kelder/default.nix`](../../../nixos/boxes/kelder/default.nix) — system, assignments, tunnel, NAT, containers.
- [`nixos/boxes/kelder/boot.nix`](../../../nixos/boxes/kelder/boot.nix) — Plymouth theme + boot beep.
- [`nixos/boxes/kelder/containers/`](../../../nixos/boxes/kelder/containers) — the two container definitions.
- [`nixos/boxes/kelder/dns_update.py`](../../../nixos/boxes/kelder/dns_update.py) — Cloudflare DDNS script.
@@ -0,0 +1,45 @@
# kelder-acquisition
The media acquisition stack for the kelder site — Transmission (forced over VPN), the *arrs
and Jellyfin in one NixOS container.
- **Source:** [`nixos/boxes/kelder/containers/acquisition/`](../../../../nixos/boxes/kelder/containers/acquisition)
- **Host:** NixOS container on [`kelder`](../README.md)
- **nixpkgs:** `mine`
## Role
### Transmission
`transmission_4` is bound to the VPN wait-online unit and uses AirVPN's forwarded peer port. Upload,
download and seed-ratio limits are configured in the service source. Downloads use
`/mnt/media/downloads/torrents`, backed by the host's `/mnt/storage/media`.
### Media services
Jackett, Radarr and Sonarr share the `media` group with a group-writable umask. Jellyfin uses the
host's bind-mounted `/dev/dri` with `intel-vaapi-driver` / `intel-ocl`; its user belongs to
`render`.
## Network assignments
See the consolidated [network assignments](../../../networking.md#box-assignments) table (this box: `kelder-acquisition`).
## Networking
- `internal` assignment (name `acquisition-ctr`) on the host's `ctrs` bridge, MTU 1460 to
match the site WAN.
- All non-site traffic goes over an AirVPN WireGuard tunnel (`vpn` netdev, AirVPN IE endpoint).
Policy rules keep traffic to and from the kelder prefixes on the main table and push everything
else through the VPN's dedicated table.
- An nftables input chain drops new TCP connections from the VPN interface except the
Transmission peer port; the web UI ports (9091 Transmission, 9117 Jackett, 7878 Radarr,
8989 Sonarr, 8096 Jellyfin) are accepted from the site. When built as a dev VM, those ports
are forwarded to the host.
- Sonarr still needs the EOL .NET 6 runtime, allowed via
`nixpkgs.config.permittedInsecurePackages`.
## Notable config files
- [`nixos/boxes/kelder/containers/acquisition/default.nix`](../../../../nixos/boxes/kelder/containers/acquisition/default.nix) — services and users.
- [`nixos/boxes/kelder/containers/acquisition/networking.nix`](../../../../nixos/boxes/kelder/containers/acquisition/networking.nix) — AirVPN tunnel + firewall.
@@ -0,0 +1,52 @@
# kelder-spoder
The web container for the kelder site: Nextcloud plus an nginx (OpenResty) reverse proxy for
the site's services.
- **Source:** [`nixos/boxes/kelder/containers/spoder/`](../../../../nixos/boxes/kelder/containers/spoder)
- **Host:** NixOS container on [`kelder`](../README.md)
- **nixpkgs:** `mine-stable` until the Nextcloud migration.
## Role
- **Nextcloud** (`nextcloud32`) at `cloud.hentai.engineer` (trusted alias
`cloud-local.hentai.engineer`), SQLite backend, data in `/mnt/storage/nextcloud`
(`/mnt/storage` is bind-mounted from the host).
The package is temporarily allowlisted at `32.0.15`. Check the live version before planning
the migration because Nextcloud upgrades must proceed one major version at a time.
- **nginx reverse proxy** (`openresty`) terminating TLS for the site's public vhosts, with a
wildcard ACME cert for `hentai.engineer` via Cloudflare DNS. The kelder host forwards
`http`/`https` to this container; uploads are unlimited (`clientMaxBodySize = 0`) for
Nextcloud's sake.
## Network assignments
See the consolidated [network assignments](../../../networking.md#box-assignments) table (this box: `kelder-spoder`).
## Proxy vhosts
All under `hentai.engineer`, each with a `*-local` alias:
| vhost | Target | Auth |
| --- | --- | --- |
| `monitor` | `netdata` on the kelder host (:19999) | `htpasswd` |
| `kontent` | Jellyfin on `kelder-acquisition` (:8096, incl. websocket) | — |
| `torrents` | Transmission on `kelder-acquisition` (:9091) | `htpasswd` |
| `jackett` | Jackett on `kelder-acquisition` (:9117) | `htpasswd` |
| `radarr` | Radarr on `kelder-acquisition` (:7878) | `htpasswd` |
| `sonarr` | Sonarr on `kelder-acquisition` (:8989) | `htpasswd` |
| `cloud` | Nextcloud (local) | — |
An `init_worker_by_lua` timer polls `v4.ident.me` periodically to track the site's public IP; it
feeds `localRedirect` rewrites (bounce public-IP clients to the `*-local` name) that
are currently **disabled** (commented out — Virgin Media filters DNS answers containing local
IPs, so the split doesn't work as intended).
## Networking
- `internal` assignment (name `spoder-ctr`) on the host's `ctrs` bridge, MTU 1420.
## Notable config files
- [`nixos/boxes/kelder/containers/spoder/default.nix`](../../../../nixos/boxes/kelder/containers/spoder/default.nix) — Nextcloud + ACME.
- [`nixos/boxes/kelder/containers/spoder/nginx.nix`](../../../../nixos/boxes/kelder/containers/spoder/nginx.nix) — reverse proxy vhosts.
+39
View File
@@ -0,0 +1,39 @@
# colony
The hosted dedicated server in Amsterdam (`ams1`) and the public-facing half of
the boxes: almost everything reachable from the internet lives here.
- **Internal domain:** `ams1.int.nul.ie` (`lib.my.c.colony.domain`)
- **Public domain:** `nul.ie` — public services are published as `*.nul.ie`
- **Source:** [`nixos/boxes/colony/`](../../../nixos/boxes/colony)
## Networking
`colony` separates the host, VMs, `shill` containers and `whale2` OCI workloads onto dedicated
networks behind [`estuary`](estuary.md), which terminates the public addressing. The canonical
prefixes and routing overview are in the [`colony` section of networking.md](../../networking.md#colony).
## Boxes
| Box | Role |
|---|---|
| [`colony`](colony.md) | Physical VM host (AMD, KVM, LVM-thin, `borgthin` backups → rsync.net) |
| [`estuary`](estuary.md) | Edge router: WAN, firewall/NAT, DNS, BGP (AS211024), WireGuard |
| [`shill`](shill/README.md) | NixOS container host (most applications; per-container pages under `shill/`) |
| [`whale2`](whale2.md) | podman/OCI game-server host |
| [`git`](git.md) | Gitea + Gitea Actions runner |
| [`mail`](mail.md) | Debian VM running mailcow (not NixOS) |
| [`darts`](darts.md) | Third-party/customer VM (not NixOS) |
| [`portcullis`](portcullis.md) | Bare-metal edge box for Nikhef; being staged, not yet in service |
The applications running on `shill` are listed on its own page — see
[shill/README.md](shill/README.md#containers).
`mail` and `darts` are host-defined VMs whose guest operating systems are managed out of band; their
pages document only what this repository controls.
`portcullis` is new hardware headed for Nikhef that will take over most of `estuary`'s edge routing.
It is not deployed yet and the resulting topology is still being worked out. It travels with
[`fergal`](fergal.md), an OpenWrt SFP+ switch whose firmware this flake builds; both are staged at
home for now, borrowing the home fabric through
[jim](../home/switches.md#fergal-portculliss-switch).
+155
View File
@@ -0,0 +1,155 @@
# colony
The physical dedicated server in Amsterdam (`ams1`) and the VM host for
everything at the colony site.
- **Source:** [`nixos/boxes/colony/default.nix`](../../../nixos/boxes/colony/default.nix)
(VM instances in [`nixos/boxes/colony/vms/default.nix`](../../../nixos/boxes/colony/vms/default.nix))
- **Host:** bare metal (this *is* the physical box)
- **nixpkgs:** `mine-stable`
## Hardware
| Component | Inventory |
|---|---|
| Platform | ASRock Rack X570D4U server board |
| CPU | AMD Ryzen 9 5950X (16 cores / 32 threads) |
| Memory | 128 GiB |
| NVMe storage | Three 2 TB Samsung SSD 980 PRO devices providing the NVMe-backed LVM thin pool and data LVs |
| Bulk storage | Three 12 TB WD120EDBZ disks and one 18 TB WD180EDGZ disk for the bulk LVM volumes |
| Boot | SanDisk USB device holding the EFI system partition |
| Network / management | Two Intel I210 Gigabit Ethernet controllers, one passed through to `estuary`; ASPEED BMC graphics and console |
## Role
Bare-metal AMD host. It does little application work itself — its job is to run
the VMs and provide them with storage, networking and backups.
### Virtualisation
The `my.vms` module drives QEMU/KVM with `kvm-amd` and IOMMU enabled. Each `my.vms.instances` entry
becomes a `vm@<name>` systemd service with UEFI, QMP/monitor sockets under `/run/vms/<name>/`, TAP
networking and optional `hostDevices` passthrough through `vfio-pci`. `estuary` receives the WAN NIC
this way.
### Storage
All three NVMe SSDs and all four SATA HDDs are physical volumes in one `main` VG. Separate pools
and standalone RAID LVs keep workloads on the appropriate media:
| Layer | Physical layout | Main consumers |
|---|---|---|
| `nvme-tpool` | Thin-pool data is RAID 0 across the three NVMe SSDs; thin metadata is RAID 1 on two of them. The data itself has no redundancy. | Host `/nix` and `/persist`; VM system and persistence disks; fast data LVs such as `minio`, `oci`, `git`, `gitea-actions-cache`, `nix-cache` and `jam` |
| `hdds-tpool` | Thin-pool data is RAID 5 across the three 12 TB HDDs; thin metadata is RAID 1 on two NVMe SSDs. | `media`, passed to `shill`, and `backup`, mounted by the host at `/mnt/backup` |
| `darts-media` | Standalone RAID 5 LV spanning all four HDDs. | Bulk storage passed to `darts` |
| `darts-ext` | Standalone linear LV using the remaining capacity of the 18 TB HDD. | Expansion storage passed to `darts` |
`media` and `backup` are thin-provisioned, so their virtual capacities are not additive physical
capacity and overcommit `hdds-tpool`. VM disks built with `lib.my.vm.disk` are named
`vm-<name>-<disk>` in `main`; `lib.my.vm.lvmDisk` attaches the named data LVs.
The initrd activates only `colony-nix` and `colony-persist`. This avoids checking and activating all
of the storage before switching root; `lvm-activate-main.service` activates the remaining LVs before
local filesystems and VMs need them.
### Backups
`my.borgthin` job `main` snapshots host and VM persistence/data LVs into `/mnt/backup/main`.
`borgthin-rsync.service` copies the repository to rsync.net and `rsync-lvm-meta.service` sends the
LVM metadata; both run at idle priority after the Borg job.
### Monitoring
Netdata uses FreeIPMI while ignoring the VCCM sensor. The box also runs `smartd` with logs under
`/var/log/smartd`, `rasdaemon`, and `fstrim` before the backup job.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `colony`).
## Networking
- Two bridges: `base` (the colony base network, shared with `estuary`) and
`vms` (the VM network). Dummy interfaces (`base0`, `vms0`) keep the bridges
up in networkd's eyes so dependent VMs can start.
- `colony` sends RAs on `vms` (DNS = `estuary`'s base address) and carries
static routes for the downstream prefixes: `ctrs` via `shill`, `oci` via
`whale2`, plus the Tailscale, `qclk` and `jam` prefixes via `shill`.
- `estuary` is the default gateway (via the `base` bridge); `colony`'s own public-facing address is
its `internal` assignment (alt name `vm`).
- The customer VMs attach to dedicated TAP devices (`vm-mail`, `vm-darts`)
which are **not** bridged: networkd puts the point-to-point /32
(`lib.my.c.colony.custRouting`) and the customer's IPv6 /64 on each, sends
RAs, and link-routes the customer's public /32 down the tap.
- `my.firewall` trusts the `vms` bridge, DNATs the shared
`lib.my.c.colony.firewallForwards` list for traffic addressed to `estuary`'s
public IP (so the port forwards also work from inside), and forwards the
customer prefixes through with minimal filtering ("trust for now").
## BMC
The board's AMI-based BMC provides the web UI, remote console and IPMI over LAN.
- The dedicated management port is LAN channel 1, with the static address `198.18.10.38/24`
and gateway `198.18.10.254` in Coloclue's management network. Channel 8 holds the unused
shared-NIC configuration.
- The host reaches the BMC in-band through `ipmi_si` (`/dev/ipmi0`), which Netdata's FreeIPMI
plugin also uses. `ipmitool` is installed for this.
### In-band recovery
While `colony` is running, root can change the BMC's LAN settings, users and passwords, or
restart it, without network access or BMC credentials:
```sh
ssh-machine colony doas ipmitool lan print 1
```
- Pass multi-command scripts on stdin with `ssh-machine colony bash -s`. `ssh-machine`
flattens a quoted `sh -c` argument.
- "Received a response with unexpected ID" warnings are harmless.
- `ipmitool mc reset cold` restarts only the BMC, not the host.
- In-band recovery needs the host to be up. Change and verify the BMC's network settings from
outside before rebooting `colony`, not together with a reboot.
### Changing the LAN settings
Save the current settings with `lan print 1`, then apply the new ones. Set the gateway last so
that it falls inside the new subnet:
```sh
ssh-machine colony bash -s <<'EOF'
doas ipmitool lan set 1 ipsrc static
doas ipmitool lan set 1 ipaddr 198.18.10.38
doas ipmitool lan set 1 netmask 255.255.255.0
doas ipmitool lan set 1 defgw ipaddr 198.18.10.254
doas ipmitool lan print 1
EOF
```
- From outside, check `ipmitool -I lanplus -H <address> -U admin chassis status` and the
remote console in the web UI.
- To roll back, run the same commands with the previous values.
## VMs
Declared in `my.vms.instances` (`cpus`/`threads` are QEMU `smp` values):
| VM | Cores | Threads | Memory | Network | Disks |
|---|---|---|---|---|---|
| `estuary` | 2 | 2 | 3 GiB | `base` | `esp` / `nix` / `persist` LVs + WAN NIC passthrough |
| `shill` | 12 | 2 | 40 GiB | `vms` | `esp` / `nix` / `persist` + `media` / `minio` / `nix-cache` / `jam` LVs |
| `whale2` | 8 | 2 | 16 GiB | `vms` | `esp` / `nix` / `persist` + `oci` LV |
| `git` | 12 | 2 | 40 GiB | `vms` | `esp` / `nix` / `persist` / `oci` + `git` / `gitea-actions-cache` LVs |
| `mail` | 3 | 2 | 6 GiB | `vm-mail` tap | `root` / `data` LVs |
| `darts` | 4 | 2 | 16 GiB | `vm-darts` tap | `root` LV + `darts-media` / `darts-ext` LVs |
`estuary`, `shill`, `whale2` and `git` are NixOS systems with their own pages
(see the [README](README.md#boxes)); [`mail`](mail.md) and [`darts`](darts.md) have host-side
definitions here, but their guest operating systems are managed out of band.
## Notable config files
- [`nixos/boxes/colony/default.nix`](../../../nixos/boxes/colony/default.nix) — host hardware, networkd, firewall, backups.
- [`nixos/boxes/colony/vms/default.nix`](../../../nixos/boxes/colony/vms/default.nix) — `my.vms.instances` for all six VMs.
- [`nixos/modules/vms.nix`](../../../nixos/modules/vms.nix) — the `my.vms` module itself.
+37
View File
@@ -0,0 +1,37 @@
# darts
An opaque third-party/customer VM. Declared in `colony`'s `my.vms.instances`
but **not a NixOS system**: this repo knows nothing about what runs inside it
and doesn't manage it.
- **Source (host-side only):** the `darts` instance in
[`nixos/boxes/colony/vms/default.nix`](../../../nixos/boxes/colony/vms/default.nix)
and the `90-vm-darts` network in
[`nixos/boxes/colony/default.nix`](../../../nixos/boxes/colony/default.nix)
- **Host:** VM on `colony`
- **nixpkgs:** not applicable (unmanaged guest; host-side definition uses `colony`'s `mine-stable`)
## Role
- Customer/dedicated VM, left alone beyond hosting and connectivity.
- A thin-provisioned `root` LV on the NVMe pool, plus `darts-media` (RAID 5 across the four HDDs)
and `darts-ext` (linear storage on the 18 TB HDD) in the `main` VG. See
[`colony`'s storage layout](colony.md#storage).
## Network assignments
This guest is not a NixOS system, so its host-routed addresses are not rows in the generated
[network assignments](../../networking.md#box-assignments) table.
- Same customer-VM pattern as [`mail`](mail.md): dedicated unbridged TAP
(`vm-darts`), point-to-point address
(`custRouting.darts-vm`) on the host side, link-routed public /32
`94.142.242.255`, and the IPv6 /64 `2a0e:97c0:4d2:2001::/64` with RAs.
- DNS: `darts-cust.ams1.int.nul.ie`. Like the other customer prefixes, its
inbound traffic is accepted by `estuary` without per-port filtering and
forwarded on by `colony`.
## Notable config files
- [`nixos/boxes/colony/vms/default.nix`](../../../nixos/boxes/colony/vms/default.nix) — VM definition.
- [`nixos/boxes/colony/default.nix`](../../../nixos/boxes/colony/default.nix) — host-side network and routing.
+184
View File
@@ -0,0 +1,184 @@
# estuary
The colony edge router and firewall — the box that holds colony's public IPs
and connects everything else at the site to the internet.
- **Source:** [`nixos/boxes/colony/vms/estuary/`](../../../nixos/boxes/colony/vms/estuary)
(`default.nix`, `bgp.nix`, `dns.nix`, `bandwidth.nix`)
- **Host:** VM on `colony` (gets the WAN NIC by PCI passthrough)
- **nixpkgs:** `mine`
## Role
- **Edge routing / firewall / NAT** — owns the colony public IPv4/IPv6 assignments, NATs outbound
traffic, and port-forwards inbound services (see [Firewall and NAT](#firewall-and-nat)).
- **DNS** — PowerDNS authoritative server *and* recursor (see [DNS](#dns)).
- **BGP** — BIRD2 speaking AS211024 with upstreams, IXP route servers and
direct peers (see [BGP](#bgp)).
- **VPNs** — the `as211024` L2 VXLAN mesh plus three point-to-point WireGuard
tunnels (see [VPNs](#vpns)).
- **Misc** — `iperf3` server, netdata.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `estuary`).
## WAN and IXP VLANs
- `wan` — the passed-through `igb` NIC (9000 MTU, enlarged rings). It carries
the plain upstream uplink (static v4/v6 with gateways from the `internal`
assignment) plus the tagged `ifog` and `clue-ix` VLANs.
- `ifog` (VLAN 409) is an iFog QinQ transport that carries the IXP VLANs as
nested tags. `clue-ix` sits directly on `wan`:
| Interface | Parent | VLAN | IPv4 | IPv6 | Purpose |
|---|---|---|---|---|---|
| `clue-ix` | `wan` | 121 | — | `2001:7f8:154::21:1024:1/64` | Clue-IX peering LAN |
| `frys-ix` | `ifog` | 701 | `185.1.160.196/23` | `2001:7f8:10f::3:3850:196/64` | Frys-IX peering LAN |
| `nl-ix` | `ifog` | 1845 | `193.239.116.145/22` | `2001:7f8:13::a521:1024:1/64` | NL-ix peering LAN |
| `fogixp` | `ifog` | 1147 | `185.1.147.159/24` | `2001:7f8:ca:1::159/64` | FogIXP peering LAN |
| `ifog-transit` | `ifog` | 702 | — | `2a0c:9a40:100f:370::2/64` | iFog IPv6 transit |
The IXP interfaces run at 1500 MTU with DHCP/RA/LLDP off; an nftables `ixp`
chain rejects non-IP/ARP ethertypes in both directions.
- `base` — colony base network; sends RAs and serves DNS to the site, and
routes the `vms`/`ctrs`/`oci`, Tailscale, `qclk`, `vip*` and customer
prefixes back via `colony`.
- `as211024` — the L2 mesh interface (see VPNs).
## Firewall and NAT
`my.firewall` (nftables). Inbound port forwards (`my.firewall.nat.forwardPorts`,
driven by the shared `lib.my.c.colony.firewallForwards` list):
| Service | Forwarded to |
|---|---|
| HTTP/S, Matrix federation | `middleman` |
| Git | `git` |
| Game servers | OCI servers on `whale2`, `gam` |
| Tailscale | `waffletail` |
| `qclk` WireGuard | `qclk` |
Besides the forwards, `extraRules` defines:
- `routing-tcp` / `routing-udp` chains — the inbound allow-list for new
connections from `wan`/`as211024`/IXPs towards internal services (SSH
anywhere, otherwise per-service v4/v6 rules mirroring `firewallForwards`).
- `filter-routing` — applied to `wan`/`as211024`/IXPs → `base` forwards;
customer prefixes (`mail`/`darts` v4, `cust.v6`) are accepted wholesale, the
rest goes through the `routing-*` chains.
- SNAT: everything from `prefixes.all.v4` leaving non-`as211024` interfaces is
NATed to the public IP; the WireGuard tunnel prefixes get their own SNAT
addresses.
- DNS redirect: DNS traffic arriving at estuary's own public addresses is
redirected to port 5353 (the authoritative server) — see below.
## DNS
Both halves are PowerDNS ([`dns.nix`](../../../nixos/boxes/colony/vms/estuary/dns.nix)). The live
forward and reverse records are listed in the generated [DNS reference](../../reference/dns.md).
### Authoritative
`my.pdns.auth`, listening on `0.0.0.0:5353` / `[::]:5353`. Primary for
`ams1.int.nul.ie`, `100.10.in-addr.arpa` and the `2a0e:97c0:4d2::/48` reverse
zone.
- Zone contents are largely generated from `allAssignments`
(`lib.my.dns.fwdRecords` / `ptrRecords` / `ptr6Records`); `ALIAS` records
(with `expand-alias`) point the zone apex at estuary itself.
- AXFR is allowed to HE.net's secondary and the trusted internal/site-egress sources used by the
generated DNS reference.
- `_acme-challenge` is a LUA `TXT` record answered from a file (DNS-01 issuance).
- Reached publicly via the NAT redirect of port 53 → 5353; the `base` side also
accepts DNS directly.
### Recursor
`my.pdns.recursor` (`pdns-recursor`), listening on localhost and the `base`
addresses, serving `prefixes.all` and the Tailscale prefixes.
- Authoritative zones are forwarded back to `127.0.0.1:5353` (with NOTIFY
support, so changes show up immediately).
- A small Lua `preresolve` hook rewrites `nix-cache.nul.ie` →
`http.ams1.int.nul.ie` so cache traffic stays on-site.
## BGP
BIRD2 ([`bgp.nix`](../../../nixos/boxes/colony/vms/estuary/bgp.nix)) speaking **AS211024**:
| Peer | ASN | Role | Where / notes |
|---|---|---|---|
| ColoClue | AS8283 | Upstream | `euNetworks` 2/3, v4+v6 |
| iFog | AS34927 | Upstream | IPv6 transit |
| Hurricane Electric | AS6939 | Upstream | IPv6 over Frys-IX |
| Clue-IX | AS218511 | IXP route server | rs1/rs2, IPv6 only; `rs_client` role and GTSM |
| Frys-IX | AS56393 | IXP route server | |
| NL-ix | AS34307 | IXP route server | lower preference |
| FogIXP | AS47498 | IXP route server | |
| LUJE.net | AS212855 | Direct peer | Clue-IX (IPv6), Frys-IX/FogIXP/NL-ix (v4+v6); NL-ix lower preference; multihop labs |
| jurrian | AS212635 | Direct peer | |
| Meta | AS32934 | Direct peer | Frys-IX/NL-ix |
| Cloudflare | AS13335 | Direct peer | Frys-IX |
| Apple | AS714 | Direct peer | NL-ix |
| HE | AS6939 | Direct peer | Frys-IX (v4) |
| bgp.tools | AS212232 | Monitoring | multihop collector, `add paths` |
Statics originate the site prefixes: the `vip*` ranges via `base`, the
ams1/internal v6 prefixes via `base`/`as211024`, and the home /48 towards the
home routers' `as211024` VIP.
NL-ix direct peers use `nlix_peer_bgp4` / `nlix_peer_bgp6`, which inherit the
normal peer policy with preference `PREFPEER-1`. Meta uses the same lower
NL-ix preference as the other direct peers.
Currently disabled (commented out): efero transit over FogIXP ("not working so
well lately") and the NL-ix Cloudflare sessions.
Clue-IX uses IPv6-only RIPE policy entries under the existing IXP remarks:
```rpsl
remarks: \/\/ Clue-IX route servers \/\/
mp-import: afi ipv6.unicast from AS218511 accept AS218511:AS-CLUE-IX
mp-export: afi ipv6.unicast to AS218511 announce AS211024:AS-DEVPLAYER0
```
One pair covers both route servers. See [RIPE routing policy and peering
records](../../networking.md#ripe-routing-policy-and-peering-records) for the shared attribute
convention and update procedure.
## VPNs
### `as211024` L2 mesh
Member alongside `river`/`stream`/`britway` (`my.vpns.l2`, the `l2mesh` module).
The mesh transport, crypto and addressing are shared fabric — see
[The AS211024 L2 mesh](../../networking.md#the-as211024-l2-mesh) in networking.md.
### WireGuard tunnels
Point-to-point tunnels terminated here as networkd `wireguard` netdevs (private
keys from agenix); each SNATs out its own interface address:
| Tunnel | Port | Prefix | Notes |
|---|---|---|---|
| `kelder` | 51820 | — | to the remote `kelder` site; kelder's public `estuary` assignment is routed over the tunnel |
| `hillcrest` | 51822 | `prefixes.hillcrest.v4` (`10.100.5.0/30`) | /32 pair, estuary `.1` ↔ remote `.2` |
| `john-valorant` | 51823 | `prefixes.john-valorant.v4` (`10.100.5.4/30`) | /32 pair, estuary `.1` ↔ remote `.2` |
## Bandwidth management
[`bandwidth.nix`](../../../nixos/boxes/colony/vms/estuary/bandwidth.nix) implements a WAN shaper: a
token-bucket filter on `wan` (outbound) and on an `ifb-wan` IFB device that ingress traffic is
mirrored into (inbound), with
[`bandwidth.py`](../../../nixos/boxes/colony/vms/estuary/bandwidth.py) as a `bandwidth-limiter`
service that watches utilisation and can adjust the configured rate. **Currently disabled** — the
file is not in estuary's `imports` (only `dns.nix` and `bgp.nix` are), so no shaping is applied.
## Notable config files
- [`nixos/boxes/colony/vms/estuary/default.nix`](../../../nixos/boxes/colony/vms/estuary/default.nix) — system, networkd, firewall, WireGuard, mesh membership.
- [`nixos/boxes/colony/vms/estuary/bgp.nix`](../../../nixos/boxes/colony/vms/estuary/bgp.nix) — BIRD2 config.
- [`nixos/boxes/colony/vms/estuary/dns.nix`](../../../nixos/boxes/colony/vms/estuary/dns.nix) — PowerDNS auth + recursor.
- [`nixos/boxes/colony/vms/estuary/bandwidth.nix`](../../../nixos/boxes/colony/vms/estuary/bandwidth.nix) — WAN shaper (disabled, not imported).
+105
View File
@@ -0,0 +1,105 @@
# fergal
An 8-port SFP+ switch running OpenWrt, bought to sit in front of
[`portcullis`](portcullis.md) at Nikhef. It is physically at home for now, on the bench alongside
`portcullis` while that box is staged.
- **Source:** firmware built by this flake — [`openwrt/default.nix`](../../../openwrt/default.nix)
- **Host:** bare metal
- **OS:** OpenWrt (snapshot), configured through UCI rather than RouterOS or a UniFi controller
## Hardware
| Component | Inventory |
|---|---|
| Platform | XikeStor SKS8300-8X; the board itself is branded ONTi ONT-S508CL-8S |
| SoC | Realtek RTL9303 (MIPS 34Kc) |
| Memory | 512 MB |
| Storage | 32 MiB SPI NOR (`spi0.0`) |
| Network | 8×SFP+ (`lan1`…`lan8`) |
| Console | Front-panel RJ-45 RS-232 at 9600 baud, 8N1, for stock U-Boot and OpenWrt. [OpenWrt board support](https://lists.infradead.org/pipermail/lede-commits/2025-January/024155.html) |
## Role
`portcullis`'s 10G switch. Nothing else depends on it, and it is not part of the home fabric — it
is expected to travel to Nikhef with `portcullis` rather than stay behind.
While staged at home it hangs off jim's spare SFP+ port, so `portcullis` can reach the home `hi`
VLAN over 10G: `lan1` uplinks to jim's `sfp-spare`, `lan2` goes to `portcullis`, and the other six
cages are empty. See [the home switches](../home/switches.md) for the fabric it borrows.
## Network assignments
fergal has no assignments — it is not managed by the flake. Its management address is
`192.168.64.30` on the home `core` VLAN, set in UCI as `network.lan`, with no DNS record; reach it
as `ssh root@192.168.64.30`.
## VLAN configuration
One bridge (`switch`), with VLAN 1 as the untagged PVID on every port — that's the native VLAN on
jim's `sfp-spare`, and `switch.1` is where fergal's own management address lives. `hi` (100) and
`lo` (110) are **tagged** members of every port, so a box on any cage can pick them up:
```
uci show network | grep bridge-vlan
```
Tagging all eight rather than just `lan1`/`lan2` keeps a spare cage usable without a reconfigure;
there is nothing sensitive behind it while fergal is on the bench.
**Jumbo frames pass, despite what `ip link` says.** Every DSA port and the `switch` bridge read
`mtu 1500`, but the RTL9303 forwards between ports in hardware and isn't bound by those — a
`ping -M do -s 8972` from `portcullis` to the `hi` VIP crosses fergal intact, which is what makes
the 9000-MTU `hi` VLAN usable over this path. The 1500 does apply to traffic punted to the CPU,
i.e. fergal's own management on `switch.1`.
## Firmware
The image is built by this flake — see [OpenWrt images](../../deployment.md#openwrt-images) for the
outputs and the feed pin. Packages are baked into the image, so adding tooling means editing
[`openwrt/default.nix`](../../../openwrt/default.nix) and reflashing rather than installing on the
box.
### Flash layout
A single 32 MiB SPI NOR chip (`spi0.0`, 64 KiB erase blocks). `kernel` and `rootfs` are
sub-partitions of `firmware`, and OpenWrt adds `rootfs_data` as the JFFS2 overlay after a real
flash.
| Partition | Device | Offset | Size |
|---|---|---|---|
| `u-boot` | `mtd0` | `0x000000` | 1 MiB |
| `board-info` | `mtd1` | `0x100000` | 192 KiB |
| `syslog` | `mtd2` | `0x130000` | 832 KiB |
| `firmware` | `mtd3` | `0x200000` | 30 MiB |
**`board-info` is irreplaceable.** It holds the unit's MAC addresses (`[vlanmac]` / `[cpumac]`), its
`[license]` hash, the stock boot pointers and an SSH host key — only about 1.3 KiB of it is
non-blank, and none of it can be regenerated. A full dump of all four partitions, taken before
OpenWrt was flashed, is kept outside this repo — 33 MB of images, with per-partition checksums and
restore notes. Never write `u-boot` or `board-info` without a confirmed serial/TFTP recovery path.
### Flashing notes
The procedure itself is in [`openwrt-flash.md`](../../openwrt-flash.md); what follows is specific to
this board.
Stock u-boot boots `flash:/nos.img` from a JFFS2 filesystem, so OpenWrt's sysupgrade image is
itself a JFFS2 image containing `nos.img` rather than a raw kernel + squashfs. Two things bite when
flashing from an initramfs, as during the initial install:
- **`sysupgrade -c` does not work.** It needs `/overlay/upper/etc`, which doesn't exist when running
from RAM, and it aborts *after* `mtd erase firmware` has already run — leaving the box with no
bootable firmware until the job is finished. Pass the config as an explicit tarball instead
(`tar czf`, then `sysupgrade -f <tarball> …`).
- **The working management address may not be in UCI.** If it was set by hand with `ip` while UCI
still held the stock address, the box comes back unreachable. Write it into `network.lan` and
commit before flashing.
Neither applies to an ordinary flash-to-flash upgrade, where `sysupgrade` keeps `/etc/config` and
the files listed in `/lib/upgrade/keep.d/` by default. Dropbear host keys are regenerated by a flash
that doesn't preserve them, so clear the old `known_hosts` entry afterwards.
## Notable config files
- [`openwrt/default.nix`](../../../openwrt/default.nix) — image definition and baked-in package list.
+72
View File
@@ -0,0 +1,72 @@
# git
The Gitea VM — source hosting and CI for the boxes (`git.nul.ie`).
- **Source:** [`nixos/boxes/colony/vms/git/`](../../../nixos/boxes/colony/vms/git)
(`default.nix`, `gitea.nix`, `gitea-actions.nix`)
- **Host:** VM on `colony`
- **nixpkgs:** `mine`
## Role
### Gitea
The Git forge at `git.nul.ie` (self-registration disabled), configured in
[`gitea.nix`](../../../nixos/boxes/colony/vms/git/gitea.nix).
- Backed by PostgreSQL on [`colony-psql`](shill/containers/colony-psql.md) (waited on via
`lib.my.systemdAwaitPostgres`).
- LFS enabled; all object storage (incl. LFS and packages) is on MinIO at `s3.nul.ie` (bucket
`gitea`, on [`object`](shill/containers/object.md)) — the secret is spliced into `app.ini` at
startup.
- Mail goes out via `mail.nul.ie`, including the issue-reply incoming-mail poller.
- **Sign-in with Pocket ID:** `preStart` adds or updates the `id.nul.ie` OpenID Connect login
source. The client `gitea` and its secret `gitea/oidc-secret.txt` are declared on
[`middleman`](shill/containers/middleman.md#pocket-id).
- Registration stays disabled, so a Pocket ID sign-in can't create an account. The first one
links to an existing account after signing in with its password.
- It runs before the server, which only reads login sources at startup. If it fails, Gitea
starts without the source and logs a warning.
- The CLI only takes the secret as an argument, so it is briefly visible in the process list
while `preStart` runs.
### Gitea Actions runner
One Docker-mode instance (`main-docker`) on podman (privileged, `podman` network), configured in
[`gitea-actions.nix`](../../../nixos/boxes/colony/vms/git/gitea-actions.nix).
- Labels for `node:24-trixie` and the self-built `git.nul.ie/dev/actions-ubuntu:26.04` images.
- Runs as a fixed `gitea-runner` user (not `DynamicUser`) so it can read its token; jobs have a
configured timeout.
- Gitea's `actions.ENDLESS_TASK_TIMEOUT` matches the runner's job timeout. Otherwise the server's
shorter default marks long builds as failed while the runner keeps working on them.
- The action cache lives on a dedicated disk (`/var/cache/gitea-runner`).
- Executes the repo's own `.gitea/workflows/ci.yaml`.
### nginx
Terminates TLS for `git.nul.ie` (and a default vhost) and proxies to Gitea on `:3000`. ACME
(Let's Encrypt, production) issues `nul.ie` + `*.nul.ie` via the Cloudflare DNS-01 challenge.
### podman
Local container backend for the runner; `/var/lib/containers` is an XFS data disk, and the default
`10.88.0.0/16` podman subnet is allowed to forward.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `git`).
## Storage
- `/var/lib/gitea` — the `git` LV (repositories, config).
- `/var/cache/gitea-runner` — the `gitea-actions-cache` LV.
- `/var/lib/containers` — the `oci` LV (XFS with project quotas). Despite the
name this is local to the `git` VM and unrelated to `whale2`'s `oci`
network.
## Notable config files
- [`nixos/boxes/colony/vms/git/default.nix`](../../../nixos/boxes/colony/vms/git/default.nix) — VM config, nginx + ACME, podman, firewall.
- [`nixos/boxes/colony/vms/git/gitea.nix`](../../../nixos/boxes/colony/vms/git/gitea.nix) — Gitea itself.
- [`nixos/boxes/colony/vms/git/gitea-actions.nix`](../../../nixos/boxes/colony/vms/git/gitea-actions.nix) — the Actions runner.
+57
View File
@@ -0,0 +1,57 @@
# mail
A Debian VM running [mailcow](https://mailcow.email/) (`mail.nul.ie`) — the
mail server for `nul.ie`. Declared in `colony`'s `my.vms.instances` but **not
a NixOS system**: everything inside the VM is configured out of band.
- **Source (host-side only):** the `mail` instance in
[`nixos/boxes/colony/vms/default.nix`](../../../nixos/boxes/colony/vms/default.nix)
and the `90-vm-mail` network in
[`nixos/boxes/colony/default.nix`](../../../nixos/boxes/colony/default.nix)
- **Host:** VM on `colony`
- **nixpkgs:** not applicable (Debian guest; host-side definition uses `colony`'s `mine-stable`)
## Role
- Runs the full mailcow stack (Postfix/Dovecot/SOGo/Rspamd) for `nul.ie`.
Other colony services send through it as `mail.nul.ie` (e.g. Gitea, and the
disabled Mastodon config).
- `root` and `data` LVM disks; the `vm-mail-data` LV is included in `colony`'s `borgthin` backups.
## Network assignments
This guest is not a NixOS system, so its host-routed addresses are not rows in the generated
[network assignments](../../networking.md#box-assignments) table.
### Link and addressing
The VM attaches to a dedicated, unbridged TAP (`vm-mail`). `colony` puts the point-to-point
`custRouting.mail-vm` address on the host side, link-routes public
`94.142.241.227/32` down the TAP, and advertises `2a0e:97c0:4d2:2000::/64` with RAs.
- DNS: `mail-vm.ams1.int.nul.ie` (and `mail.nul.ie` publicly, incl. the PTR in
estuary's reverse zone). `estuary` accepts traffic to the customer prefixes
without per-port filtering; `colony` forwards it on ("trust for now").
## Sign-in with Pocket ID
mailcow's Generic-OIDC identity provider signs mailboxes in to the mailcow UI and SOGo with
Pocket ID on [`middleman`](shill/containers/middleman.md#pocket-id).
- The `mailcow` client is declared in `middleman`'s `auth.nix`; its secret
`mailcow/oidc-secret.txt` is only deployed there. On the mailcow side the provider is set up
by hand under System → Configuration → Access → Identity Provider, with that secret pasted in.
- Only mailboxes whose auth source is the identity provider use it. IMAP, SMTP and the DAV and
ActiveSync clients can't follow a redirect, so those mailboxes use mailcow app passwords there.
- Admin and domain-admin logins are unaffected.
## Notes
- ACME certificates are issued on `middleman` and pushed to the VM over SSH
(`acme@mail.nul.ie mailcow-ssl-reload`, key `middleman/mailcow-ssh.key`);
the VM's SSH host key is pinned at `.keys/mail-vm-host.pub`.
## Notable config files
- [`nixos/boxes/colony/vms/default.nix`](../../../nixos/boxes/colony/vms/default.nix) — VM definition.
- [`nixos/boxes/colony/default.nix`](../../../nixos/boxes/colony/default.nix) — host-side network and routing.
+120
View File
@@ -0,0 +1,120 @@
# portcullis
A bare-metal box destined for Nikhef, intended to take over most of the colony edge
routing currently done by the [`estuary`](estuary.md) VM.
- **Source:** [`nixos/boxes/colony/portcullis/`](../../../nixos/boxes/colony/portcullis)
- **Host:** bare metal
- **nixpkgs:** `mine-stable`
## Hardware
| Component | Inventory |
|---|---|
| Platform | Mini PC (no vendor DMI strings) |
| CPU | Intel N150 (4 cores / 4 threads) |
| Memory | 8 GiB |
| Storage | One 128 GB NVMe SSD (`nvme0n1`), partitioned as a 2 GiB ESP plus an LVM PV holding the `nix` and `persist` volumes |
| Network | Four Intel I226-V 2.5 GbE ports (`et2g5-0`…`et2g5-3`) and one dual-port Intel 82599ES 10 GbE SFP+ card (`et10g-0`, `et10g-1`) |
| Management | JetKVM (HDMI/USB KVM with virtual media) |
The PCIe layout constrains what the cards can reach. The 82599ES sits behind a gen2 x4 link giving
16 Gb/s for **both** its ports together, so one port runs at line rate but the pair is
oversubscribed. The NVMe is on a x1 root port, capped near 7.9 Gb/s regardless of the drive. Each
I226-V has its own x1 link and is not constrained.
## Role
Not yet in service. The eventual job is to be the physical edge for the colony site at Nikhef,
taking over most of what `estuary` does today — WAN termination, firewalling and NAT, BGP for
AS211024 and DNS. Some of that functionality stays on `estuary`, and the surrounding network
topology will change with the move, so the split is not settled yet. Until it is, the config in
this repository covers only what is needed to boot and reach the box.
## Network assignments
`portcullis` has no colony assignments yet — those land alongside the routing config once the
topology is decided. While it is staged at home it holds a single home `hi` assignment, listed in
[`networking.md#box-assignments`](../../networking.md#box-assignments).
## Networking
- The four I226-V ports are named `et2g5-0`…`et2g5-3` and the 82599ES SFP+ ports `et10g-0` /
`et10g-1`, pinned by permanent MAC address in `.link` files.
- Bootstrap: a single `.network` matches every `et2g5-*` port and takes DHCP on the home `lo` VLAN,
so whichever port happens to be patched in brings the box up. `wait-online.anyInterface` keeps
boot from blocking on the unpatched ports.
- kea registers the DHCP hostname, so while staged the box also answers to `portcullis.dyn.h.nul.ie`.
- `my.deploy.node.hostname` is the `hi` address, taken from the assignment rather than written out,
since there is no colony FQDN for the box yet.
### 10G to the home `hi` VLAN
`et10g-0` runs over fibre to [`fergal`](fergal.md), which uplinks to jim's `sfp-spare` port. That
uplink is untagged VLAN 1, so `hi` is carried tagged on a `lan-hi` VLAN interface rather than on the
port itself; the physical link takes the `hi` jumbo MTU so the whole path is consistent with the
rest of the VLAN. `lan-hi` carries the static assignment, resolves through the router VIPs like
every other `hi` client, and its gateway route outranks the DHCP default, so the 10G path is
preferred while the 2.5G one stays as a fallback.
Both jim and `fergal` tag `hi` and `lo` along that path. It exists only while the box is staged at
home — `fergal` goes to Nikhef with it.
The other SFP+ port, `et10g-1`, is unused.
### Interface tuning
Every port takes router-sized 4096-entry rings rather than the driver defaults, matching the other
routers here, and enables `GenericReceiveOffloadUDPForwarding` so GRO batching survives forwarding
once the box carries UDP-encapsulated traffic. Both are `.link` settings, so they apply on the next
device event rather than at switch time — a reboot is the reliable way to land a change to them.
Interrupt coalescing is deliberately left alone. `igc` reports `rx-usecs` 3 and `ixgbe` reports 1,
which are the drivers' markers for dynamic ITR rather than literal microseconds; writing a
plausible-looking value there replaces adaptive moderation with a fixed one.
### I226-V erratum
The I226-V link-drop erratum is driven by PCIe ASPM, Energy Efficient Ethernet and stale NIC
firmware. ASPM, the dominant cause, is off across the whole box for the reason in
[Power](#power) below. EEE is held off by a udev rule invoking `ethtool`, as `systemd.link` has no
knob for it. `igc` already leaves EEE off on these ports, so the rule pins a driver default rather
than correcting one, and keeps it from drifting on a kernel bump. Firmware is the remaining item:
the ports report NVM `2.13` (EEPROM version word `0x2013`, which `igc` prints as the `2013` in
`ethtool -i`), behind the `2.29`/`2.32` images that circulate. Intel does not publish the I226-V
NVM image, so updating means third-party firmware and is best attempted while the box is at home
and the JetKVM is attached.
## Power
The SoC side is already at its floor and needs no tuning: the package draws around 0.75 W idle with
cores in C10 essentially all the time, under `intel_pstate` on the `powersave` governor.
Platform idle is capped instead, and deliberately left that way. The ACPI FADT declares that the
system does not support PCIe ASPM, so the OS defers to firmware, every root port advertises ASPM as
unsupported and every endpoint sits with it disabled. Deep package C-states need every PCIe link in
L1, so the package never leaves C3. `pcie_aspm=force` is the usual answer and is **not** used here:
the 82599ES advertises only L0s with an unlimited exit latency, so no amount of forcing reaches the
deep states while that card is fitted, and the only links it would actually change are the four
I226-V ones — the exact configuration behind the erratum above. Recovering that power is a firmware
question for the mini PC, and only worthwhile once the 82599ES is gone.
`iommu=pt` puts host devices in passthrough so the forwarding path does not pay DMA translation,
while leaving the IOMMU available.
## Storage
A single NVMe SSD, following the usual tmpfs-root layout: a 2 GiB ESP at `/boot`, then one LVM PV
in volume group `main` carrying `portcullis-nix` (48 GiB, `/nix`) and `portcullis-persist` (the
remainder, `/persist`).
## Secrets
`my.secrets.key` is the SSH host key adopted from the installer session at install time (seeded onto
the persist volume before first boot), so secrets could be encrypted for the box without waiting for
it to come up. The box declares nothing of its own yet — only the default `user-passwd.txt` that
`my.user` brings in.
## Notable config files
- [`nixos/boxes/colony/portcullis/default.nix`](../../../nixos/boxes/colony/portcullis/default.nix) — hardware, filesystems and bootstrap networking.
+84
View File
@@ -0,0 +1,84 @@
# shill
The colony NixOS container host — most colony applications run as
`systemd-nspawn` containers on this VM.
- **Source:** [`nixos/boxes/colony/vms/shill/`](../../../../nixos/boxes/colony/vms/shill)
(`default.nix`, `containers-ext.nix`, `containers/`)
- **Host:** VM on `colony`
- **nixpkgs:** `mine`
## Role
### Container hosting
`my.containers.instances` runs the colony containers on the `ctrs` bridge. Each is a full NixOS
system rendered through `my.asContainer` and deployed as a profile on `shill`; containers are not
standalone deploy targets. The shared container module supplies the nspawn units, `/persist` and
store binds.
### Shared storage
LVM-backed host volumes are bind-mounted into the consumers: `/mnt/media` is read-only in
`middleman` and read-write in `jackflix`; `/mnt/minio` and `/mnt/nix-cache` are read-write in
`object`.
### Routing
`shill` routes between `vms` and `ctrs`, advertises `estuary` as DNS on `ctrs`, and routes Tailscale
through `waffletail` and the `qclk` prefix through `qclk`. It applies the shared `firewallForwards`
DNAT for `estuary`'s public IP; a connection-mark-based SNAT rule keeps replies symmetric.
### Host tuning
The box has a larger conntrack table and ephemeral-port range for high connection counts. Netdata
listens on port 19999.
## Network assignments
See the consolidated [network assignments](../../../networking.md#box-assignments) table (this box: `shill`).
## Containers
Defined under
[`shill/containers/`](../../../../nixos/boxes/colony/vms/shill/containers) and
wired up in `shill`'s `my.containers.instances`. The generated
[network assignments](../../../networking.md#box-assignments) table is the source of truth for
their current addresses. Each container has its own page:
| Container | Role |
|---|---|
| [`middleman`](containers/middleman.md) | Reverse proxy, ACME, Pocket ID and SSO, librespeed, Paseo relay |
| [`vaultwarden`](containers/vaultwarden.md) | Password manager |
| [`colony-psql`](containers/colony-psql.md) | Shared PostgreSQL (14) |
| [`chatterbox`](containers/chatterbox.md) | Matrix Synapse + bridges |
| [`jackflix`](containers/jackflix.md) | Media stack |
| [`object`](containers/object.md) | MinIO, Harmonia Nix cache, HedgeDoc, wastebin |
| [`toot`](containers/toot.md) | Bluesky PDS (Mastodon disabled) |
| [`waffletail`](containers/waffletail.md) | Tailscale subnet router / exit node |
| [`qclk`](containers/qclk.md) | WireGuard management appliance |
| [`gam`](containers/gam.md) | Terraria server |
### `jam`
A one-off: [`containers-ext.nix`](../../../../nixos/boxes/colony/vms/shill/containers-ext.nix)
runs a raw `systemd-nspawn` container (not a `my.containers` instance, not
NixOS) with its root on the `jam` LV, private user namespaces and a `ve-jam`
veth. It gets the `jam` customer prefix (`prefixes.jam`, `jam-cust` in DNS)
and SSH is forwarded to it from `shill`'s public IP port 60022.
## Notes
- `nix.settings.substituters` is forced to just `https://cache.nixos.org` —
`shill` sits next to the S3 cache on `object`, so it doesn't use it.
- [`hercules.nix`](../../../../nixos/boxes/colony/vms/shill/hercules.nix)
(Hercules CI agent + the `nix-cache-gc` timer for the S3 binary cache)
exists but is **currently disabled**: the file is not imported by
`shill/default.nix`.
## Notable config files
- [`nixos/boxes/colony/vms/shill/default.nix`](../../../../nixos/boxes/colony/vms/shill/default.nix) — VM config, networkd, firewall, `my.containers.instances`.
- [`nixos/boxes/colony/vms/shill/containers/default.nix`](../../../../nixos/boxes/colony/vms/shill/containers/default.nix) — container imports.
- [`nixos/boxes/colony/vms/shill/containers-ext.nix`](../../../../nixos/boxes/colony/vms/shill/containers-ext.nix) — the `jam` nspawn container.
- [`nixos/modules/containers.nix`](../../../../nixos/modules/containers.nix) — the `my.containers` module.
@@ -0,0 +1,41 @@
# chatterbox
The Matrix homeserver for `nul.ie` (Synapse) and its bridges to other chat networks.
[middleman](middleman.md) fronts it as `matrix.nul.ie` for clients and on `:8448` for
federation.
- **Source:** [`shill/containers/chatterbox.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/chatterbox.nix)
- **Host:** NixOS container on [`shill`](../README.md)
- **nixpkgs:** `mine`
## Role
### Synapse
`matrix-synapse` serves `nul.ie` at `https://matrix.nul.ie`, with Element at `element.nul.ie`.
Port 8008 carries client and federation traffic with forwarded headers, while a localhost manhole
uses port 9000. Registration and guest access are disabled; uploads, dynamic thumbnails and URL
previews are enabled, with preview fetching restricted to [middleman](middleman.md).
### Bridges
The box runs heisenbridge for IRC, `mautrix-whatsapp`, and two `mautrix-meta` instances for
Messenger and Instagram. The mautrix bridges use [colony-psql](colony-psql.md), default to
end-to-end encryption, and share the secret `doublepuppet.yaml` registration for double puppeting
onto `nul.ie`. The firewall admits ports 8008 and 8009 in addition to netdata.
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `chatterbox`).
## Notes
- Synapse's real database config lives in the `chatterbox/synapse.yaml` age secret — options
only merge at the top level, so the base config carries a dummy `sqlite3` block to satisfy
the module defaults. The signing key is also an age secret.
- `olm-3.2.16` is allowed via `permittedInsecurePackages` (a nixpkgs E2EE library issue).
- The bridge services get `ffmpeg` on their `PATH` for GIF→video conversion.
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/chatterbox.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/chatterbox.nix) — container definition, Synapse settings and all bridge configuration
@@ -0,0 +1,39 @@
# colony-psql
The shared PostgreSQL instance for colony services. Rather than each service running its own
database, the containers (and the `git` VM) connect here over the `ctrs` network.
- **Source:** [`shill/containers/colony-psql.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/colony-psql.nix)
- **Host:** NixOS container on [`shill`](../README.md)
- **nixpkgs:** `mine`
## Role
- **PostgreSQL 18** with TCP/IP enabled, reachable from the whole colony address space using `md5`
authentication. The firewall allows `5432`.
- Local `peer` auth maps `postgres`, `root`, `netdata` and `dev` to the `postgres` superuser via
the ident map.
- **netdata** with the Python PostgreSQL collector.
- Consumers wait for the database to accept connections with the `lib.my.systemdAwaitPostgres`
helper (e.g. `atticd`, `mastodon-init-db`, and `middleman`'s nginx as a DNS
bootstrap hack).
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `colony-psql`).
The assignment also has the alt name `colony-psql` (no `-ctr` suffix), which is what consumers
use as the database hostname.
## Consumers
- [object](object.md) — `hedgedoc` (and `atticd` when enabled) over
`colony-psql:5432`
- [toot](toot.md) — Mastodon's database (Mastodon currently disabled)
- [chatterbox](chatterbox.md) — the mautrix bridges (WhatsApp, Messenger, Instagram) via
Postgres URIs in their secret env files
- `git` VM — Gitea
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/colony-psql.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/colony-psql.nix) — container definition and PostgreSQL configuration
+29
View File
@@ -0,0 +1,29 @@
# gam
A game-server container currently dedicated to Terraria.
- **Source:** [`shill/containers/gam.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/gam.nix)
- **Host:** NixOS container on [`shill`](../README.md)
- **nixpkgs:** `mine`
## Role
Runs lightweight game servers directly as NixOS services, rather than as OCI containers on
[`whale2`](../../whale2.md).
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `gam`).
## Terraria server
`services.terraria` runs the dedicated server with its world at
`/var/lib/terraria/NotWorld.wld`. It creates large worlds automatically, uses the MOTD
"sup gamers", and disables UPnP. Additional settings such as the password come from the
`gam/terraria.conf` age secret used as the service configuration file.
`openFirewall` is enabled, and `estuary` forwards TCP and UDP port `7777` to the container.
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/gam.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/gam.nix) — container definition and the Terraria service
@@ -0,0 +1,56 @@
# jackflix
The media stack — acquisition, library, streaming and photos. Torrent traffic is routed through
an AirVPN WireGuard tunnel so downloads only flow while the VPN is up.
- **Source:** [`shill/containers/jackflix/`](../../../../../nixos/boxes/colony/vms/shill/containers/jackflix)
(`default.nix`, `networking.nix`)
- **Host:** NixOS container on [`shill`](../README.md) (bind-mounts `/mnt/media` read-write)
- **nixpkgs:** `mine`
## Role
| Service | Port | Purpose |
| --- | --- | --- |
| Jellyfin | `8096` | streaming, published as `jackflix.nul.ie` |
| Transmission | `9091` | BitTorrent client (`transmission_4`), published as `torrents.nul.ie` (SSO) |
| Jackett | `9117` | indexer aggregator, `jackett.nul.ie` (SSO) |
| FlareSolverr | — | Cloudflare challenge solver for Jackett |
| Radarr | `7878` | movies, `radarr.nul.ie` (SSO) |
| Sonarr | `8989` | TV, `sonarr.nul.ie` (SSO) |
| Jellyseerr (`seerr`) | `5055` | request portal, `gib.nul.ie` (`openFirewall` on) |
| PhotoPrism | `2342` | photos, `photos.nul.ie`; password auth, sqlite DB, originals/import under `/mnt/media/photoprism` |
| copyparty | `3923` | file sharing, `stuff.nul.ie`; serves `/mnt/media/public` (read-only to everyone) and `/priv` → `/mnt/media/stuff` (admin for `dev`), share creation, indexing (`e2dsa`/`e2t`), file-magic checks |
All published through [middleman](middleman.md) as shown. A shared `media` group plus a group-writable
umask on Radarr/Sonarr gives the apps coordinated access to the media volume.
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `jackflix`).
## VPN download path
[`networking.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/jackflix/networking.nix)
defines a `vpn` WireGuard netdev to **AirVPN NL** using a key and PSK from age secrets:
- Policy routing keeps colony traffic on the main table while everything else falls through to the
VPN's dedicated table, so the services stay reachable on the `ctrs` network while outbound
torrent traffic exits via AirVPN. `DNSDefaultRoute` is disabled on `host0`; the VPN provides DNS.
- `transmission` and `jackett` `bindsTo` `systemd-networkd-wait-online@vpn.service` — they only
run while the tunnel is up.
- AirVPN forwards a peer port to Transmission (`peer-port`); the firewall accepts it and drops
other new inbound TCP from `vpn`, while non-VPN input is limited to the service ports
(netdata, Transmission, Jackett, Radarr, Sonarr, Jellyfin, PhotoPrism) plus copyparty's `3923`
from the base config and Jellyseerr's `5055`.
## Storage
Media lives on the shared `/mnt/media` volume (bind-mounted read-write from `shill`); Transmission
downloads into `/mnt/media/downloads/torrents` with a `.incomplete` directory and configured
bandwidth and seed-ratio limits.
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/jackflix/default.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/jackflix/default.nix) — container definition and the media services
- [`nixos/boxes/colony/vms/shill/containers/jackflix/networking.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/jackflix/networking.nix) — AirVPN WireGuard netdev, policy routing and VPN firewall rules
@@ -0,0 +1,154 @@
# middleman
The front-end reverse proxy for the colony's public web services — the single ingress that
`estuary` DNATs HTTP/HTTPS (and Matrix federation on `:8448`) to. Terminates TLS with wildcard
certificates it issues itself, runs the Pocket ID identity provider with oauth2-proxy in front of
gated vhosts, and runs a librespeed backend and a Paseo relay.
- **Source:** [`shill/containers/middleman/`](../../../../../nixos/boxes/colony/vms/shill/containers/middleman)
(`default.nix`, `auth.nix`, `vhosts.nix`)
- **Host:** NixOS container on [`shill`](../README.md) (`my.containers` ephemeral nspawn on the
`ctrs` bridge; bind-mounts `/mnt/media` read-only for the static file vhosts)
- **nixpkgs:** `mine`
## Role
### nginx
The reverse proxy enables `vts`, `fancyindex`, Brotli, kTLS and a proxy cache. Its dynamic resolver
points at `estuary`, allowing upstreams named under `ams1.int.nul.ie` to resolve again at runtime.
All vhosts live in
[`vhosts.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/middleman/vhosts.nix). nginx
also waits for `colony-psql` through `systemdAwaitPostgres`, avoiding an early-boot DNS stall.
### ACME
`middleman` issues certificates for its own vhosts; it is not a shared CA for other boxes.
- `ams1.int.nul.ie` and its wildcard use a lego `exec` challenge that SSHes to
`pdns-file-records@estuary-vm`. This is the default `useACMEHost` certificate internally.
- `nul.ie`, `*.nul.ie`, `*.s3.nul.ie` and `*.slop.nul.ie` (for `slop-broker` previews) use
Cloudflare DNS. A `postRun` hook copies renewed material to the `mail` VM and runs
`mailcow-ssl-reload` there.
- Renewal reloads nginx; the `acme` group owns the secret files and includes the nginx user.
### Pocket ID
[Pocket ID](https://pocket-id.org) (`services.pocket-id`) is a passkey-only OpenID Connect
provider at `id.nul.ie`. Apps with OIDC support sign in with it directly (such as the
[`slop-broker` approvals web app](../../../../slop-broker.md#approvals-web-app)); the rest go
through [oauth2-proxy](#sso).
- Listens on `127.0.0.1:1411` behind nginx and keeps its SQLite database in `/var/lib/pocket-id`
(persisted by `my.tmproot`). The `middleman/pocket-id-encryption-key` secret encrypts it.
- The first admin is created at `/setup`; nginx only allows that page and its API from
internal networks (`lib.my.c.internalNets`). Further users are added from the admin UI.
**Declared groups and clients.** `my.pocket-id` (in
[`auth.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/middleman/auth.nix)) declares
user groups and OIDC clients; `pocket-id-sync` creates and updates them through the API on every
switch.
- It authenticates with the static API key `middleman/pocket-id-api-key`. nginx strips
`X-API-Key` from outside requests, so API keys only work from inside the container.
- Clients and groups that aren't declared are left alone, as is group membership: add users to
groups in the admin UI.
- A client's secret is an age file shared with the box that runs the app (or a key of an env
file). Generate it with `slop secret generate`; after rotating one, restart `pocket-id-sync`.
### SSO
[oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/) signs users in with Pocket ID (client
`sso`) for vhosts with no sign-in of their own.
- `ssoServer [ <groups> ]` in `vhosts.nix` gates a vhost with nginx `auth_request`, allowing
members of any of the given Pocket ID groups. The gated vhosts currently allow `admins`.
- Each gated vhost serves oauth2-proxy's `/oauth2/` endpoints itself. Its session cookie is
host-only, so other `.nul.ie` sites (including `*.slop.nul.ie` previews) never receive it.
Pocket ID's own session turns signing in to another gated vhost into a redirect.
- The `sso` client's callback URLs are derived from the gated vhosts.
- Sessions last a week. Every hour, oauth2-proxy uses a refresh token to check back with Pocket
ID without a passkey, and picks up the user's current groups. A disabled user is signed out at
the next check; someone removed from a group loses access once their access token expires (an
hour at most, Pocket ID's default).
- A location in a gated vhost with its own `add_header` would drop the refreshed session cookie
that `ssoServer` passes on.
- Its client secret and cookie secret are in the env file `middleman/oauth2-proxy.env`.
- `id.nul.ie` resolves to the container itself, so oauth2-proxy reaches Pocket ID through the
local nginx.
### librespeed
The frontend and backend are published as `speed.nul.ie` and `librespeed.ams1.int.nul.ie`, both
proxied to `localhost:8989`.
### Paseo relay
[`paseo-relay`](https://github.com/getpaseo/paseo-relay) (the `my.paseo-relay` module, package
`pkgs/paseo-relay.nix`) relays end-to-end encrypted traffic between Paseo daemons and the Paseo
app, in place of Paseo's hosted relay.
- Single node with no Erlang distribution, listening on `127.0.0.1:4000` and published as
`paseo-relay.nul.ie`. It keeps no state, so a restart only drops connections.
- The relay can't read or forge messages, so the vhost is open to the world. Its Prometheus
`/metrics` is not exposed; `/health` and `/ready` are.
- `slop.nul.ie` serves Paseo's web app as static files, taken from the same patched Paseo package
(our Jujutsu fork) as the daemon, so deploy it together with
[`slop-cannon`](../../../home/slop-cannon.md). Pairing links from our daemon point there, and the app connects through the relay,
so nothing from `paseo.sh` is needed in the browser.
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `middleman`).
The firewall allows `http`, `https` and `8448` (Matrix federation). A small nftables SNAT rule
rewrites outbound IPv6 to the container's own address on `host0`.
## Published vhosts
Everything is under `*.nul.ie` with the public wildcard cert unless noted; defaults applied to
all vhosts are `onlySSL`, kTLS and HTTP/2. "SSO" = gated behind [oauth2-proxy](#sso).
| Host | Upstream | Notes |
| --- | --- | --- |
| `nul.ie` (`_`, default) | static | landing page (`index.html`, CV PDF, SSH pubkey); serves Matrix `.well-known`s and redirects `webfinger`/`nodeinfo`/`host-meta` → `toot.nul.ie`, `atproto-did` → `pds.nul.ie`; `forceSSL` (plain HTTP redirects to HTTPS) |
| `localhost` | — | loopback-only VTS status page at `/status` (scraped by netdata); plain HTTP |
| `id.nul.ie` | `localhost:1411` | Pocket ID; `/setup` only from internal networks; `X-API-Key` stripped |
| `netdata-colony.nul.ie` | `<host>.ams1.int.nul.ie:19999` | netdata fan-out over `vm`, `fw`, `ctr`, `oci`, `http`, `jackflix-ctr`, `chatterbox-ctr`, `colony-psql-ctr`; **SSO** |
| `pass.nul.ie` | `vaultwarden-ctr:8080` | [vaultwarden](vaultwarden.md); `/notifications/hub` proxied with websockets |
| `matrix.nul.ie` | `chatterbox-ctr:8008` | [chatterbox](chatterbox.md) Synapse client + federation; also listens on `:8448` as federation `default_server`; `= /` redirects to Element; serves Matrix `.well-known`s |
| `element.nul.ie` | static `element-web` | Element configured for the `nul.ie` homeserver |
| `torrents.nul.ie` | `jackflix-ctr:9091` | Transmission ([jackflix](jackflix.md)); **SSO** |
| `jackett.nul.ie` | `jackflix-ctr:9117` | **SSO** |
| `radarr.nul.ie` | `jackflix-ctr:7878` | **SSO**; websockets |
| `sonarr.nul.ie` | `jackflix-ctr:8989` | **SSO**; websockets |
| `gib.nul.ie` | `jackflix-ctr:5055` | Jellyseerr requests |
| `jackflix.nul.ie` | `jackflix-ctr:8096` | Jellyfin; `/socket` websockets; `/` redirects to `/web/` |
| `toot.nul.ie` | `toot-ctr:80` | Mastodon — **upstream currently disabled**, see [toot](toot.md) |
| `pds.nul.ie` | `toot-ctr:3000` | Bluesky PDS ([toot](toot.md)); websockets |
| `stuff.nul.ie` | `jackflix-ctr:3923` | copyparty |
| `public.nul.ie` (+ alias `p.nul.ie`) | static `/mnt/media/public` | fancyindex file listing; `addSSL` so plain HTTP also works |
| `mc-map.nul.ie` | `simpcraft-oci:8100` | Minecraft map (OCI container on [`whale2`](../../whale2.md#game-servers)) |
| `mc-rail.nul.ie` | `simpcraft-oci:3876` | Minecraft railway map ([`whale2`](../../whale2.md#game-servers)) |
| `mc-map-kink.nul.ie` | `kinkcraft-oci:8100` | Minecraft map ([`whale2`](../../whale2.md#game-servers)) |
| `speed.nul.ie` | `localhost:8989` | librespeed |
| `librespeed.ams1.int.nul.ie` | `localhost:8989` | librespeed on the internal domain (internal wildcard cert) |
| `paseo-relay.nul.ie` | `localhost:4000` | Paseo relay; websockets with long timeouts; `/metrics` blocked |
| `slop.nul.ie` | static Paseo web app | falls back to `index.html`; precompressed files served as-is |
| `approve.slop.nul.ie` | `palace.h.nul.ie:8095` | [`slop-broker`](../../../../slop-broker.md#approvals-web-app)'s approvals web app, which handles sign-in itself (Pocket ID) |
| `md.nul.ie` | `object-ctr:3000` | HedgeDoc; websockets |
| `pb.nul.ie` | `object-ctr:8088` | wastebin |
| `photos.nul.ie` | `jackflix-ctr:2342` | PhotoPrism; websockets |
| `pront.nul.ie` | `stream-hi.h.nul.ie:5000` | OctoPrint on the home network ([`stream`](../../../home/stream.md)); `/webcam/` → `:5050`; **SSO** |
| `hass.nul.ie` | `hass-ctr.h.nul.ie:8123` | [Home Assistant](../../../home/sfh/containers/hass.md) (home network); websockets |
| `hass-john.nul.ie` | `john-valorant-tun.ams1.int.nul.ie:8123` | remote Home Assistant over the point-to-point tunnel; websockets |
| `minio.nul.ie` | `object-ctr:9001` | MinIO console; `/ws` websockets |
| `s3.nul.ie` (+ `*.s3.nul.ie`) | `object-ctr:9000` | MinIO S3 API (virtual-host style via the `*.s3` wildcard cert); `/gitea/packages/` has a hack forcing the correct `Content-Type` for Docker image manifests |
| `nix-cache.nul.ie` | `object-ctr:5000` | Harmonia Nix binary cache; `.narinfo`/`nar/`/`serve/` paths get immutable `Cache-Control`/`Expires` headers |
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/middleman/default.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/middleman/default.nix) — container definition: nginx, ACME, librespeed, Paseo relay, secrets
- [`nixos/boxes/colony/vms/shill/containers/middleman/auth.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/middleman/auth.nix) — Pocket ID, its declared groups and clients, oauth2-proxy
- [`nixos/boxes/colony/vms/shill/containers/middleman/vhosts.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/middleman/vhosts.nix) — all virtual hosts, the `ssoServer` helper, and the `.well-known` tree
- [`nixos/boxes/colony/vms/shill/containers/middleman/default.html`](../../../../../nixos/boxes/colony/vms/shill/containers/middleman/default.html) — default vhost landing page
@@ -0,0 +1,37 @@
# object
Object storage and the Nix binary cache, plus HedgeDoc and wastebin.
- **Source:** [`shill/containers/object.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/object.nix)
- **Host:** NixOS container on [`shill`](../README.md) (bind-mounts `/mnt/minio` and
`/mnt/nix-cache` read-write)
- **nixpkgs:** `mine`. The MinIO server, CLI, and service module come from `mine-stable`.
## Role
| Service | Port | Purpose |
| --- | --- | --- |
| MinIO | `9000` (S3) / `9001` (console) | S3-compatible object storage, `s3.nul.ie` + `*.s3.nul.ie` (virtual-host style via `MINIO_DOMAIN`), console at `minio.nul.ie`; region `eu-central-1`; data on the `/mnt/minio` XFS volume |
| Harmonia | `5000` | Nix binary cache at `nix-cache.nul.ie` — `harmonia-dev` cache serves `shill`'s `/nix/store` out of a dedicated store view rooted at `/var/lib/harmonia` (bind-mounted from `/mnt/nix-cache`), signed with the `nix-cache.key` secret; a `harmonia` user with authorized keys exists for cache pushes, including `slop-broker`'s on `palace`, which is restricted to the store protocol and GC roots (`services.slop-broker-cache`, see [`slop-broker.md`](../../../../slop-broker.md#binary-cache)) |
| HedgeDoc | `3000` | collaborative markdown notes at `md.nul.ie`; Postgres on [colony-psql](colony-psql.md); anonymous edits but no anonymous notes, email login, no open email registration |
| wastebin | `8088` | pastebin at `pb.nul.ie` |
| atticd | `8069` | **currently disabled** (`services.atticd.enable = false`) — an alternative Nix cache that would store locally and sit behind `nix-cache.nul.ie`; config (including the `object/atticd.env` secret) is kept around |
Everything public is fronted by [middleman](middleman.md) (see its vhost table). The
`minio-client` is installed and the user's `~/.mc/config.json` points at an age-secret config.
`minio-2025-10-15T17-29-55Z` is allowlisted via `permittedInsecurePackages` (flagged as a TODO).
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `object`).
## Backing services
- [colony-psql](colony-psql.md) — HedgeDoc's database (atticd too, when enabled).
- MinIO buckets back other boxes' services: Gitea LFS/packages (with the `middleman` MIME hack
for Docker manifests), Mastodon's `mastodon` bucket and the Bluesky PDS `pds` bucket on
[toot](toot.md).
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/object.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/object.nix) — container definition and all services
@@ -0,0 +1,34 @@
# qclk
A WireGuard management appliance for the `qclk` network — it terminates the `management`
tunnel and routes/NATs the `qclk` prefix. No service daemon is currently defined in the config;
the container provides the network plumbing and opens the API port.
- **Source:** [`shill/containers/qclk/`](../../../../../nixos/boxes/colony/vms/shill/containers/qclk)
(`default.nix`)
- **Host:** NixOS container on [`shill`](../README.md)
- **nixpkgs:** `mine`
## Role
- **WireGuard `management` interface** — listens on UDP `51821` (`lib.my.c.colony.qclk.wgPort`,
allowed through the firewall; `estuary` port-forwards it here) with the private key from the
`qclk/wg.key` age secret. Managed devices are static peers, each pinned to its own address in the
`qclk` prefix; the peer list currently has a single entry.
- **Routing/NAT** — `shill` routes the `qclk` prefix to this container, and outbound traffic from
`host0` into `management` is
SNATed to the container's `qclk` address. Forwarding into `management` is accepted from the
AS211024 trusted IPv4 ranges (`lib.my.c.as211024.trusted.v4`).
- **API port** — TCP `8080` is accepted on the `management` interface (`apiPort`), but note
`services = { }`: whatever serves the qclk API is not defined in this configuration today.
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `qclk`).
Two assignments: `internal` on the `ctrs` network like the other containers, and `qclk` on the
`management` WireGuard interface (IPv4 only, no DNS name).
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/qclk/default.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/qclk/default.nix) — container definition: WireGuard netdev, peer list and firewall rules
@@ -0,0 +1,47 @@
# toot
Federated-social container. Despite the name, the only service actually running is a **Bluesky
PDS** — the Mastodon instance ("toots") is **currently disabled**.
- **Source:** [`shill/containers/toot.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/toot.nix)
- **Host:** NixOS container on [`shill`](../README.md)
- **nixpkgs:** `mine`
## Role
### Bluesky PDS
The active service listens on port 3000 as `pds.nul.ie`, fronted by [middleman](middleman.md),
which also redirects `/.well-known/atproto-did` here. It requires invites, applies an upload-size
limit, and stores blobs in [object](object.md)'s `pds` MinIO bucket. Federation uses the standard
Bluesky services and crawlers. `toot/pds.env` supplies secrets, including S3 credentials, and mail
comes from `pds@nul.ie`.
### Mastodon
Mastodon is disabled with `services.mastodon.enable = false`, but its configuration remains:
- `nul.ie` is the local domain and `toot.nul.ie` the web domain.
- PostgreSQL runs on [colony-psql](colony-psql.md), with local Redis and SMTP through `mail.nul.ie`.
- Media uses the `mastodon` MinIO bucket, a configured streaming-process pool, and periodic cleanup.
- [middleman](middleman.md) still proxies the dead vhost and `.well-known` endpoints.
The removed `otpSecretFile` option must be addressed before the service can return.
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `toot`).
The firewall allows `http` (the Mastodon nginx vhost) and the PDS port `3000` besides netdata.
## Notes
- The local nginx still carries the Mastodon virtual host (`toot.nul.ie`) with proxy-header
overrides for being behind `middleman` — part of the preserved-but-disabled Mastodon setup.
- `mastodon-init-dirs` appends the S3 secret key to Mastodon's `.secrets_env` (the module has no
option for a secret-key file), and `mastodon-init-db` waits for `colony-psql` — moot while
Mastodon is disabled.
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/toot.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/toot.nix) — container definition; active PDS config and the preserved (disabled) Mastodon config
@@ -0,0 +1,33 @@
# vaultwarden
[Vaultwarden](https://github.com/dani-garcia/vaultwarden), a Bitwarden-compatible password
manager, published as `pass.nul.ie` through [middleman](middleman.md).
- **Source:** [`shill/containers/vaultwarden.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/vaultwarden.nix)
- **Host:** NixOS container on [`shill`](../README.md)
- **nixpkgs:** `mine`
## Role
- **vaultwarden** — HTTP on `[::]:8080`, WebSocket notifications on `3012` (both allowed through
the firewall). Web vault enabled, signups disabled, Bitwarden push notifications enabled
(`PUSH_ENABLED`). `DOMAIN` is `https://pass.nul.ie`.
- **SMTP** via `mail.nul.ie:587` (STARTTLS) as `pass@nul.ie`; credentials and other sensitive
settings come from the `vaultwarden/config.env` age secret.
- **Backups** — a `borgbackup` job pushes `/var/lib/vaultwarden` to rsync.net
using a repokey-encrypted repository; its passphrase and SSH key come from secrets, and the job
keeps daily, weekly and monthly archives according to its configured retention policy.
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `vaultwarden`).
## Persistence
`/var/lib/vaultwarden` is persisted through `my.tmproot.persistence` — like the other
`shill` containers the root is ephemeral and real state lives under `/persist` (bind-mounted
from the host's `/persist/containers/vaultwarden`).
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/vaultwarden.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/vaultwarden.nix) — container definition, service config and the borgbackup job
@@ -0,0 +1,34 @@
# waffletail
The colony Tailscale node: a subnet router and exit node that advertises the colony prefixes
into the tailnet.
- **Source:** [`shill/containers/waffletail.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/waffletail.nix)
- **Host:** NixOS container on [`shill`](../README.md)
- **nixpkgs:** `mine`
## Role
### Tailscale
The node authenticates to `hs.nul.ie` with the secret `tailscale-auth.key`. It disables Tailscale's
netfilter management, advertises itself as an exit node and advertises the colony IPv4/IPv6 ranges,
but does not accept routes. UDP port 41641 is open and forwarded here by `estuary`.
### Routing and firewall
`shill` routes the Tailscale prefixes to this container.
The repository's nftables rules trust `tailscale0`, permit colony-sourced forwarding into the
tailnet, and SNAT tailnet traffic leaving through `host0` unless its destination is already within
colony.
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `waffletail`).
Two assignments: `internal` on the `ctrs` network like the other containers, and `tailscale` for
its addresses on the tailnet itself (no DNS name).
## Notable config files
- [`nixos/boxes/colony/vms/shill/containers/waffletail.nix`](../../../../../nixos/boxes/colony/vms/shill/containers/waffletail.nix) — container definition, Tailscale setup and forward/NAT rules
+81
View File
@@ -0,0 +1,81 @@
# whale2
The colony podman/OCI host, dedicated to game servers (kept off `shill` so
container churn and resource use stay isolated).
- **Source:** [`nixos/boxes/colony/vms/whale2/`](../../../nixos/boxes/colony/vms/whale2)
(`default.nix`, `valheim.nix`, `minecraft/`, `enshrouded.nix`)
- **Host:** VM on `colony`
- **nixpkgs:** `mine`
## Role
### Container runtime
OCI containers run under podman (`virtualisation.oci-containers`) with the netavark backend and
`firewall_driver = "none"`, leaving firewall management to `my.firewall`.
### Routable game servers
Each server gets an address from `extraAssignments` (`valheim-oci`, `simpcraft-oci`, …) on the
`colony` netavark network. That network is backed by the `oci` interface and `prefixes.oci` v4/v6
ranges; `lib.my.dockerNetAssignment` supplies the address through `--network=colony:ip=…`.
`estuary` forwards the public game ports, while IPv6 reaches the containers directly.
### Storage
`/var/lib/containers` is a dedicated XFS disk with project quotas.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `whale2`).
## Game servers
The OCI containers are documented here (they have no pages of their own).
Their per-container `extraAssignments` on the `oci` network are listed in the generated
[network assignments](../../networking.md#box-assignments) table. Ports below are the public ones
forwarded by `estuary`.
| Container | Ports | Status |
|---|---|---|
| `valheim` | `2456-2457`/udp | running |
| `simpcraft` | `25565` tcp+udp | running |
| `simpcraft-staging` | `25566` tcp | **disabled** (commented out) |
| `enshrouded` | `15636-15637`/udp | **disabled** (`enshrouded.nix` not imported) |
| `kevcraft` | `25567` tcp+udp | running |
| `kinkcraft` | `25568` tcp+udp | running |
| `graeme` | `25569` tcp+udp | running |
- **valheim** ([`valheim.nix`](../../../nixos/boxes/colony/vms/whale2/valheim.nix)) —
`community-valheim-tools/valheim-server`, public server "amogus sus", world `simpland3`
(previous world `simpland2` retained in the `valheim_data` volume),
allow-listed Steam IDs, password from agenix.
- **simpcraft** ([`minecraft/`](../../../nixos/boxes/colony/vms/whale2/minecraft)) —
`itzg/minecraft-server` (self-built `git.nul.ie/dev/craftblock` image),
Modrinth "Simpcraft" modpack, whitelist + ops.
- **simpcraft-staging** — the same setup pinned to an older pack version, currently commented out.
- **kevcraft** — vanilla Minecraft 1.20.1, extra op.
- **kinkcraft** — same Simpcraft modpack as `simpcraft`.
- **graeme** — vanilla Minecraft on hard difficulty with its own whitelist.
- **enshrouded** ([`enshrouded.nix`](../../../nixos/boxes/colony/vms/whale2/enshrouded.nix)) —
`sknnr/enshrouded-dedicated-server` ("UWUshrouded"); the file exists but is
commented out of `whale2`'s `imports`, so the server is down (its forwards
and DNS records remain).
The Minecraft containers share one whitelist/ops list and agenix env file
(`whale2/simpcraft.env`, which also carries the RCON password).
## Backups
A local borg job (`services.borgbackup.jobs.simpcraft`) archives the `simpcraft` world frequently,
offset from its autosave timer, into `/var/lib/containers/backup/simpcraft`. It uses `mcrcon` to
`save-off`/`save-on` around each run and keeps a short history for quick world rollback rather than
disaster recovery; the `oci` LV itself is covered by `colony`'s `borgthin`.
## Notable config files
- [`nixos/boxes/colony/vms/whale2/default.nix`](../../../nixos/boxes/colony/vms/whale2/default.nix) — VM config, podman/netavark setup, `extraAssignments`.
- [`nixos/boxes/colony/vms/whale2/valheim.nix`](../../../nixos/boxes/colony/vms/whale2/valheim.nix) — Valheim server.
- [`nixos/boxes/colony/vms/whale2/minecraft/default.nix`](../../../nixos/boxes/colony/vms/whale2/minecraft/default.nix) — the Minecraft servers + world backup job.
- [`nixos/boxes/colony/vms/whale2/enshrouded.nix`](../../../nixos/boxes/colony/vms/whale2/enshrouded.nix) — Enshrouded server (disabled, not imported).
+54
View File
@@ -0,0 +1,54 @@
# Home site
The home network (domain `h.nul.ie`): a redundant pair of routers in front of a VM host, an
NVMe-oF storage target, an IoT container host, and a workstation. The two routers — `river` (a VM)
and `stream` (a physical box) — are built from one shared
[`routing-common`](../../../nixos/boxes/home/routing-common) definition as an active/backup VRRP
pair, and everything clients touch (gateway, DNS) is a floating VIP that follows the master.
- **Source:** [`nixos/boxes/home/`](../../../nixos/boxes/home)
## Boxes
| Box | Role | Host |
|---|---|---|
| [`palace`](palace.md) | VM host | physical |
| [`river`](river.md) | Primary router (VRRP pair with `stream`) | VM on `palace` |
| [`stream`](stream.md) | Secondary router (VRRP pair with `river`) | physical |
| [`cellar`](cellar.md) | NVMe-oF / SPDK storage target | VM on `palace` |
| [`sfh`](sfh/README.md) | NixOS container host (containers on its page) | VM on `palace` |
| [`slop-cannon`](slop-cannon.md) | Coding agents, driven remotely through Paseo; on `untrusted` | VM on `palace` |
| [`castle`](castle.md) | Workstation / gaming desktop | physical |
## Router VIPs
Clients use per-VLAN floating VIPs as their gateway and DNS server; `keepalived` moves them between
`river` and `stream`. The addresses, DHCP/RA behavior and failover mechanics are documented once in
[Router VIPs](../../networking.md#router-vips) and [Router HA](../../networking.md#router-ha).
## Networks
The site separates core management, high-MTU trusted traffic, general trusted traffic, untrusted
clients and the two WAN paths. VLAN IDs, prefixes, MTUs and router addressing live in the canonical
[`home` section of networking.md](../../networking.md#home).
## Switch fabric
The boxes hang off four hand-configured switches: `jim` and `dave` (MikroTik, RouterOS), `brian`
(Ubiquiti, UniFi), and the L2-managed Zyxel switch `shytzel`. They are **not** managed by this
flake. The physical topology, VLAN map, the Digiweb WAN path (trunked VLAN 10 + PVID 140 at the ONT
edge), and the multi-ONT plan are documented in [switches.md](switches.md). Router attachments
are described in [Router HA](../../networking.md#router-ha); tested failure scenarios and checks
for maintenance are documented in [router-failover.md](router-failover.md).
## Wireless APs
The Wi-Fi APs — `vibe` (MikroTik cAP ax) and `wave` (Cudy AX3000 on OpenWrt) — are dumb APs, also
**not** managed by this flake. The shared VLAN-trunk design, SSIDs, per-AP management addressing,
and the OpenWrt flash/config for `wave` are in [aps.md](aps.md).
## 5G WWAN
A Quectel RM500U-EA USB modem with a GoMo SIM is being evaluated as a replacement for `stream`'s
Virgin Media WAN. It is bench-tested only and not yet referenced by the flake; the module settings
it needs, the APN gotcha and the CGNAT consequences are in [wwan.md](wwan.md).
+162
View File
@@ -0,0 +1,162 @@
# Home wireless APs
Reference for the home Wi-Fi access points. Like the switches ([switches.md](switches.md)), these
are **not** managed by this flake — they are configured on-device (RouterOS on the MikroTik,
OpenWrt/UCI on the Cudy). This file documents the shared VLAN/trunk design and each AP.
Only the DNS records live in the flake
([`nixos/boxes/home/routing-common/dns.nix`](../../../nixos/boxes/home/routing-common/dns.nix),
`h.nul.ie` zone). Everything else here is applied by hand on the device.
## The APs
| | vibe | wave |
|---|---|---|
| Model | MikroTik **cAP ax** (`cAPGi-5HaxD2HaxD`) | Cudy **AX3000** (OpenWrt id `cudy,ap3000-v1`) |
| OS | RouterOS 7.25.1 | OpenWrt 25.12.x (MT7981B / Filogic 820) |
| RouterBOOT | 7.25.1 | — |
| Radio | 2×2 both bands | 2×2 both bands (2 spatial streams) |
| Uplink | trunk (multi-port; `ether2` is a wired LAN port) | single **2.5 GbE** trunk |
| Management | core/hi/lo `.15` | core/lo `.14` (**not** `hi`; see below) |
Both mirror the same two SSIDs. `wave` replaced an older AP of the same name; the new one is the
Cudy running OpenWrt.
> **Note on "AX3000":** MT7981B is 2×2 (2 spatial streams). The "3000" is *aggregate* Mbps —
> 574 (2.4 GHz 2ss) + 2402 (5 GHz 2ss @ **160 MHz**) — not three streams. `iw` confirms 2×2
> (`Available Antennas TX/RX 0x3`; "3 streams: not supported"). 160 MHz is what earns the "3000".
## Shared design (dumb AP)
Every AP is a **dumb AP**: it bridges wireless clients onto the right VLAN and does **no** routing,
DHCP, RA or firewalling. The home routers (`river`/`stream`) own DHCP/RA/gateway (per-VLAN VRRP VIPs)
and firewalling. The uplink is a **tagged trunk**:
| VLAN | `lib.my.c.home.vlans` | Role | AP use |
|---|---|---|---|
| — (native) | `core` | switch/fabric management (1500) | backup management (untagged) |
| 100 | `hi` | trusted LAN, **high-MTU** (jumbo 9000) | `vibe` management (it's jumbo-capable) |
| 110 | `lo` | trusted LAN (1500) | main SSID `wlan0`; `wave` management |
| 120 | `untrusted` | guest network | guest SSID `wlan1` |
`hi` and `lo` are both **trusted** client VLANs — the only difference is MTU (`hi` carries jumbo
9000, `lo` is standard 1500). An AP puts its own management on whichever it can do: `vibe` (jumbo)
sits on `hi`, `wave` (eth0 capped at 2026) sits on `lo`. The main SSID lands on `lo` because Wi-Fi
clients are 1500 regardless.
### SSIDs
| SSID | Bands | Security | VLAN |
|---|---|---|---|
| `wlan0` (main) | 5 GHz + 2.4 GHz | WPA2/WPA3-PSK (`sae-mixed`) | 110 (`lo`) |
| `wlan1` (guest) | 2.4 GHz | WPA2-PSK (`psk2`) | 120 (`untrusted`) |
**Passphrases are never stored in this repo.** `vibe` is the source of truth; read them out-of-band
with `ssh admin@vibe '/interface wifi export show-sensitive'` (`.passphrase=` prints **unquoted**).
## vibe (MikroTik cAP ax)
RouterOS, one hardware-offloaded bridge `main` with `vlan-filtering=yes`. Access: `ssh admin@vibe`
— key auth for `admin` is installed (`~/.ssh/id_rsa`), with `admin`/`admin` as a fallback.
`wifi-qcom` matches the RouterOS version. Follow the shared
[upgrade procedure](switches.md#upgrades) for backups and version checks. A DFS channel
availability check can delay the 5 GHz radio after reboot while 2.4 GHz is already running.
- **Uplink `ether1`** — trunk, tagged VLANs 100/110/120; native/untagged is the default VLAN 1
(PVID, no IP). `ether2` is a wired **access port** on VLAN 110 (`lo`). `l2mtu 9214`.
- **Radios** — `wifi1` (5 GHz, 20/40/80) + `wifi2` (2.4 GHz, 20/40) both broadcast `wlan0`
(WPA2/WPA3-PSK), untagged onto VLAN 110. `wifi3` is a virtual AP on `wifi2` broadcasting `wlan1`
(WPA2-PSK), untagged onto VLAN 120. `country=Ireland`.
- **Bridge VLANs** — 100 tagged `main,ether1`; 110 tagged `main,ether1` + untagged
`ether2,wifi1,wifi2`; 120 tagged `main,ether1` + untagged `wifi3`.
- **Roaming** — 802.11k/v via a `/interface wifi steering` profile (`rrm=yes wnm=yes`,
`neighbor-group=home-aps`) assigned to `wifi1`/`wifi2`/`wifi3`.
- **Resolver** — the hi VIP `192.168.71.254` / `2a0e:97c0:4d0:1::ffff`.
### Management
Management uses host `.15`: `192.168.64.15` on native/core as a backup,
`192.168.68.15/22` + `2a0e:97c0:4d0:1::1:6` on `hi` VLAN 100, and
`192.168.72.15/21` + `2a0e:97c0:4d0:2::1:6` on `lo` VLAN 110. The `hi` address holds the default
route through its VIP; `untrusted` has no address. With `l2mtu 9214`, `vibe` can use the jumbo
`hi` network unlike `wave`.
Like the switches, `vibe` is **pure L2 and must not route** — `ip-forward=no`, IPv6 `forward=no`,
`accept-router-advertisements=no`, `ra-lifetime=0`. RouterOS ships these forwarding-on and then
advertises itself as an IPv6 router; re-check after any upgrade. See
[switches.md#switches-must-not-route](switches.md#switches-must-not-route) for the rationale and
commands.
## wave (Cudy AX3000, OpenWrt)
Single-port AP, so the port is a VLAN **trunk** carrying management + both SSIDs.
### Management addressing
`wave` takes host `.14`, on **`lo` (primary) and `core` (backup)** — deliberately **not** `hi`,
unlike the switches and `vibe`. `hi` is the jumbo (9000) VLAN, but `wave`'s eth0 caps at 2026 (see
MTU note), so there's no reason to put it there; `lo` is 1500 with a proper VRRP VIP for the default
route + resolver, and `core` has no VIP/v6 so it can only be a backup. No IP on `untrusted`. Records
in `dns.nix`:
| Name | VLAN | Address |
|---|---|---|
| `wave-core` | core (native/untagged) | `192.168.64.14/24` — backup, like the switches (no VIP → backup only) |
| `wave` | lo 110 | `192.168.72.14/21`, `2a0e:97c0:4d0:2::1:5` — primary; holds the default route + resolver (lo VIP `192.168.79.254` / `2a0e:97c0:4d0:2::ffff`) |
**Firewall:** management (SSH/LuCI) reachable from `core`/`lo` only; `untrusted` is a separate
zone with `input REJECT` (and `wave` has no IP there) — **no management via the guest VLAN**.
### brian switch port
`wave` hangs off **brian** (UniFi). Its port is a **trunk**: tagged VLAN **110/120** (`lo` + guest),
and **native/untagged = core** (the fabric's management VLAN, carrying `wave-core`). VLAN 100 (`hi`)
is **not** needed here — `wave` isn't on `hi` (see Management addressing). Configure via the UniFi
controller (brian has no CLI); see [switches.md](switches.md).
### Flashing OpenWrt (Cudy AX3000 / `cudy_ap3000-v1`)
Hardware: MT7981B, 512 MB RAM, 256 MB SPI-NAND, 1× 2.5 GbE (RTL8221B), 2×2 WiFi 6.
> ⚠️ **Serial caveat:** units with a serial starting `2543…` (post ~Nov 2025) use a different flash
> chip and can brick with older firmware. Match firmware to the unit.
OpenWrt can't be flashed directly over stock. Two-stage, via a Cudy **transition** firmware (Cudy
OpenWrt download page / `support@cudy.com`; `warnning.txt` in that bundle has the steps):
1. Stock Cudy UI: update to **≥ 2.4.7** (adds TFTP `recovery.bin` recovery), then flash the Cudy
**intermediate** firmware (`cudy_ap3000-v1-sysupgrade_*.bin`), "keep settings" **unchecked**.
It reboots into an OpenWrt-based build at `192.168.1.1` (SSH `root`, empty password).
2. From there, `sysupgrade -n` to vanilla OpenWrt (`…-cudy_ap3000-v1-squashfs-sysupgrade.bin` from
`downloads.openwrt.org`; this release ships **no** factory image — sysupgrade only).
Stock default (out of box) is a DHCP client falling back to **`192.168.10.254`**; the stock UI is a
customised LuCI (only 80/443, no SSH) with a first-boot "create admin password" wizard — so the
stock-side flashing is done from a browser, not headless.
### On-device config notes
#### Wireless packages
The package manager is `apk`, not `opkg`. Wi-Fi uses the full `wpad-mbedtls` package so all SSIDs
can enable 802.11k/v (`ieee80211k` + `bss_transition`). Replacing `wpad-basic-mbedtls` live leaves
the mac80211 interfaces in a start/teardown loop that reloads cannot recover; reboot after
`apk add wpad-mbedtls`.
- Radios: `radio0` = 2.4 GHz, `radio1` = 5 GHz (keyed by `band`, don't assume). 5 GHz is pinned to
**channel 36 / HE160** (any 160 MHz block in IE is DFS; ch36 has the shortest ~60 s CAC).
- Bridge: `br-lan` with `vlan_filtering`, single port `eth0` — tagged `110/120`, untagged/PVID
VLAN 1 (= native/core). SSIDs attach via `network` = `lo`/`untrusted` (= `br-lan.110`/`.120`).
- Dumb-AP: no DHCP pools, `odhcpd.maindhcp=0`, `delegate=0` on the L3 interfaces.
- **MTU:** all interfaces are **1500**. The `mtk_eth_soc` 2.5 GbE (`eth0`) caps at **2026 bytes**
(`ip link set eth0 mtu 9000` → `SIOCSIFMTU: Invalid argument`), so `wave` can't join `hi`'s jumbo
(9000) fabric like `vibe` does — which is precisely **why `wave` is managed on `lo`, not `hi`**
(see Management addressing). Nothing on `wave` needs > 1500.
- **LuCI:** enabled, login `root` / `admin`. **SSH:** key-only (`PasswordAuth`/`RootPasswordAuth off`).
- `iperf3` installed for throughput testing.
### Access
- SSH: `ssh root@wave` (key-only; `wave`/`wave-core` resolve once `dns.nix` is deployed).
- LuCI: `http://192.168.72.14/` (or `http://wave/`), `root` / `admin`.
+63
View File
@@ -0,0 +1,63 @@
# castle
The home workstation / gaming desktop. Diskless-style: it netboots from `river` and keeps its
root storage on NVMe-oF volumes from `cellar`.
- **Source:** [`nixos/boxes/home/castle/`](../../../nixos/boxes/home/castle) (`default.nix`)
- **Host:** physical
- **nixpkgs:** `mine`
## Hardware
| Component | Inventory |
|---|---|
| Platform | ASUS ProArt X670E-CREATOR WIFI |
| CPU | AMD Ryzen 9 7950X (16 cores / 32 threads) |
| Memory | 64 GiB |
| Graphics | Integrated AMD Radeon graphics |
| Network | Mellanox ConnectX-4 100G, Aquantia AQC113CS 10G, Intel I225-V 2.5G and MediaTek MT7922 Wi-Fi 6E controllers |
| System storage | No local root disk; the box netboots and uses the SPDK NVMe-oF namespace exported by `cellar` |
## Role
### Desktop
The AMD desktop runs the GUI stack (`my.gui.enable`, Sway/Wayland via home-manager), low-latency
PipeWire, Bluetooth and Thunderbolt. Local `libvirtd`/`virt-manager` and the IOMMU are enabled, but
the box has no VFIO or GPU-passthrough configuration.
### Netboot
With `my.netboot.client.enable`, the firmware iPXE-boots from the 2.5G NIC. Kea matches
`et2.5g`'s MAC and directs it to `boot.h.nul.ie` on [`river`](river.md).
### NVMe-oF root
`/nix`, `/persist` and `/home` are `/dev/nvmeof/*` LVs in `cellar`'s
`nqn.2016-06.io.spdk:castle` namespace (`my.nvme.boot`, RDMA). The initrd brings
up `et100g`/`lan-hi` with `roceBootModules`; the running network keeps
`KeepConfiguration=static` so networkd does not drop the storage address. The root filesystem is a
size-limited tmpfs (`my.tmproot`).
### Other configuration
Both firewalls are disabled on this trusted `hi` desktop. Other settings include `binfmt`
emulation for `aarch64-linux`/`armv7l-linux`, `recursive-nix`, Wireshark and `rdma-core`/`qperf`;
a `drm-amd-display` flicker patch remains commented out.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `castle`).
## Networking
- `et100g` (100G, MTU 9000) carries `lan-hi` (the `hi` assignment, also pinned by a kea
reservation on its MAC) and `lan-lo`.
- `lan-lo` is a secondary network attachment: DHCPv4 with `UseGateway`/`UseDNS` off and RAs
accepted with gateway/DNS use off — present for reaching `lo` devices, never a default route.
- `et2.5g` (netboot) and `et10g` are renamed but carry no network config.
## Notable config files
- [`nixos/boxes/home/castle/default.nix`](../../../nixos/boxes/home/castle/default.nix) — box
config: netboot/NVMe-oF boot, 100G networking, GUI/audio, virtualisation.
+115
View File
@@ -0,0 +1,115 @@
# cellar
The home storage target. A VM on `palace` that drives three passed-through NVMe disks with SPDK
and exports them over NVMe-oF/RDMA — `river`, `sfh` and `castle` all run their root storage off
it, and `slop-cannon`'s disk lives on it.
- **Source:** [`nixos/boxes/home/palace/vms/cellar/`](../../../nixos/boxes/home/palace/vms/cellar)
(`default.nix`, `spdk.nix`)
- **Host:** VM on `palace`
- **nixpkgs:** `mine`
## Role
- Runs an **SPDK userspace target** (`my.spdk`, [`spdk.nix`](../../../nixos/boxes/home/palace/vms/cellar/spdk.nix)):
the kernel `nvme` driver is blacklisted so SPDK can claim the three NVMe controllers directly
(host BDFs `41:00.0`–`43:00.0`, attached in the guest as `02:00.0`–`04:00.0`).
- Builds a **RAID-0** (`NVMeRaid`) across the three drives and exports one
partition per consumer as an **NVMe-oF subsystem over RDMA** (port 4420) on the `hi` network:
| Bdev | NQN | Consumer |
|---|---|---|
| `NVMeRaidp1` | `nqn.2016-06.io.spdk:river` | [`river`](river.md) |
| `NVMeRaidp2` | `nqn.2016-06.io.spdk:castle` | [`castle`](castle.md) |
| `NVMeRaidp3` | `nqn.2016-06.io.spdk:sfh` | [`sfh`](sfh/README.md) |
| `NVMeRaidp4` | `nqn.2016-06.io.spdk:slop-cannon` | [`palace`](palace.md#slop-cannons-disk), for [`slop-cannon`](slop-cannon.md) |
Each subsystem is pinned to its consumer's `hostnqn` (the `my.nvme.uuid` on the client side).
- `spdk-tgt` doesn't restart on deploy (`restartIfChanged = false`): restarting it takes every
consumer's disk away, so restart it by hand when they can do without.
- `spdk-tgt` is ordered after `lan-hi` is online; the RDMA listener binds the `hi` assignment on
port 4420. The VM itself is pinned to NUMA node 1 on `palace` and gets SR-IOV VF 0.
- `netdata` (port 19999 allowed in the firewall) and `fstrim`.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `cellar`).
## Adding an export
Partitions on `NVMeRaid` are ordinary GPT partitions. SPDK's `gpt` module finds them when it
examines the RAID (`bdev_examine` in `spdk.nix`; auto-examine is off) and exposes those whose type
GUID is SPDK's, as `NVMeRaidp<n>`. `p1`–`p4` use the current type GUID,
`6527994e-2c5a-4eec-9613-8f5944074e8b`. Use it for new partitions and leave existing partition
types as they are. SPDK still supports its deprecated type, `7c5222bd-8f5d-4087-9c00-bf9843c7b58c`,
and exposes one fewer block for that type to preserve compatibility with existing on-disk metadata.
[SPDK deprecation notice](https://github.com/spdk/spdk/blob/master/deprecation.md#gpt)
SPDK has no RPC to edit a partition table, so a new partition is written from Linux through ublk,
using `spdk-debug`.
Once examined, the `gpt` module holds an exclusive write claim on `NVMeRaid`, so this can't be done
while the exports are live: every consumer has to be down. Start from a box that stays online
when the exports are offline.
1. Shut down every consumer. Power off `castle` and run
`doas systemctl stop vm@sfh vm@river slop-cannon-disk` on `palace`. `stream` takes over the
router VIPs. Stopping `slop-cannon-disk` shuts down `vm@slop-cannon` before disconnecting its
disk. On `cellar`, verify that `doas spdk-rpc nvmf_subsystem_get_controllers <nqn>` returns `[]`
for each exported subsystem in the table above.
2. On `cellar`, stop the target and start `spdk-debug` in its place. It runs `spdk_tgt` on a
config generated from the real one: the same controllers and RAID, but nothing examined (so
the `gpt` module never claims the RAID), nothing exported, and the RAID exposed through ublk
(`my.spdk.debug.ublkDisks`):
```sh
doas systemctl stop spdk-tgt
doas systemd-run --unit=spdk-debug --setenv=PATH=/run/wrappers/bin:/run/current-system/sw/bin "$(command -v spdk-debug)"
doas spdk-rpc ublk_get_disks # NVMeRaid as ublk 1
lsblk /dev/ublkb1
```
Run plain `doas spdk-debug` instead to keep it in the foreground (`Ctrl-C` stops it).
3. Check the existing table, then add the partition. `sgdisk` isn't installed on `cellar`; a start
of `0` selects the start of the largest free region. Substitute the new partition number for
`<n>` and the desired capacity for `<size>`. Verify that all existing entries match the
expected layout before writing, and check that they remain intact afterward.
```sh
nix shell pkgs#gptfdisk -c doas sgdisk -p /dev/ublkb1
nix shell pkgs#gptfdisk -c doas sgdisk \
-n <n>:0:+<size> -t <n>:6527994e-2c5a-4eec-9613-8f5944074e8b /dev/ublkb1
nix shell pkgs#gptfdisk -c doas sgdisk -p /dev/ublkb1
```
4. `doas systemctl stop spdk-debug`, and check `/dev/ublkb1` is gone.
5. If `spdk-debug` fails to start, `journalctl -u spdk-debug` shows why. The same steps can be
done by hand: `spdk_tgt --wait-for-rpc` under `systemd-run`, then `spdk-rpc bdev_set_options
--no-auto-examine`, `framework_start_init`, the three `bdev_nvme_attach_controller` calls and
`bdev_raid_create` exactly as in `spdk.nix`, `ublk_create_target` and
`ublk_start_disk NVMeRaid 1`.
6. Add an `nvmfBdev` entry for `NVMeRaidp<n>` in `spdk.nix` (its consumer's host NQN and the next
serial), deploy `cellar` (the unit doesn't restart) and `doas systemctl start spdk-tgt`. Check
`doas spdk-rpc bdev_get_bdevs` lists the new partition and `doas spdk-rpc nvmf_get_subsystems`
the new subsystem.
7. Start the consumers again. Starting `vm@slop-cannon` also starts `slop-cannon-disk`.
If `spdk-tgt` won't start in step 6, the usual cause is a config naming a bdev that doesn't exist.
Switch `cellar` back to its previous generation
(`doas /nix/var/nix/profiles/system-<n>-link/bin/switch-to-configuration switch`), start
`spdk-tgt` and check the existing exports before trying again.
`ublk_drv` is loaded on `cellar`.
## Notes
- The `ublk_*` calls in `my.spdk.debugCommands` are only a debugging aid — they create a local
ublk device so the RAID can be mounted and inspected on `cellar` itself. Client exports are the
`nvmf` subsystems above.
## Notable config files
- [`nixos/boxes/home/palace/vms/cellar/default.nix`](../../../nixos/boxes/home/palace/vms/cellar/default.nix) —
box config (assignment, networking, netdata).
- [`nixos/boxes/home/palace/vms/cellar/spdk.nix`](../../../nixos/boxes/home/palace/vms/cellar/spdk.nix) —
SPDK target: RAID-0, NVMe-oF/RDMA subsystems.
- [`nixos/boxes/home/palace/vms/default.nix`](../../../nixos/boxes/home/palace/vms/default.nix) —
the VM definition on `palace` (VF 0, NVMe passthrough, NUMA pinning).
+21
View File
@@ -0,0 +1,21 @@
# Home network diagrams
`switch-ports.json` holds the socket inventory, NIC capacities and cable endpoints. Regenerate
`switch-panels.svg` and the cable table in `../switches.md` from the repository root:
```sh
python3 docs/sites/home/diagrams/render-switch-panels.py
```
The renderer uses only the Python standard library. Socket geometry and schematic cable routing
live in the renderer. Keep the inventory and routing together when adding a connection.
`home-fabric.mmd` is the Mermaid source for the logical fabric diagram. Render it with Mermaid
CLI (the checked-in SVG was rendered with Mermaid 11.12.0):
```sh
mmdc -i docs/sites/home/diagrams/home-fabric.mmd -o docs/sites/home/diagrams/home-fabric.svg
```
Check rendered SVGs visually after editing. Both diagrams are checked in so Markdown viewers
can show them without Mermaid support.
+14
View File
@@ -0,0 +1,14 @@
flowchart LR
virgin["Virgin Media modem"] --- shytzel["shytzel"]
ont["Digiweb ONT"] --- brian["brian"]
shytzel ---|"VLAN 130 trunk"| jim["jim"]
brian ---|"2 × 10G LAG"| dave["dave · RSTP root"]
brian -. "1G backup" .- jim
jim ---|"10G fabric trunk"| dave
dave ---|"100G"| palace["palace · river / cellar / sfh"]
jim ---|"1G host + separate 1G river trunk"| palace
dave ---|"100G"| castle["castle · NVMe-oF root"]
jim -. "1G · normally down" .- castle
dave ---|"10G LAN"| stream["stream"]
jim -. "1G LAN backup" .- stream
jim ---|"Separate VLAN 130 WAN handoff"| stream
+1
View File
@@ -0,0 +1 @@
<svg id="mermaid-1794758188270" width="100%" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="flowchart" style="max-width: 1357.40625px;" viewBox="0 0 1357.40625 379" role="graphics-document document" aria-roledescription="flowchart-v2"><style>#mermaid-1794758188270{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-1794758188270 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-1794758188270 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-1794758188270 .error-icon{fill:#552222;}#mermaid-1794758188270 .error-text{fill:#552222;stroke:#552222;}#mermaid-1794758188270 .edge-thickness-normal{stroke-width:1px;}#mermaid-1794758188270 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-1794758188270 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-1794758188270 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-1794758188270 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-1794758188270 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-1794758188270 .marker{fill:#333333;stroke:#333333;}#mermaid-1794758188270 .marker.cross{stroke:#333333;}#mermaid-1794758188270 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-1794758188270 p{margin:0;}#mermaid-1794758188270 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-1794758188270 .cluster-label text{fill:#333;}#mermaid-1794758188270 .cluster-label span{color:#333;}#mermaid-1794758188270 .cluster-label span p{background-color:transparent;}#mermaid-1794758188270 .label text,#mermaid-1794758188270 span{fill:#333;color:#333;}#mermaid-1794758188270 .node rect,#mermaid-1794758188270 .node circle,#mermaid-1794758188270 .node ellipse,#mermaid-1794758188270 .node polygon,#mermaid-1794758188270 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-1794758188270 .rough-node .label text,#mermaid-1794758188270 .node .label text,#mermaid-1794758188270 .image-shape .label,#mermaid-1794758188270 .icon-shape .label{text-anchor:middle;}#mermaid-1794758188270 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-1794758188270 .rough-node .label,#mermaid-1794758188270 .node .label,#mermaid-1794758188270 .image-shape .label,#mermaid-1794758188270 .icon-shape .label{text-align:center;}#mermaid-1794758188270 .node.clickable{cursor:pointer;}#mermaid-1794758188270 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-1794758188270 .arrowheadPath{fill:#333333;}#mermaid-1794758188270 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-1794758188270 .flowchart-link{stroke:#333333;fill:none;}#mermaid-1794758188270 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-1794758188270 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-1794758188270 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-1794758188270 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-1794758188270 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-1794758188270 .cluster text{fill:#333;}#mermaid-1794758188270 .cluster span{color:#333;}#mermaid-1794758188270 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-1794758188270 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-1794758188270 rect.text{fill:none;stroke-width:0;}#mermaid-1794758188270 .icon-shape,#mermaid-1794758188270 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-1794758188270 .icon-shape p,#mermaid-1794758188270 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-1794758188270 .icon-shape rect,#mermaid-1794758188270 .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-1794758188270 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-1794758188270 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-1794758188270 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}</style><g><marker id="mermaid-1794758188270_flowchart-v2-pointEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"></path></marker><marker id="mermaid-1794758188270_flowchLine truncated

After

Width:  |  Height:  |  Size: 24 KiB

@@ -0,0 +1,207 @@
#!/usr/bin/env python3
"""Render the rack panel map and cable table from switch-ports.json."""
import html
import json
from pathlib import Path
import re
import textwrap
ROOT = Path(__file__).resolve().parent
DATA = json.loads((ROOT / "switch-ports.json").read_text())
COLORS = ["#2563eb", "#7c3aed", "#d97706", "#0891b2", "#64748b", "#16a34a", "#db2777", "#dc2626", "#92400e", "#0f766e", "#4f46e5"]
TAGS = {}
POSITIONS = {}
foreground = []
for link, color in zip(DATA["links"], COLORS):
for end in ("from", "to"):
TAGS[tuple(link[end])] = (link["id"], color)
svg = ['<svg xmlns="http://www.w3.org/2000/svg" width="1440" height="1580" viewBox="0 0 1440 1580" role="img" aria-labelledby="title desc">',
'<title id="title">Home rack switch front panels and cable endpoints</title>',
'<desc id="desc">Stream is drawn above Brian but physically sits to its left. Brian above Jim above Dave, with palace several rack units below. Socket order follows the hardware; matching letter badges identify cable ends.</desc>',
'<style>text{font-family:system-ui,sans-serif;fill:#172033}.heading{font-weight:650;font-size:22px}.sub{fill:#526075;font-size:14px}.port{font-size:12px;font-weight:600}.small{font-size:11px}.mono{font-family:monospace}</style>']
def rect(x, y, w, h, fill, stroke="none", radius=5):
svg.append(f'<rect x="{x}" y="{y}" width="{w}" height="{h}" rx="{radius}" fill="{fill}" stroke="{stroke}"/>')
def text(x, y, value, cls="", anchor="start", color=None):
style = f' style="fill:{color}"' if color else ""
svg.append(f'<text x="{x}" y="{y}" class="{cls}" text-anchor="{anchor}"{style}>{html.escape(value)}</text>')
def badge(x, y, tag, color):
rect(x - 10, y - 12, 20, 20, color, radius=4)
text(x, y + 2, tag, "port", "middle", "white")
def chassis(y, name, height, note):
rect(115, y, 1210, height, "#eef1f5", "#a8b2c1", 8)
text(140, y + 28, name, "heading")
text(1300, y + 27, note, "sub", "end")
def port(host, socket, x, y, width=46, height=27, label=True):
start = len(svg)
POSITIONS[(host, socket)] = (x, y, width, height)
p = next(p for p in DATA[host]["ports"] if p["socket"] == socket)
svg.append('<g><title>' + html.escape(f'{host} {socket}: {p["interface"]} — {p["role"]}') + '</title>')
tag, color = TAGS.get((host, socket), (None, "#64748b"))
rect(x - width / 2, y, width, height, "#fff", color, 3)
rect(x - width / 2 + 6, y + 5, width - 12, height - 10, "#28364a", radius=1)
text(x, y - 9, socket, "port mono", "middle")
if tag:
badge(x + width / 2 - 2, y - 9, tag, color)
if label:
for row, line in enumerate(textwrap.wrap(p["label"], width=8 if host == "jim" else 11)[:2]):
text(x, y + height + 15 + row * 12, line, "small", "middle")
svg.append('</g>')
foreground.extend(svg[start:])
del svg[start:]
rect(0, 0, 1440, 1580, "white", radius=0)
text(95, 38, "Home rack · physical socket map", "heading")
text(95, 64, "Front views, top to bottom. Socket positions follow the hardware; spacing and chassis widths are schematic.", "sub")
svg.append('<g transform="translate(0,330)">')
rect(330, -235, 780, 305, "#eef1f5", "#a8b2c1", 8)
text(350, -205, "stream · BROUNION R86S", "heading")
text(350, -180, "Physically left of brian; drawn above for cable routing", "sub")
text(350, -150, "DC / USB", "small")
for n, x in enumerate((600, 780, 960)):
port("stream", f"ETH{n}", x, -135, width=60)
text(x, -65, "Intel I225-V · 2.5G", "small", "middle")
text(x, -48, "1G connection" if n < 2 else "Unused", "small", "middle")
for socket, x in (("SFP+ L", 650), ("SFP+ R", 890)):
port("stream", socket, x, -12, width=70)
text(x, 53, "ConnectX-3 · 10G SFP+", "small", "middle")
# SFP captions sit below the narrow chassis to preserve the two-row socket layout.
for x in (93, 1347):
rect(x, 90, 9, 1080, "#dce2eb", radius=2)
for y in range(106, 1170, 24):
rect(x + 2, y, 5, 8, "white", radius=1)
chassis(100, "brian · USW-Pro-XG-8-PoE", 155, "8 × RJ45, then 2 × SFP+")
rect(205, 180, 10, 10, "#60a5fa", radius=5)
text(210, 218, "LED", "small", "middle")
for n in range(1, 9):
port("brian", str(n), 320 + (n - 1) * 75, 174, width=48)
for n in (9, 10):
port("brian", str(n), 1060 + (n - 9) * 120, 174, width=65)
chassis(340, "jim · CRS326-24G-2S+RM", 205, "3 banks of 8 RJ45 · even above odd · SFP+ at right")
rect(175, 425, 54, 29, "#28364a", "#94a3b8")
text(202, 410, "CONSOLE", "small", "middle")
for n in range(1, 25):
col = (n - 1) // 2
x = 285 + col * 59 + (col // 4) * 17
port("jim", str(n), x, 476 if n % 2 else 402, width=43, height=24)
port("jim", "S1", 1134, 445, width=54)
port("jim", "S2", 1235, 445, width=54)
chassis(630, "dave · CRS504-4XQ-IN", 165, "4 QSFP28 cages · console above management at right")
for x, label in ((175, "PSU 1"), (290, "PSU 2")):
rect(x, 680, 90, 78, "#d1d8e2", "#94a3b8")
text(x + 45, 725, label, "sub", "middle")
for n in range(1, 5):
x = 490 + (n - 1) * 140
if n == 3:
rect(x - 46, 695, 92, 29, "#fff", "#0891b2")
rect(x - 38, 701, 76, 17, "#28364a", radius=1)
text(x, 686, "Q3", "port mono", "middle")
text(x, 743, "4 × 10G breakout", "small", "middle")
svg.append(f'<path d="M{x} 757 V820" stroke="#0891b2" stroke-width="2" fill="none"/>')
else:
port("dave", f"Q{n}", x, 695, width=92)
rect(1095, 690, 54, 27, "#28364a", "#94a3b8")
text(1122, 681, "CONSOLE", "small", "middle")
port("dave", "MGMT", 1122, 741, width=54, height=24, label=False)
text(1235, 725, "DC / reset", "sub", "middle")
rect(430, 820, 820, 84, "#f4f8fc", "#b9cadb")
text(445, 841, "Q3 breakout lanes (one physical cage)", "sub")
for n in range(1, 5):
start = len(svg)
p = next(p for p in DATA["dave"]["ports"] if p["socket"] == f"Q3.{n}")
x = 485 + (n - 1) * 200
tag, color = TAGS.get(("dave", p["socket"]), (None, "#64748b"))
text(x, 870, p["socket"], "port mono")
if tag:
badge(x + 61, 866, tag, color)
text(x, 889, p["label"], "small")
rect(x + 83, 854, 34, 20, "white", color, radius=3)
rect(x + 89, 860, 22, 8, color, radius=1)
POSITIONS[("dave", p["socket"])] = (x + 100, 854, 34, 20)
foreground.extend(svg[start:])
del svg[start:]
text(720, 963, "⋮ several rack units ⋮", "sub", "middle")
chassis(1030, "palace", 160, "NIC endpoints only; rear-panel positions are not depicted")
for x, name in ((350, "uplink-dave"), (730, "host-jim"), (1110, "river-jim-phy")):
start = len(svg)
tag, color = TAGS[("palace", name)]
rect(x - 145, 1090, 290, 76, "white", color)
text(x - 118, 1120, name, "port mono")
badge(x + 119, 1114, tag, color)
spec = next(p for p in DATA["palace"]["ports"] if p["socket"] == name)
text(x, 1146, spec["nic"] + " · " + spec["capacity"], "small", "middle")
POSITIONS[("palace", name)] = (x, 1090, 290, 76)
foreground.extend(svg[start:])
del svg[start:]
def anchor(host, socket, side="bottom"):
x, y, w, h = POSITIONS[(host, socket)]
return {"top": (x, y), "bottom": (x, y + h),
"left": (x - w / 2, y + h / 2), "right": (x + w / 2, y + h / 2)}[side]
def cable(tag, points):
color = COLORS[ord(tag) - ord("A")]
points = " ".join(f"{x},{y}" for x, y in points)
svg.append(f'<polyline points="{points}" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>')
svg.append(f'<polyline points="{points}" fill="none" stroke="{color}" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>')
cable("A", [anchor("brian", "9"), (1060, 280), (38, 280), (38, 925),
(785, 925), anchor("dave", "Q3.2")])
cable("B", [anchor("brian", "10"), (1180, 300), (58, 300), (58, 950),
(1185, 950), anchor("dave", "Q3.4")])
cable("C", [anchor("brian", "5"), (620, 315), (492, 315), (492, 458),
(462, 458), anchor("jim", "7", "top")])
cable("D", [anchor("jim", "S1"), (1134, 575), (1394, 575), (1394, 975),
(585, 975), anchor("dave", "Q3.1")])
cable("E", [anchor("jim", "24", "right"), (1010, 414), (1010, 600),
(1380, 600), (1380, 753), anchor("dave", "MGMT", "right")])
cable("F", [anchor("jim", "5"), (403, 568), (1368, 568), (1368, 1010),
(730, 1010), anchor("palace", "host-jim", "top")])
cable("G", [anchor("jim", "22", "right"), (940, 414), (940, 590),
(1416, 590), (1416, 1025), (1110, 1025), anchor("palace", "river-jim-phy", "top")])
cable("H", [anchor("dave", "Q1"), (490, 790), (410, 790), (410, 1000),
(350, 1000), anchor("palace", "uplink-dave", "top")])
cable("I", [anchor("stream", "ETH0", "top"), (600, -160), (18, -160),
(18, 555), (898, 555), anchor("jim", "21")])
cable("J", [anchor("stream", "ETH1", "top"), (780, -170), (70, -170),
(70, 322), (403, 322), anchor("jim", "6", "top")])
cable("K", [anchor("stream", "SFP+ R"), (890, 80), (1428, 80),
(1428, 920), (985, 920), anchor("dave", "Q3.3")])
svg.extend(foreground)
text(95, 1220, "Matching letter badges identify cable ends. Port labels describe configured use; they do not indicate current link state.", "sub")
svg.append('</g></svg>')
(ROOT / "switch-panels.svg").write_text('\n'.join(svg) + '\n')
rows = ["| Cable | Endpoint | Endpoint | Connection |", "|---|---|---|---|"]
for link in DATA["links"]:
ends = [f'`{link[end][0]}` `{link[end][1]}`' for end in ("from", "to")]
rows.append(f'| **{link["id"]}** | {ends[0]} | {ends[1]} | {link["description"]} |')
page = ROOT.parent / "switches.md"
content = page.read_text()
start, end = "<!-- switch-cables -->", "<!-- /switch-cables -->"
if start in content:
content = re.sub(re.escape(start) + r'.*?' + re.escape(end),
start + '\n' + '\n'.join(rows) + '\n' + end, content, flags=re.S)
page.write_text(content)
+517
View File
@@ -0,0 +1,517 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1440" height="1580" viewBox="0 0 1440 1580" role="img" aria-labelledby="title desc">
<title id="title">Home rack switch front panels and cable endpoints</title>
<desc id="desc">Stream is drawn above Brian but physically sits to its left. Brian above Jim above Dave, with palace several rack units below. Socket order follows the hardware; matching letter badges identify cable ends.</desc>
<style>text{font-family:system-ui,sans-serif;fill:#172033}.heading{font-weight:650;font-size:22px}.sub{fill:#526075;font-size:14px}.port{font-size:12px;font-weight:600}.small{font-size:11px}.mono{font-family:monospace}</style>
<rect x="0" y="0" width="1440" height="1580" rx="0" fill="white" stroke="none"/>
<text x="95" y="38" class="heading" text-anchor="start">Home rack · physical socket map</text>
<text x="95" y="64" class="sub" text-anchor="start">Front views, top to bottom. Socket positions follow the hardware; spacing and chassis widths are schematic.</text>
<g transform="translate(0,330)">
<rect x="330" y="-235" width="780" height="305" rx="8" fill="#eef1f5" stroke="#a8b2c1"/>
<text x="350" y="-205" class="heading" text-anchor="start">stream · BROUNION R86S</text>
<text x="350" y="-180" class="sub" text-anchor="start">Physically left of brian; drawn above for cable routing</text>
<text x="350" y="-150" class="small" text-anchor="start">DC / USB</text>
<text x="600" y="-65" class="small" text-anchor="middle">Intel I225-V · 2.5G</text>
<text x="600" y="-48" class="small" text-anchor="middle">1G connection</text>
<text x="780" y="-65" class="small" text-anchor="middle">Intel I225-V · 2.5G</text>
<text x="780" y="-48" class="small" text-anchor="middle">1G connection</text>
<text x="960" y="-65" class="small" text-anchor="middle">Intel I225-V · 2.5G</text>
<text x="960" y="-48" class="small" text-anchor="middle">Unused</text>
<text x="650" y="53" class="small" text-anchor="middle">ConnectX-3 · 10G SFP+</text>
<text x="890" y="53" class="small" text-anchor="middle">ConnectX-3 · 10G SFP+</text>
<rect x="93" y="90" width="9" height="1080" rx="2" fill="#dce2eb" stroke="none"/>
<rect x="95" y="106" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="130" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="154" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="178" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="202" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="226" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="250" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="274" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="298" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="322" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="346" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="370" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="394" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="418" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="442" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="466" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="490" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="514" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="538" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="562" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="586" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="610" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="634" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="658" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="682" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="706" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="730" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="754" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="778" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="802" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="826" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="850" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="874" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="898" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="922" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="946" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="970" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="994" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="1018" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="1042" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="1066" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="1090" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="1114" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="1138" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="95" y="1162" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1347" y="90" width="9" height="1080" rx="2" fill="#dce2eb" stroke="none"/>
<rect x="1349" y="106" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="130" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="154" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="178" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="202" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="226" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="250" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="274" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="298" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="322" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="346" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="370" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="394" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="418" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="442" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="466" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="490" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="514" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="538" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="562" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="586" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="610" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="634" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="658" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="682" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="706" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="730" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="754" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="778" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="802" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="826" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="850" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="874" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="898" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="922" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="946" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="970" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="994" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="1018" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="1042" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="1066" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="1090" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="1114" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="1138" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="1349" y="1162" width="5" height="8" rx="1" fill="white" stroke="none"/>
<rect x="115" y="100" width="1210" height="155" rx="8" fill="#eef1f5" stroke="#a8b2c1"/>
<text x="140" y="128" class="heading" text-anchor="start">brian · USW-Pro-XG-8-PoE</text>
<text x="1300" y="127" class="sub" text-anchor="end">8 × RJ45, then 2 × SFP+</text>
<rect x="205" y="180" width="10" height="10" rx="5" fill="#60a5fa" stroke="none"/>
<text x="210" y="218" class="small" text-anchor="middle">LED</text>
<rect x="115" y="340" width="1210" height="205" rx="8" fill="#eef1f5" stroke="#a8b2c1"/>
<text x="140" y="368" class="heading" text-anchor="start">jim · CRS326-24G-2S+RM</text>
<text x="1300" y="367" class="sub" text-anchor="end">3 banks of 8 RJ45 · even above odd · SFP+ at right</text>
<rect x="175" y="425" width="54" height="29" rx="5" fill="#28364a" stroke="#94a3b8"/>
<text x="202" y="410" class="small" text-anchor="middle">CONSOLE</text>
<rect x="115" y="630" width="1210" height="165" rx="8" fill="#eef1f5" stroke="#a8b2c1"/>
<text x="140" y="658" class="heading" text-anchor="start">dave · CRS504-4XQ-IN</text>
<text x="1300" y="657" class="sub" text-anchor="end">4 QSFP28 cages · console above management at right</text>
<rect x="175" y="680" width="90" height="78" rx="5" fill="#d1d8e2" stroke="#94a3b8"/>
<text x="220" y="725" class="sub" text-anchor="middle">PSU 1</text>
<rect x="290" y="680" width="90" height="78" rx="5" fill="#d1d8e2" stroke="#94a3b8"/>
<text x="335" y="725" class="sub" text-anchor="middle">PSU 2</text>
<rect x="724" y="695" width="92" height="29" rx="5" fill="#fff" stroke="#0891b2"/>
<rect x="732" y="701" width="76" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="770" y="686" class="port mono" text-anchor="middle">Q3</text>
<text x="770" y="743" class="small" text-anchor="middle">4 × 10G breakout</text>
<path d="M770 757 V820" stroke="#0891b2" stroke-width="2" fill="none"/>
<rect x="1095" y="690" width="54" height="27" rx="5" fill="#28364a" stroke="#94a3b8"/>
<text x="1122" y="681" class="small" text-anchor="middle">CONSOLE</text>
<text x="1235" y="725" class="sub" text-anchor="middle">DC / reset</text>
<rect x="430" y="820" width="820" height="84" rx="5" fill="#f4f8fc" stroke="#b9cadb"/>
<text x="445" y="841" class="sub" text-anchor="start">Q3 breakout lanes (one physical cage)</text>
<text x="720" y="963" class="sub" text-anchor="middle">⋮ several rack units ⋮</text>
<rect x="115" y="1030" width="1210" height="160" rx="8" fill="#eef1f5" stroke="#a8b2c1"/>
<text x="140" y="1058" class="heading" text-anchor="start">palace</text>
<text x="1300" y="1057" class="sub" text-anchor="end">NIC endpoints only; rear-panel positions are not depicted</text>
<polyline points="1060,201 1060,280 38,280 38,925 785,925 785,874" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="1060,201 1060,280 38,280 38,925 785,925 785,874" fill="none" stroke="#2563eb" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="1180,201 1180,300 58,300 58,950 1185,950 1185,874" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="1180,201 1180,300 58,300 58,950 1185,950 1185,874" fill="none" stroke="#7c3aed" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="620,201 620,315 492,315 492,458 462,458 462,476" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="620,201 620,315 492,315 492,458 462,458 462,476" fill="none" stroke="#d97706" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="1134,472 1134,575 1394,575 1394,975 585,975 585,874" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="1134,472 1134,575 1394,575 1394,975 585,975 585,874" fill="none" stroke="#0891b2" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="989.5,414.0 1010,414 1010,600 1380,600 1380,753 1149.0,753.0" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="989.5,414.0 1010,414 1010,600 1380,600 1380,753 1149.0,753.0" fill="none" stroke="#64748b" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="403,500 403,568 1368,568 1368,1010 730,1010 730,1090" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="403,500 403,568 1368,568 1368,1010 730,1010 730,1090" fill="none" stroke="#16a34a" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="930.5,414.0 940,414 940,590 1416,590 1416,1025 1110,1025 1110,1090" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="930.5,414.0 940,414 940,590 1416,590 1416,1025 1110,1025 1110,1090" fill="none" stroke="#db2777" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="490,722 490,790 410,790 410,1000 350,1000 350,1090" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="490,722 490,790 410,790 410,1000 350,1000 350,1090" fill="none" stroke="#dc2626" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="600,-135 600,-160 18,-160 18,555 898,555 909,500" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="600,-135 600,-160 18,-160 18,555 898,555 909,500" fill="none" stroke="#92400e" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="780,-135 780,-170 70,-170 70,322 403,322 403,402" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="780,-135 780,-170 70,-170 70,322 403,322 403,402" fill="none" stroke="#0f766e" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="890,15 890,80 1428,80 1428,920 985,920 985,874" fill="none" stroke="white" stroke-width="7" stroke-linejoin="round" stroke-linecap="round"/>
<polyline points="890,15 890,80 1428,80 1428,920 985,920 985,874" fill="none" stroke="#4f46e5" stroke-width="2.5" stroke-linejoin="round" stroke-linecap="round"/>
<g><title>stream ETH0: wan — 1G connection to jim 21</title>
<rect x="570.0" y="-135" width="60" height="27" rx="3" fill="#fff" stroke="#92400e"/>
<rect x="576.0" y="-130" width="48" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="600" y="-144" class="port mono" text-anchor="middle">ETH0</text>
<rect x="618.0" y="-156" width="20" height="20" rx="4" fill="#92400e" stroke="none"/>
<text x="628.0" y="-142" class="port" text-anchor="middle" style="fill:white">I</text>
<text x="600" y="-93" class="small" text-anchor="middle">wan</text>
</g>
<g><title>stream ETH1: lan-jim — 1G connection to jim 6</title>
<rect x="750.0" y="-135" width="60" height="27" rx="3" fill="#fff" stroke="#0f766e"/>
<rect x="756.0" y="-130" width="48" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="780" y="-144" class="port mono" text-anchor="middle">ETH1</text>
<rect x="798.0" y="-156" width="20" height="20" rx="4" fill="#0f766e" stroke="none"/>
<text x="808.0" y="-142" class="port" text-anchor="middle" style="fill:white">J</text>
<text x="780" y="-93" class="small" text-anchor="middle">lan-jim</text>
</g>
<g><title>stream ETH2: et2 — Unused</title>
<rect x="930.0" y="-135" width="60" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="936.0" y="-130" width="48" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="960" y="-144" class="port mono" text-anchor="middle">ETH2</text>
<text x="960" y="-93" class="small" text-anchor="middle">et2</text>
</g>
<g><title>stream SFP+ L: et5 — Unused</title>
<rect x="615.0" y="-12" width="70" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="621.0" y="-7" width="58" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="650" y="-21" class="port mono" text-anchor="middle">SFP+ L</text>
<text x="650" y="30" class="small" text-anchor="middle">et5</text>
</g>
<g><title>stream SFP+ R: lan-dave — 10G connection to dave Q3.3</title>
<rect x="855.0" y="-12" width="70" height="27" rx="3" fill="#fff" stroke="#4f46e5"/>
<rect x="861.0" y="-7" width="58" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="890" y="-21" class="port mono" text-anchor="middle">SFP+ R</text>
<rect x="913.0" y="-33" width="20" height="20" rx="4" fill="#4f46e5" stroke="none"/>
<text x="923.0" y="-19" class="port" text-anchor="middle" style="fill:white">K</text>
<text x="890" y="30" class="small" text-anchor="middle">lan-dave</text>
</g>
<g><title>brian 1: Port 1 — Configured port label</title>
<rect x="296.0" y="174" width="48" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="302.0" y="179" width="36" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="320" y="165" class="port mono" text-anchor="middle">1</text>
<text x="320" y="216" class="small" text-anchor="middle">fort</text>
</g>
<g><title>brian 2: Port 2 — Configured port label</title>
<rect x="371.0" y="174" width="48" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="377.0" y="179" width="36" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="395" y="165" class="port mono" text-anchor="middle">2</text>
<text x="395" y="216" class="small" text-anchor="middle">castle</text>
</g>
<g><title>brian 3: Port 3 — portcullis test connection</title>
<rect x="446.0" y="174" width="48" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="452.0" y="179" width="36" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="470" y="165" class="port mono" text-anchor="middle">3</text>
<text x="470" y="216" class="small" text-anchor="middle">portcullis</text>
<text x="470" y="228" class="small" text-anchor="middle">test</text>
</g>
<g><title>brian 4: Port 4 — Second JetKVM</title>
<rect x="521.0" y="174" width="48" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="527.0" y="179" width="36" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="545" y="165" class="port mono" text-anchor="middle">4</text>
<text x="545" y="216" class="small" text-anchor="middle">portcullis</text>
<text x="545" y="228" class="small" text-anchor="middle">KVM</text>
</g>
<g><title>brian 5: Port 5 — Backup fabric trunk</title>
<rect x="596.0" y="174" width="48" height="27" rx="3" fill="#fff" stroke="#d97706"/>
<rect x="602.0" y="179" width="36" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="620" y="165" class="port mono" text-anchor="middle">5</text>
<rect x="632.0" y="153" width="20" height="20" rx="4" fill="#d97706" stroke="none"/>
<text x="642.0" y="167" class="port" text-anchor="middle" style="fill:white">C</text>
<text x="620" y="216" class="small" text-anchor="middle">jim P7</text>
</g>
<g><title>brian 6: Port 6 — Native VLAN 140; tagged VLAN 10</title>
<rect x="671.0" y="174" width="48" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="677.0" y="179" width="36" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="695" y="165" class="port mono" text-anchor="middle">6</text>
<text x="695" y="216" class="small" text-anchor="middle">Digiweb ONT</text>
</g>
<g><title>brian 7: Port 7 — AP trunk</title>
<rect x="746.0" y="174" width="48" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="752.0" y="179" width="36" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="770" y="165" class="port mono" text-anchor="middle">7</text>
<text x="770" y="216" class="small" text-anchor="middle">wave</text>
</g>
<g><title>brian 8: Port 8 — AP trunk</title>
<rect x="821.0" y="174" width="48" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="827.0" y="179" width="36" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="845" y="165" class="port mono" text-anchor="middle">8</text>
<text x="845" y="216" class="small" text-anchor="middle">vibe</text>
</g>
<g><title>brian 9: SFP+ 1 — LAG member 1</title>
<rect x="1027.5" y="174" width="65" height="27" rx="3" fill="#fff" stroke="#2563eb"/>
<rect x="1033.5" y="179" width="53" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="1060" y="165" class="port mono" text-anchor="middle">9</text>
<rect x="1080.5" y="153" width="20" height="20" rx="4" fill="#2563eb" stroke="none"/>
<text x="1090.5" y="167" class="port" text-anchor="middle" style="fill:white">A</text>
<text x="1060" y="216" class="small" text-anchor="middle">dave Q3.2</text>
</g>
<g><title>brian 10: SFP+ 2 — LAG member 2</title>
<rect x="1147.5" y="174" width="65" height="27" rx="3" fill="#fff" stroke="#7c3aed"/>
<rect x="1153.5" y="179" width="53" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="1180" y="165" class="port mono" text-anchor="middle">10</text>
<rect x="1200.5" y="153" width="20" height="20" rx="4" fill="#7c3aed" stroke="none"/>
<text x="1210.5" y="167" class="port" text-anchor="middle" style="fill:white">B</text>
<text x="1180" y="216" class="small" text-anchor="middle">dave Q3.4</text>
</g>
<g><title>jim 1: ether1 — Configured member of shytzel-downlink</title>
<rect x="263.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="269.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="285" y="467" class="port mono" text-anchor="middle">1</text>
<text x="285" y="515" class="small" text-anchor="middle">shytzel</text>
<text x="285" y="527" class="small" text-anchor="middle">LAG</text>
</g>
<g><title>jim 2: ether2 — Configured member of shytzel-downlink</title>
<rect x="263.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="269.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="285" y="393" class="port mono" text-anchor="middle">2</text>
<text x="285" y="441" class="small" text-anchor="middle">shytzel</text>
<text x="285" y="453" class="small" text-anchor="middle">LAG</text>
</g>
<g><title>jim 3: ether3 — Configured member of shytzel-downlink</title>
<rect x="322.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="328.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="344" y="467" class="port mono" text-anchor="middle">3</text>
<text x="344" y="515" class="small" text-anchor="middle">shytzel</text>
<text x="344" y="527" class="small" text-anchor="middle">LAG</text>
</g>
<g><title>jim 4: ether4 — Configured member of shytzel-downlink</title>
<rect x="322.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="328.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="344" y="393" class="port mono" text-anchor="middle">4</text>
<text x="344" y="441" class="small" text-anchor="middle">shytzel</text>
<text x="344" y="453" class="small" text-anchor="middle">LAG</text>
</g>
<g><title>jim 5: palace — Core / netboot trunk</title>
<rect x="381.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#16a34a"/>
<rect x="387.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="403" y="467" class="port mono" text-anchor="middle">5</text>
<rect x="412.5" y="455" width="20" height="20" rx="4" fill="#16a34a" stroke="none"/>
<text x="422.5" y="469" class="port" text-anchor="middle" style="fill:white">F</text>
<text x="403" y="515" class="small" text-anchor="middle">palace</text>
<text x="403" y="527" class="small" text-anchor="middle">host</text>
</g>
<g><title>jim 6: stream — Backup RSTP trunk</title>
<rect x="381.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#0f766e"/>
<rect x="387.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="403" y="393" class="port mono" text-anchor="middle">6</text>
<rect x="412.5" y="381" width="20" height="20" rx="4" fill="#0f766e" stroke="none"/>
<text x="422.5" y="395" class="port" text-anchor="middle" style="fill:white">J</text>
<text x="403" y="441" class="small" text-anchor="middle">stream</text>
<text x="403" y="453" class="small" text-anchor="middle">LAN</text>
</g>
<g><title>jim 7: brian-downlink — Backup fabric trunk</title>
<rect x="440.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#d97706"/>
<rect x="446.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="462" y="467" class="port mono" text-anchor="middle">7</text>
<rect x="471.5" y="455" width="20" height="20" rx="4" fill="#d97706" stroke="none"/>
<text x="481.5" y="469" class="port" text-anchor="middle" style="fill:white">C</text>
<text x="462" y="515" class="small" text-anchor="middle">brian P5</text>
</g>
<g><title>jim 8: palace-kvm — lo access</title>
<rect x="440.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="446.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="462" y="393" class="port mono" text-anchor="middle">8</text>
<text x="462" y="441" class="small" text-anchor="middle">JetKVM</text>
</g>
<g><title>jim 9: ether9 — Unbridged spare</title>
<rect x="516.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="522.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="538" y="467" class="port mono" text-anchor="middle">9</text>
<text x="538" y="515" class="small" text-anchor="middle">spare</text>
</g>
<g><title>jim 10: castle — Backup attachment, normally down</title>
<rect x="516.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="522.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="538" y="393" class="port mono" text-anchor="middle">10</text>
<text x="538" y="441" class="small" text-anchor="middle">castle</text>
</g>
<g><title>jim 11: fort — lo access (configured label)</title>
<rect x="575.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="581.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="597" y="467" class="port mono" text-anchor="middle">11</text>
<text x="597" y="515" class="small" text-anchor="middle">fort</text>
</g>
<g><title>jim 12: laptop-dock — lo access (configured label)</title>
<rect x="575.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="581.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="597" y="393" class="port mono" text-anchor="middle">12</text>
<text x="597" y="441" class="small" text-anchor="middle">dock</text>
</g>
<g><title>jim 13: pronter — lo access (configured label)</title>
<rect x="634.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="640.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="656" y="467" class="port mono" text-anchor="middle">13</text>
<text x="656" y="515" class="small" text-anchor="middle">pronter</text>
</g>
<g><title>jim 14: untrusted-sta1 — Untrusted access</title>
<rect x="634.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="640.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="656" y="393" class="port mono" text-anchor="middle">14</text>
<text x="656" y="441" class="small" text-anchor="middle">guest</text>
</g>
<g><title>jim 15: ether15 — lo access; peer unconfirmed</title>
<rect x="693.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="699.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="715" y="467" class="port mono" text-anchor="middle">15</text>
<text x="715" y="515" class="small" text-anchor="middle">unmapped</text>
</g>
<g><title>jim 16: ether16 — lo access; peer unconfirmed</title>
<rect x="693.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="699.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="715" y="393" class="port mono" text-anchor="middle">16</text>
<text x="715" y="441" class="small" text-anchor="middle">unmapped</text>
</g>
<g><title>jim 17: ether17 — lo access; peer unconfirmed</title>
<rect x="769.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="775.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="791" y="467" class="port mono" text-anchor="middle">17</text>
<text x="791" y="515" class="small" text-anchor="middle">unmapped</text>
</g>
<g><title>jim 18: ether18 — lo access; peer unconfirmed</title>
<rect x="769.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="775.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="791" y="393" class="port mono" text-anchor="middle">18</text>
<text x="791" y="441" class="small" text-anchor="middle">unmapped</text>
</g>
<g><title>jim 19: ether19 — lo access; peer unconfirmed</title>
<rect x="828.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="834.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="850" y="467" class="port mono" text-anchor="middle">19</text>
<text x="850" y="515" class="small" text-anchor="middle">unmapped</text>
</g>
<g><title>jim 20: ether20 — lo access; peer unconfirmed</title>
<rect x="828.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="834.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="850" y="393" class="port mono" text-anchor="middle">20</text>
<text x="850" y="441" class="small" text-anchor="middle">unmapped</text>
</g>
<g><title>jim 21: stream-wan — Untagged VLAN 130 handoff</title>
<rect x="887.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#92400e"/>
<rect x="893.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="909" y="467" class="port mono" text-anchor="middle">21</text>
<rect x="918.5" y="455" width="20" height="20" rx="4" fill="#92400e" stroke="none"/>
<text x="928.5" y="469" class="port" text-anchor="middle" style="fill:white">I</text>
<text x="909" y="515" class="small" text-anchor="middle">stream</text>
<text x="909" y="527" class="small" text-anchor="middle">WAN</text>
</g>
<g><title>jim 22: river — Dedicated router trunk</title>
<rect x="887.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#db2777"/>
<rect x="893.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="909" y="393" class="port mono" text-anchor="middle">22</text>
<rect x="918.5" y="381" width="20" height="20" rx="4" fill="#db2777" stroke="none"/>
<text x="928.5" y="395" class="port" text-anchor="middle" style="fill:white">G</text>
<text x="909" y="441" class="small" text-anchor="middle">river</text>
<text x="909" y="453" class="small" text-anchor="middle">backup</text>
</g>
<g><title>jim 23: ups — lo access</title>
<rect x="946.5" y="476" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="952.5" y="481" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="968" y="467" class="port mono" text-anchor="middle">23</text>
<text x="968" y="515" class="small" text-anchor="middle">UPS</text>
</g>
<g><title>jim 24: dave-management — Core management</title>
<rect x="946.5" y="402" width="43" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="952.5" y="407" width="31" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="968" y="393" class="port mono" text-anchor="middle">24</text>
<rect x="977.5" y="381" width="20" height="20" rx="4" fill="#64748b" stroke="none"/>
<text x="987.5" y="395" class="port" text-anchor="middle" style="fill:white">E</text>
<text x="968" y="441" class="small" text-anchor="middle">dave</text>
<text x="968" y="453" class="small" text-anchor="middle">mgmt</text>
</g>
<g><title>jim S1: dave-uplink — 10G fabric trunk</title>
<rect x="1107.0" y="445" width="54" height="27" rx="3" fill="#fff" stroke="#0891b2"/>
<rect x="1113.0" y="450" width="42" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="1134" y="436" class="port mono" text-anchor="middle">S1</text>
<rect x="1149.0" y="424" width="20" height="20" rx="4" fill="#0891b2" stroke="none"/>
<text x="1159.0" y="438" class="port" text-anchor="middle" style="fill:white">D</text>
<text x="1134" y="487" class="small" text-anchor="middle">dave</text>
<text x="1134" y="499" class="small" text-anchor="middle">Q3.1</text>
</g>
<g><title>jim S2: sfp-spare — 10G trunk; colony staging</title>
<rect x="1208.0" y="445" width="54" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="1214.0" y="450" width="42" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="1235" y="436" class="port mono" text-anchor="middle">S2</text>
<text x="1235" y="487" class="small" text-anchor="middle">fergal</text>
</g>
<g><title>dave Q1: palace — 100G; whole cage</title>
<rect x="444.0" y="695" width="92" height="27" rx="3" fill="#fff" stroke="#dc2626"/>
<rect x="450.0" y="700" width="80" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="490" y="686" class="port mono" text-anchor="middle">Q1</text>
<rect x="524.0" y="674" width="20" height="20" rx="4" fill="#dc2626" stroke="none"/>
<text x="534.0" y="688" class="port" text-anchor="middle" style="fill:white">H</text>
<text x="490" y="737" class="small" text-anchor="middle">palace</text>
</g>
<g><title>dave Q2: castle — 100G; whole cage</title>
<rect x="584.0" y="695" width="92" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="590.0" y="700" width="80" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="630" y="686" class="port mono" text-anchor="middle">Q2</text>
<text x="630" y="737" class="small" text-anchor="middle">castle</text>
</g>
<g><title>dave Q4: qsfp28-4-1 — No identified peer</title>
<rect x="864.0" y="695" width="92" height="27" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="870.0" y="700" width="80" height="17" rx="1" fill="#28364a" stroke="none"/>
<text x="910" y="686" class="port mono" text-anchor="middle">Q4</text>
<text x="910" y="737" class="small" text-anchor="middle">unmapped</text>
</g>
<g><title>dave MGMT: management — 100M management RJ45</title>
<rect x="1095.0" y="741" width="54" height="24" rx="3" fill="#fff" stroke="#64748b"/>
<rect x="1101.0" y="746" width="42" height="14" rx="1" fill="#28364a" stroke="none"/>
<text x="1122" y="732" class="port mono" text-anchor="middle">MGMT</text>
<rect x="1137.0" y="720" width="20" height="20" rx="4" fill="#64748b" stroke="none"/>
<text x="1147.0" y="734" class="port" text-anchor="middle" style="fill:white">E</text>
</g>
<text x="485" y="870" class="port mono" text-anchor="start">Q3.1</text>
<rect x="536" y="854" width="20" height="20" rx="4" fill="#0891b2" stroke="none"/>
<text x="546" y="868" class="port" text-anchor="middle" style="fill:white">D</text>
<text x="485" y="889" class="small" text-anchor="start">jim SFP+1</text>
<rect x="568" y="854" width="34" height="20" rx="3" fill="white" stroke="#0891b2"/>
<rect x="574" y="860" width="22" height="8" rx="1" fill="#0891b2" stroke="none"/>
<text x="685" y="870" class="port mono" text-anchor="start">Q3.2</text>
<rect x="736" y="854" width="20" height="20" rx="4" fill="#2563eb" stroke="none"/>
<text x="746" y="868" class="port" text-anchor="middle" style="fill:white">A</text>
<text x="685" y="889" class="small" text-anchor="start">brian SFP+1</text>
<rect x="768" y="854" width="34" height="20" rx="3" fill="white" stroke="#2563eb"/>
<rect x="774" y="860" width="22" height="8" rx="1" fill="#2563eb" stroke="none"/>
<text x="885" y="870" class="port mono" text-anchor="start">Q3.3</text>
<rect x="936" y="854" width="20" height="20" rx="4" fill="#4f46e5" stroke="none"/>
<text x="946" y="868" class="port" text-anchor="middle" style="fill:white">K</text>
<text x="885" y="889" class="small" text-anchor="start">stream LAN</text>
<rect x="968" y="854" width="34" height="20" rx="3" fill="white" stroke="#4f46e5"/>
<rect x="974" y="860" width="22" height="8" rx="1" fill="#4f46e5" stroke="none"/>
<text x="1085" y="870" class="port mono" text-anchor="start">Q3.4</text>
<rect x="1136" y="854" width="20" height="20" rx="4" fill="#7c3aed" stroke="none"/>
<text x="1146" y="868" class="port" text-anchor="middle" style="fill:white">B</text>
<text x="1085" y="889" class="small" text-anchor="start">brian SFP+2</text>
<rect x="1168" y="854" width="34" height="20" rx="3" fill="white" stroke="#7c3aed"/>
<rect x="1174" y="860" width="22" height="8" rx="1" fill="#7c3aed" stroke="none"/>
<rect x="205" y="1090" width="290" height="76" rx="5" fill="white" stroke="#dc2626"/>
<text x="232" y="1120" class="port mono" text-anchor="start">uplink-dave</text>
<rect x="459" y="1102" width="20" height="20" rx="4" fill="#dc2626" stroke="none"/>
<text x="469" y="1116" class="port" text-anchor="middle" style="fill:white">H</text>
<text x="350" y="1146" class="small" text-anchor="middle">Mellanox ConnectX-4 · 100G QSFP28</text>
<rect x="585" y="1090" width="290" height="76" rx="5" fill="white" stroke="#16a34a"/>
<text x="612" y="1120" class="port mono" text-anchor="start">host-jim</text>
<rect x="839" y="1102" width="20" height="20" rx="4" fill="#16a34a" stroke="none"/>
<text x="849" y="1116" class="port" text-anchor="middle" style="fill:white">F</text>
<text x="730" y="1146" class="small" text-anchor="middle">Intel I211 · 1G RJ45</text>
<rect x="965" y="1090" width="290" height="76" rx="5" fill="white" stroke="#db2777"/>
<text x="992" y="1120" class="port mono" text-anchor="start">river-jim-phy</text>
<rect x="1219" y="1102" width="20" height="20" rx="4" fill="#db2777" stroke="none"/>
<text x="1229" y="1116" class="port" text-anchor="middle" style="fill:white">G</text>
<text x="1110" y="1146" class="small" text-anchor="middle">Intel I211 · 1G RJ45</text>
<text x="95" y="1220" class="sub" text-anchor="start">Matching letter badges identify cable ends. Port labels describe configured use; they do not indicate current link state.</text>
</g></svg>

After

Width:  |  Height:  |  Size: 39 KiB

+608
View File
@@ -0,0 +1,608 @@
{
"view": "Front view; rack order is brian, jim, dave, then palace several U below. Socket order is physical; spacing and chassis widths are schematic. Stream sits physically left of brian and is drawn above it.",
"sources": {
"brian": "https://dl.ui.com/qig/usw-pro-xg-8-poe/",
"jim": "https://mikrotik.com/product/CRS326-24G-2SplusRM",
"dave": "https://mikrotik.com/product/crs504_4xq_in",
"stream": "https://www.gowinfanless.com/news/blogs/the-r86s-revolution-low-power-2-5gbe-and-10gbe-networking"
},
"brian": {
"model": "USW-Pro-XG-8-PoE",
"ports": [
{
"socket": "1",
"interface": "Port 1",
"label": "fort",
"role": "Configured port label",
"peer": "fort",
"peer_port": null
},
{
"socket": "2",
"interface": "Port 2",
"label": "castle",
"role": "Configured port label",
"peer": "castle",
"peer_port": null
},
{
"socket": "3",
"interface": "Port 3",
"label": "portcullis test",
"role": "portcullis test connection",
"peer": "portcullis",
"peer_port": null
},
{
"socket": "4",
"interface": "Port 4",
"label": "portcullis KVM",
"role": "Second JetKVM",
"peer": "portcullis-kvm",
"peer_port": null
},
{
"socket": "5",
"interface": "Port 5",
"label": "jim P7",
"role": "Backup fabric trunk",
"peer": "jim",
"peer_port": "7"
},
{
"socket": "6",
"interface": "Port 6",
"label": "Digiweb ONT",
"role": "Native VLAN 140; tagged VLAN 10",
"peer": "Digiweb ONT",
"peer_port": null
},
{
"socket": "7",
"interface": "Port 7",
"label": "wave",
"role": "AP trunk",
"peer": "wave",
"peer_port": "eth0"
},
{
"socket": "8",
"interface": "Port 8",
"label": "vibe",
"role": "AP trunk",
"peer": "vibe",
"peer_port": "ether1"
},
{
"socket": "9",
"interface": "SFP+ 1",
"label": "dave Q3.2",
"role": "LAG member 1",
"peer": "dave",
"peer_port": "Q3.2"
},
{
"socket": "10",
"interface": "SFP+ 2",
"label": "dave Q3.4",
"role": "LAG member 2",
"peer": "dave",
"peer_port": "Q3.4"
}
]
},
"jim": {
"model": "CRS326-24G-2S+RM",
"ports": [
{
"socket": "1",
"interface": "ether1",
"default_name": "ether1",
"label": "shytzel LAG",
"role": "Configured member of shytzel-downlink",
"peer": "shytzel",
"peer_port": null
},
{
"socket": "2",
"interface": "ether2",
"default_name": "ether2",
"label": "shytzel LAG",
"role": "Configured member of shytzel-downlink",
"peer": "shytzel",
"peer_port": null
},
{
"socket": "3",
"interface": "ether3",
"default_name": "ether3",
"label": "shytzel LAG",
"role": "Configured member of shytzel-downlink",
"peer": "shytzel",
"peer_port": null
},
{
"socket": "4",
"interface": "ether4",
"default_name": "ether4",
"label": "shytzel LAG",
"role": "Configured member of shytzel-downlink",
"peer": "shytzel",
"peer_port": null
},
{
"socket": "5",
"interface": "palace",
"default_name": "ether5",
"label": "palace host",
"role": "Core / netboot trunk",
"peer": "palace",
"peer_port": "host-jim"
},
{
"socket": "6",
"interface": "stream",
"default_name": "ether6",
"label": "stream LAN",
"role": "Backup RSTP trunk",
"peer": "stream",
"peer_port": "lan-jim"
},
{
"socket": "7",
"interface": "brian-downlink",
"default_name": "ether7",
"label": "brian P5",
"role": "Backup fabric trunk",
"peer": "brian",
"peer_port": "RJ45 5"
},
{
"socket": "8",
"interface": "palace-kvm",
"default_name": "ether8",
"label": "JetKVM",
"role": "lo access",
"peer": "palace-kvm",
"peer_port": null
},
{
"socket": "9",
"interface": "ether9",
"default_name": "ether9",
"label": "spare",
"role": "Unbridged spare",
"peer": null,
"peer_port": null
},
{
"socket": "10",
"interface": "castle",
"default_name": "ether10",
"label": "castle",
"role": "Backup attachment, normally down",
"peer": "castle",
"peer_port": "et2.5g"
},
{
"socket": "11",
"interface": "fort",
"default_name": "ether11",
"label": "fort",
"role": "lo access (configured label)",
"peer": "fort",
"peer_port": null
},
{
"socket": "12",
"interface": "laptop-dock",
"default_name": "ether12",
"label": "dock",
"role": "lo access (configured label)",
"peer": "laptop-dock",
"peer_port": null
},
{
"socket": "13",
"interface": "pronter",
"default_name": "ether13",
"label": "pronter",
"role": "lo access (configured label)",
"peer": "pronter",
"peer_port": null
},
{
"socket": "14",
"interface": "untrusted-sta1",
"default_name": "ether14",
"label": "guest",
"role": "Untrusted access",
"peer": "untrusted-sta1",
"peer_port": null
},
{
"socket": "15",
"interface": "ether15",
"default_name": "ether15",
"label": "unmapped",
"role": "lo access; peer unconfirmed",
"peer": null,
"peer_port": null
},
{
"socket": "16",
"interface": "ether16",
"default_name": "ether16",
"label": "unmapped",
"role": "lo access; peer unconfirmed",
"peer": null,
"peer_port": null
},
{
"socket": "17",
"interface": "ether17",
"default_name": "ether17",
"label": "unmapped",
"role": "lo access; peer unconfirmed",
"peer": null,
"peer_port": null
},
{
"socket": "18",
"interface": "ether18",
"default_name": "ether18",
"label": "unmapped",
"role": "lo access; peer unconfirmed",
"peer": null,
"peer_port": null
},
{
"socket": "19",
"interface": "ether19",
"default_name": "ether19",
"label": "unmapped",
"role": "lo access; peer unconfirmed",
"peer": null,
"peer_port": null
},
{
"socket": "20",
"interface": "ether20",
"default_name": "ether20",
"label": "unmapped",
"role": "lo access; peer unconfirmed",
"peer": null,
"peer_port": null
},
{
"socket": "21",
"interface": "stream-wan",
"default_name": "ether21",
"label": "stream WAN",
"role": "Untagged VLAN 130 handoff",
"peer": "stream",
"peer_port": "wan"
},
{
"socket": "22",
"interface": "river",
"default_name": "ether22",
"label": "river backup",
"role": "Dedicated router trunk",
"peer": "palace",
"peer_port": "river-jim-phy"
},
{
"socket": "23",
"interface": "ups",
"default_name": "ether23",
"label": "UPS",
"role": "lo access",
"peer": "ups",
"peer_port": null
},
{
"socket": "24",
"interface": "dave-management",
"default_name": "ether24",
"label": "dave mgmt",
"role": "Core management",
"peer": "dave",
"peer_port": "MGMT"
},
{
"socket": "S1",
"interface": "dave-uplink",
"default_name": "sfp-sfpplus1",
"label": "dave Q3.1",
"role": "10G fabric trunk",
"peer": "dave",
"peer_port": "Q3.1"
},
{
"socket": "S2",
"interface": "sfp-spare",
"default_name": "sfp-sfpplus2",
"label": "fergal",
"role": "10G trunk; colony staging",
"peer": "fergal",
"peer_port": "lan1"
}
]
},
"dave": {
"model": "CRS504-4XQ-IN",
"ports": [
{
"socket": "Q1",
"interface": "palace",
"default_name": "qsfp28-1-1",
"label": "palace",
"role": "100G; whole cage",
"peer": "palace",
"peer_port": "uplink-dave"
},
{
"socket": "Q2",
"interface": "castle",
"default_name": "qsfp28-2-1",
"label": "castle",
"role": "100G; whole cage",
"peer": "castle",
"peer_port": "et100g"
},
{
"socket": "Q3.1",
"interface": "jim-downlink",
"default_name": "qsfp28-3-1",
"label": "jim SFP+1",
"role": "10G breakout lane 1",
"peer": "jim",
"peer_port": "S1"
},
{
"socket": "Q3.2",
"interface": "brian1",
"default_name": "qsfp28-3-2",
"label": "brian SFP+1",
"role": "10G breakout lane 2; LAG",
"peer": "brian",
"peer_port": "9"
},
{
"socket": "Q3.3",
"interface": "stream",
"default_name": "qsfp28-3-3",
"label": "stream LAN",
"role": "10G breakout lane 3",
"peer": "stream",
"peer_port": "lan-dave"
},
{
"socket": "Q3.4",
"interface": "brian2",
"default_name": "qsfp28-3-4",
"label": "brian SFP+2",
"role": "10G breakout lane 4; LAG",
"peer": "brian",
"peer_port": "10"
},
{
"socket": "Q4",
"interface": "qsfp28-4-1",
"default_name": "qsfp28-4-1",
"label": "unmapped",
"role": "No identified peer",
"peer": null,
"peer_port": null
},
{
"socket": "MGMT",
"interface": "management",
"default_name": "ether1",
"label": "jim P24",
"role": "100M management RJ45",
"peer": "jim",
"peer_port": "24"
}
]
},
"links": [
{
"id": "A",
"from": [
"brian",
"9"
],
"to": [
"dave",
"Q3.2"
],
"description": "10G; first LAG member"
},
{
"id": "B",
"from": [
"brian",
"10"
],
"to": [
"dave",
"Q3.4"
],
"description": "10G; second LAG member"
},
{
"id": "C",
"from": [
"brian",
"5"
],
"to": [
"jim",
"7"
],
"description": "1G; redundant fabric trunk"
},
{
"id": "D",
"from": [
"jim",
"S1"
],
"to": [
"dave",
"Q3.1"
],
"description": "10G; direct fabric trunk"
},
{
"id": "E",
"from": [
"jim",
"24"
],
"to": [
"dave",
"MGMT"
],
"description": "100M; dave management"
},
{
"id": "F",
"from": [
"jim",
"5"
],
"to": [
"palace",
"host-jim"
],
"description": "1G; host core / netboot"
},
{
"id": "G",
"from": [
"jim",
"22"
],
"to": [
"palace",
"river-jim-phy"
],
"description": "1G; river backup trunk"
},
{
"id": "H",
"from": [
"dave",
"Q1"
],
"to": [
"palace",
"uplink-dave"
],
"description": "100G; host PF and guest VFs"
},
{
"id": "I",
"from": [
"stream",
"ETH0"
],
"to": [
"jim",
"21"
],
"description": "1G WAN; 2.5G socket on stream"
},
{
"id": "J",
"from": [
"stream",
"ETH1"
],
"to": [
"jim",
"6"
],
"description": "1G backup LAN; 2.5G socket on stream"
},
{
"id": "K",
"from": [
"stream",
"SFP+ R"
],
"to": [
"dave",
"Q3.3"
],
"description": "10G preferred LAN"
}
],
"stream": {
"model": "BROUNION R86S",
"ports": [
{
"socket": "ETH0",
"interface": "wan",
"label": "wan",
"role": "1G connection to jim 21",
"nic": "Intel I225-V",
"capacity": "2.5G"
},
{
"socket": "ETH1",
"interface": "lan-jim",
"label": "lan-jim",
"role": "1G connection to jim 6",
"nic": "Intel I225-V",
"capacity": "2.5G"
},
{
"socket": "ETH2",
"interface": "et2",
"label": "et2",
"role": "Unused",
"nic": "Intel I225-V",
"capacity": "2.5G"
},
{
"socket": "SFP+ R",
"interface": "lan-dave",
"label": "lan-dave",
"role": "10G connection to dave Q3.3",
"nic": "Mellanox ConnectX-3",
"capacity": "10G"
},
{
"socket": "SFP+ L",
"interface": "et5",
"label": "et5",
"role": "Unused",
"nic": "Mellanox ConnectX-3",
"capacity": "10G"
}
]
},
"palace": {
"ports": [
{
"socket": "uplink-dave",
"nic": "Mellanox ConnectX-4",
"capacity": "100G QSFP28"
},
{
"socket": "host-jim",
"nic": "Intel I211",
"capacity": "1G RJ45"
},
{
"socket": "river-jim-phy",
"nic": "Intel I211",
"capacity": "1G RJ45"
}
]
}
}
+239
View File
@@ -0,0 +1,239 @@
# palace
The physical VM host for the home site. Runs the `river`, `cellar`, `sfh` and `slop-cannon` VMs and
feeds them SR-IOV VFs, PCI NVMe drives, LVM disks and an NVMe-oF disk.
- **Source:** [`nixos/boxes/home/palace/default.nix`](../../../nixos/boxes/home/palace/default.nix)
(VM definitions in [`palace/vms/default.nix`](../../../nixos/boxes/home/palace/vms/default.nix))
- **Host:** physical
- **nixpkgs:** `mine-stable`
## Hardware
| Component | Inventory |
|---|---|
| Platform | Gigabyte X399 DESIGNARE EX |
| CPU | AMD Ryzen Threadripper 1950X (16 cores / 32 threads) |
| Memory | 128 GiB |
| Host storage | 500 GB Samsung SSD 860 EVO containing the EFI partition and the `main` LVM thin pool |
| Bulk storage | Three 8 TB Seagate IronWolf disks in the `hdds` VG, providing the RAID-backed `hdd-storage` and `frigate` LVs |
| NVMe storage | Three 2 TB Samsung NVMe devices passed through to `cellar`; SPDK combines them as the `NVMeRaid` RAID 0 device |
| Network / graphics | Mellanox ConnectX-4 100G adapter using SR-IOV, two Intel I211 Gigabit Ethernet controllers (the only BASE-T NICs), and an AMD Radeon RX 550/560-family GPU |
## Role
- Home hypervisor: VMs are declared in `my.vms.instances`
([`palace/vms/default.nix`](../../../nixos/boxes/home/palace/vms/default.nix)); disks are LVs in
the `main` thin pool (`services.lvm.boot.thin.enable`).
- AMD box (`kvm-amd`, `amd_iommu=on`, microcode updates); the kernel is built with
`ACPI_APEI_PCIEAER`/`PCIEAER` for the PCIe passthrough work below.
- Runs [`slop-broker`](../../slop-broker.md) for `slop-cannon`'s agents (see
[below](#slop-broker)).
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `palace`).
## Networking
100G `uplink-dave` (mlx5, MTU 9000) connects to the `dave` switch and carries `lan-hi` (VLAN 100,
the `hi` assignment). A udev rule creates six SR-IOV VFs on the PF. Two physically separate Intel
connections lead to `jim`: `host-jim` serves `palace` and `sfh`, while `river-jim-phy` is exported
exclusively to `river`.
- `lan-core` is a bridge with the `core` assignment (no gateway); the 1G `host-jim` connection and
the `lan-lo-phy` VLAN ride on it. `lan-lo` is a second, L3-less bridge used for VM netboot and
`lo` clients.
- The separate 1G `river-jim-phy` connection is exported exclusively to `river` as the
passthru-mode macvtap `river-jim-tap`; the guest names it `lan-jim`. Direct PCI passthrough is
blocked by its shared X399 IOMMU group; see [PCI isolation](#pci-isolation).
### PCI isolation
The Intel I211 controllers at `04:00.0` (`river-jim-phy`) and `06:00.0` (`host-jim`) share IOMMU
group 13 with chipset USB/SATA controllers, PCIe bridges and the wireless controller. Passing
only the router NIC through VFIO would leave the group nonviable; detaching the whole group
would remove essential host devices. The dedicated passthru-mode macvtap keeps the NIC host-owned.
Direct passthrough would need a NIC or firmware layout that isolates the controller.
Keep both Intel connections: `host-jim` provides independent host management and VM netboot,
while `river-jim-phy` carries the router's redundant trunk. The host physical router interface and
its macvtap both use `hiMTU`; the macvtap enables all-multicast reception so guest RSTP can receive
BPDUs without a guest-to-host receive-filter synchronization service.
### End-to-end interface topology
```text
dave
└─ palace uplink-dave (ConnectX-4 PF)
├─ VLAN 100 ───────────────────────────────> palace lan-hi ───> cellar NVMe/RDMA (slop-cannon's disk)
├─ VF 0 cellar-hi ────────────────────────> cellar lan-hi
├─ VF 1 river-rdma ───────────────────────> river rdma-hi ──> cellar NVMe/RDMA
├─ VF 2 sfh-hi ───────────────────────────> sfh lan-hi ─────> cellar NVMe/RDMA
├─ VF 3 sfh-ctrs ─────────────────────────> sfh ctrs-hi
│ ├─> hass host0
│ └─> unifi host0
├─ VF 4 river-dave ───────────────────────> river lan-dave ──┐
└─ VF 5 slop-cannon-ut ───> slop-cannon lan-untrusted │
├─> river lan (RSTP)
jim │
├─ palace river-jim-phy ── river-jim-tap ─────> river lan-jim ───┘
└─ palace host-jim ──> palace lan-core
├─ sfh-core-tap ───────────────────────────> sfh ctrs-core ──> unifi lan-core
└─ VLAN 110 lan-lo-phy ──> palace lan-lo
└─ sfh-lo-tap ──────────────────────────> sfh ctrs-lo
├─> sfh PXE
└─> hass lan-lo
```
Inside `river`, `lan-dave` and `lan-jim` terminate on the shared `lan` RSTP bridge. `lan-core` is a
MACVLAN above it; `lan-hi`, `lan-lo` and `lan-untrusted` are VLAN uppers. `river` also adds its
Digiweb VLANs 10 and 140 to this bridge. `rdma-hi` is deliberately outside it.
VF 4 explicitly enables trust and disables MAC spoof checking for bridge traffic, which can use
MACs other than the VF's assigned address. Its automatic link state follows the physical port;
the storage VFs retain forced link state so local VF-to-VF storage can continue without carrier.
The firmware must expose enough VFs before the udev allocation can succeed.
### Interface map
The physical connections terminate on `palace`; PCI VFs and virtual interfaces hand traffic
from the host to its guests. Interface names in the destination columns belong to that box.
#### Physical connections
| Switch port | Host interface | Host networks | Guest handoff |
|---|---|---|---|
| `dave` `palace` | `uplink-dave` | VLAN 100 → `lan-hi` | Six PCI VFs, listed below |
| `jim` `palace` | `host-jim` | Native `core` → `lan-core`; VLAN 110 → `lan-lo-phy` → `lan-lo` | `sfh-core-tap` and `sfh-lo-tap` |
| `jim` `river` | `river-jim-phy` | No host L3 configuration | `river-jim-tap` macvtap → `river` `lan-jim` |
#### ConnectX-4 VFs
All six VFs belong to `uplink-dave`. VLAN filtering and carrier policy are applied on the PF.
| VF / PCI BDF | QEMU device | Guest | Guest interface | VLAN / carrier | Role |
|---|---|---|---|---|---|
| 0 / `44:00.1` | `cellar-hi` | [cellar](cellar.md) | `lan-hi` | 100 / forced up | Storage target and management |
| 1 / `44:00.2` | `river-rdma` | [river](river.md#storage) | `rdma-hi` | 100 / forced up | Dedicated NVMe/RDMA root path |
| 2 / `44:00.3` | `sfh-hi` | [sfh](sfh/README.md) | `lan-hi` | 100 / forced up | NVMe/RDMA root and management |
| 3 / `44:00.4` | `sfh-ctrs` | [sfh](sfh/README.md#networking) | `ctrs-hi` | 100 / forced up | Container `hi` network |
| 4 / `44:00.5` | `river-dave` | [river](river.md#virtual-machine-and-network-attachment) | `lan-dave` | Unfiltered trunk / automatic | Preferred RSTP attachment |
| 5 / `44:00.6` | `slop-cannon-ut` | [slop-cannon](slop-cannon.md#network) | `lan-untrusted` | 120 / automatic | Agents' only network. MAC spoof checking is on. |
#### Virtual Ethernet handoffs
| Host interface | Kind / parent | Guest interface | Downstream use |
|---|---|---|---|
| `river-jim-tap` | Passthru macvtap on `river-jim-phy` | `river` `lan-jim` | Backup RSTP attachment |
| `sfh-core-tap` | TAP on `lan-core` | `sfh` `ctrs-core` | `unifi` `lan-core` |
| `sfh-lo-tap` | TAP on `lan-lo` | `sfh` `ctrs-lo` | PXE boot; `hass` `lan-lo` |
`sfh` keeps no L3 configuration on the three `ctrs-*` parents. Its nspawn configuration creates the
container-side names shown above; `host0` remains the default `hi` interface in both containers.
See [the `sfh` page](sfh/README.md#networking) for its container-oriented view and
[failover validation](router-failover.md) for tested failure scenarios and maintenance checks.
## VMs
The RAID-backed `hdds` LVs need `dm-raid` loaded in the initrd: LVM's initial autoactivation can
run before stage-two module loading. `sfh` requires the `frigate` LV before QEMU can start.
| VM | vCPUs | RAM | Passthrough | Notes |
|---|---|---|---|---|
| `cellar` | 8c × 2t | 16 GiB | `cellar-hi` VF 0 (`44:00.1`); NVMe `41:00.0`–`43:00.0` | pinned to NUMA node 1; split IRQ chip + vIOMMU |
| `river` | 3c × 2t | 4 GiB | `river-rdma` VF 1 (`44:00.2`), `river-dave` VF 4 (`44:00.5`), `river-jim-tap` | only an ESP local disk (plus an installer ISO) — root is NVMe-oF from `cellar` |
| `sfh` | 8c × 2t | 32 GiB | `sfh-hi` VF 2 (`44:00.3`), `sfh-ctrs` VF 3 (`44:00.4`); two USB host ports | no boot disk — netboots; gets the `hdds/frigate` LV |
| `slop-cannon` | 16c × 2t | 24 GiB | `slop-cannon-ut` VF 5 (`44:00.6`) | disk is NVMe-oF from `cellar`, connected by `palace` (plus an installer ISO) |
`slop-cannon`'s vCPUs are overcommitted (the VMs total more vCPUs than the host's 32 threads) so
coding agents can burst; `vm@slop-cannon` has a low `CPUWeight`, so `cellar`, `river` and `sfh`
win under contention.
Boot ordering is enforced with systemd dependencies: `vm@river` waits for `cellar`'s SSH port (and
for the `river-jim-tap` device), and `vm@sfh` waits for `river` — storage first, then the router,
then everything that boots off both. `vm@slop-cannon` waits only for its disk (below); nothing
waits for it.
`vm@` units don't restart on deploy (`restartIfChanged = false`); a changed VM config applies the
next time the VM starts.
### `slop-cannon`'s disk
`palace` is an NVMe-oF initiator for one guest: `slop-cannon`'s disk is
`nqn.2016-06.io.spdk:slop-cannon` on [`cellar`](cellar.md), connected by `palace` (`my.nvme.uuid`
is its host NQN) and passed to QEMU as a virtio disk. The guest never speaks NVMe-oF itself:
SPDK only checks the host NQN, which root in the guest could forge.
`palace` hosts `cellar`, so the connection is kept out of `palace`'s own boot and shutdown:
- `slop-cannon-disk.service` waits for `cellar`'s SSH port, runs `nvme connect -t rdma` over
`lan-hi` and disconnects on stop. It is `BindsTo` / `After` `vm@cellar`, and only
`vm@slop-cannon` requires it. Nothing in the initrd, `fileSystems` or `multi-user.target` uses
the disk.
- Shutdown runs in reverse: `vm@slop-cannon`, then the disconnect, then `cellar`.
- `--ctrl-loss-tmo 60`: if `cellar` dies, the controller is removed after a minute and QEMU sees
I/O errors, instead of the kernel retrying forever.
- `devices/global_filter` rejects `/dev/nvme*` in `lvm.conf`, so `palace` never activates the
guest's volume group (also called `main`). `palace` has no NVMe of its own.
- The filter has no accept pattern: LVM accepts a device if any of its names matches one, and
the disk's `/dev/disk/by-*` links would.
- Without it, `palace` sees two VGs called `main`, and LVM commands naming `main` refuse to
run.
## `slop-broker`
`palace` runs [`slop-broker`](../../slop-broker.md), which carries out privileged operations for
the agents on `slop-cannon` after policy and, usually, a human approve them.
- `slop-cannon` reaches it only over vsock: the VM has a `vhost-vsock-pci` device, and the broker
identifies it by that device's CID. Policy is set per operation in
[`palace/slop-broker.nix`](../../../nixos/boxes/home/palace/slop-broker.nix).
- The broker holds the deploy key (age secret `palace/slop-broker-deploy.key`). That key is root on
every box, so `palace` must be treated as being as sensitive as a workstation with `.keys/`.
- Deploys are built by `slop-broker-build`, a user without keys that the broker reaches over SSH
(`services.slop-broker-builder`). It fetches
commits from Gitea with a read-only deploy key on `dev/nixfiles` (age secret
`palace/slop-broker-git.key`, mirrored in `/var/lib/slop-broker-build/repository.git`) and builds
with `palace`'s Nix daemon, so builds use the host's spare CPU and memory.
- Because they run agent-written Nix, builds (the `nixbld` group) and the builder's own fetches
are kept off internal networks like `lan-untrusted` is (`lib.my.c.internalNets`), and only
`git` gets the builder's Gitea key. `nix-daemon.service` has memory limits and a low
`CPUWeight`, so builds can't starve the VMs. Builds you run on `palace` yourself are confined
the same way.
- Agents' use of the builder (the `builder` step of `slop deploy` and `slop build`) asks, showing
the commits and their diff, with a one-hour lease on offer; commits already on `master` don't
ask. `slop build` then pushes without asking again, while deploys still ask once built.
- `slop build` outputs are pushed to the binary cache on [`object`](../colony/shill/containers/object.md)
as `harmonia`, with a key of the broker's own (age secret `palace/slop-broker-cache.key`) whose
forced command allows only the store protocol and adding GC roots (see
[Binary cache](../../slop-broker.md#binary-cache)).
- The broker's age identity (age secret `palace/slop-broker-age.key`, public key
`.keys/slop-broker.pub`) is a recipient of every secret, so it can carry out `slop secret`. Its
builder looks each request's file up on `master` and evaluates `master`'s `secrets.nix` for the
approval (see [Secrets](../../slop-broker.md#secrets)). Listing a secret's keys doesn't ask;
everything else does, and reading one never offers a lease.
- Answer requests on `palace` as `dev` with `slop-approve`. In a terminal it shows each request
in full, asks for an answer and waits for new ones; `slop-approve list` and
`slop-approve <id> <decision>` (any unique ID prefix) work from scripts. `slop-approve log`
shows recent requests, answers and results from the audit log
(`/var/lib/slop-broker/audit.jsonl`, also in the journal).
- The [approvals web app](../../slop-broker.md#approvals-web-app) listens on TCP port 8095,
which the firewall opens only to `middleman`, the reverse proxy for `approve.slop.nul.ie`.
Approvers sign in through Pocket ID (client secret in age secret
`palace/slop-broker-oidc-secret`); its sessions, push subscriptions and push signing key are in
`/var/lib/slop-broker/web`. Deploys to the routers need a fresh passkey there.
- Requesters and approvers on other boxes log in over SSH as `slop`, whose keys can only run the
broker's forced command (see
[Other requesters and approvers](../../slop-broker.md#other-requesters-and-approvers)). The
agents on `castle` are the requester `castle`, with the same policy as `slop-cannon`, and
`castle` also has an approver key (`sshApprovers.castle`).
## Notable config files
- [`nixos/boxes/home/palace/default.nix`](../../../nixos/boxes/home/palace/default.nix) — host
hardware, networkd (links/bridges/SR-IOV), LVM.
- [`nixos/boxes/home/palace/vms/default.nix`](../../../nixos/boxes/home/palace/vms/default.nix) —
VM instances, boot ordering and `slop-cannon`'s disk connection.
- [`nixos/boxes/home/palace/slop-broker.nix`](../../../nixos/boxes/home/palace/slop-broker.nix) —
the broker's policy for `slop-cannon`, its deploy key and the VM's vsock device.
+102
View File
@@ -0,0 +1,102 @@
# river
A home router VM on `palace` with a Digiweb PPPoE WAN on the ISP's VLAN 10. It forms the redundant
router pair with [`stream`](stream.md).
- **Source:** [`nixos/boxes/home/palace/vms/river.nix`](../../../nixos/boxes/home/palace/vms/river.nix)
(shared router config: [`routing-common`](../../../nixos/boxes/home/routing-common), index 0)
- **Host:** VM on `palace`
- **nixpkgs:** `mine`
## Role
At `routing-common` index 0, `river` normally holds the primary position in the router pair.
Pair-wide addressing, VIP, DHCP/DNS and failover behavior is documented in the
[`home` networking overview](../../networking.md#home) and [Router HA](../../networking.md#router-ha).
This page covers `river`'s Digiweb WAN, VM platform, storage and netboot duties.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `river`).
## WAN (Digiweb PPPoE)
### Link and addressing
`services.pppd` peer `digiweb` attaches directly to `wan-pon-isp`, the raw ISP VLAN 10
(`vlans.pon-isp`) trunked untranslated from the ONT. It normally reaches `river` through `brian`
and `dave`; the configured RSTP path through `jim` is intended to provide redundancy after
successful deployment and validation. See [switches.md](switches.md). The netdev has no L3
configuration and uses `MTUBytes=1508`, leaving a clean `mtu`/`mru 1500` after PPPoE overhead.
The static `84.203.124.128` address is requested through IPCP. The provider-wide credentials are
deliberately not secret; the peer persists indefinitely with LCP echo monitoring and ignores
Digiweb DNS in favor of the local recursor.
### Management subnet
`wan-pon-ont` (VLAN 140, PVID'd at `brian`) holds `192.168.100.100/24`, reaching the ONT UI at
`192.168.100.1`. The `.100` address follows `stream`'s modem-management convention.
### WAN readiness
The `pppd` hooks drive this shared gate with `DefaultDependencies=false`: `ip-up` installs the
link-scoped default route and starts the target, while `ip-down` stops it and removes the route.
`ipsec` and `ipv6-clear-default-route` attach through `wantedBy` + `partOf`, so they reload after
every WAN flap.
### Traffic shaping
CAKE and the `wan-ifb` network configuration remain specific to `stream`. The shared IFB netdev
exists here but has no matching `.network` file to trigger the ingress-mirroring rule. The source
enables the shared `networkd-dispatcher` for RSTP setup.
## Platform
### Virtual machine and network attachment
The router's ordinary networks sit above the `lan` RSTP bridge. Its preferred port, `lan-dave`, is
an unfiltered ConnectX-4 VF trunk; `lan-jim` is the 1G `river-jim-tap` macvtap exported by
`palace`. Native `core`, the client VLANs and Digiweb VLANs 10/140 use `dave` normally and fail
over to `jim`. The shared policy is documented in [Router HA](../../networking.md#router-ha);
[failover validation](router-failover.md) covers attachment and switch outages.
The bridge uses the trunk VF's assigned MAC so the ConnectX-4's local switching can deliver
traffic from `palace` and the other VFs to the router. On `lan-hi` and `rdma-hi`, `arp_ignore=1`
and `arp_announce=2` keep router and storage addresses on their respective interfaces; otherwise
the storage VF can answer ARP for the router VIP and attract traffic to the wrong interface.
The separate ConnectX-4 VF `rdma-hi` is not a bridge port. It has a PF-applied VLAN 100 and exists
only for storage traffic.
Ordinary Ethernet traverses the guest software bridge; this does not require mlx5
switchdev or host representors. The bridge disables LRO on its ports; RDMA stays outside this
path.
### Storage
The VM's local disk holds only an ESP; `/nix` and `/persist` are LVs on `cellar`'s
`nqn.2016-06.io.spdk:river` namespace over RDMA. The initrd brings up `rdma-hi` with the dedicated
`rdma` assignment and a link-scoped host route to `cellar`, alongside `roceBootModules`.
NixOS copies the main system's `.link` units into the systemd initrd, so the `rdma-hi` rename is
shared, but its `.network` and `.netdev` units are separate. `river` therefore declares the storage
assignment and route once under `boot.initrd.systemd.network` and again under the main
`systemd.network`. The systemd initrd leaves its kernel network state in place during the stage-two
handover; `KeepConfiguration=static` on the main `.network` prevents networkd from dropping and
recreating the static address and route underneath the mounted NVMe-oF root. An installer ISO
remains attached.
## Netboot
`my.netboot.server` serves iPXE/TFTP for `sfh` and `castle` at `boot.h.nul.ie` from the `lo`
assignment, restricted to the `hi` and `lo` prefixes.
## Notable config files
- [`nixos/boxes/home/palace/vms/river.nix`](../../../nixos/boxes/home/palace/vms/river.nix) — box
config: pppd, WAN VLANs, `wan-online.target` hooks, netboot server, NVMe-oF boot.
- [`nixos/boxes/home/routing-common/default.nix`](../../../nixos/boxes/home/routing-common/default.nix) —
shared router definition (assignments, firewall/NAT, `as211024`).
- [`nixos/boxes/home/palace/vms/default.nix`](../../../nixos/boxes/home/palace/vms/default.nix) —
the VM definition on `palace` (dedicated RDMA VF, trunk VF, macvtap and ESP disk).
+62
View File
@@ -0,0 +1,62 @@
# Router failover validation
Failure-scenario checks for the deployed home router pair. The design lives in
[Router HA](../../networking.md#router-ha), the physical paths in [switches.md](switches.md),
and the host/VF layout in [palace.md](palace.md) and [river.md](river.md).
## Validated scenarios
These checks were performed on 2026-11-15. WAN and ONT probes check Ethernet path availability;
reads from `river`'s root LV and probes over `rdma-hi` check its separate storage path.
| Scenario | Test | Validated behavior |
|---|---|---|
| Router startup | Boot both routers | Kea starts without retries; the configured bridge MAC, ARP policy and administrative RSTP costs are applied |
| Primary router offline | Reboot its host | `stream` takes over both IPv4 and IPv6 VIPs, then returns to standby when `river` recovers |
| Preferred guest port down | Disable `river`'s `lan-dave`, then restore it | `lan-jim` becomes root/forwarding; WAN, ONT and 9000-byte RDMA pings pass while direct root-LV reads continue for 20 seconds |
| Backup guest port down | Disable `river`'s `lan-jim`, then restore it | `lan-dave` stays root/forwarding; WAN, ONT, jumbo RDMA and root-LV read checks pass |
| Physical `palace` attachment lost | Disable `dave`'s `palace` port for 30 seconds with automatic restoration | `lan-dave` loses carrier and `lan-jim` becomes root/forwarding; forced-link storage VFs retain local RDMA and root-LV reads succeed |
| Whole `dave` outage | Reboot the switch | `jim` becomes root and forwards on `brian-downlink`; Digiweb WAN and ONT access use `jim`–`brian` while local RDMA reads continue |
| Whole `jim` outage | Reboot the switch | `river` continues using `dave`; WAN, ONT and root-storage read probes succeed |
| Restoration | Restore each failed attachment or switch | The normal RSTP preferences return and `palace` is reachable on `hi` again |
Brief WAN/ONT probe losses occur during the tested `dave` tree transitions; subsequent probes
succeed on the backup tree and after restoration. The monitors recorded no storage-read
failures or matched kernel NVMe errors. The whole-switch test demonstrates the backup WAN path
without relying on the direct `jim`–`dave` trunk.
## Test limits
The storage checks exercise reads, not write integrity or long-duration endurance. They validate
local VF-to-VF RDMA during physical carrier loss, not failure of the ConnectX-4 itself. Storage
still depends on the adapter, `palace` and `cellar`; see [river's storage](river.md#storage).
`brian`'s live RSTP port state was not captured during the outage tests. Its backup
connection is validated by successful WAN and ONT traffic while `dave` is offline.
Disabling only the guest trunk VF while the host PF remains healthy is an artificial fault:
`palace`'s `hi` return traffic can still target that local VF's MAC and become unreachable through
`river`. During physical carrier loss, external `hi` access to the host and its guests is also
unavailable. `palace` remains accessible on `core` through a jump connection from `stream`;
direct routed management access depends on a working return route.
## Repeating the checks
Perform maintenance from a box independent of `palace`, such as `tower`. Before interrupting
`palace` or `dave`, power `castle` off cleanly: its NVMe-oF root depends on `cellar` and `dave`.
Keep a known-working boot entry and working JetKVM video and keyboard access.
1. Check boot defaults, system profiles, switch VLAN membership and spanning-tree state. When
changing host and guest networking together, stage matching configurations with `deploy --boot`.
2. Verify VF isolation, VLAN/trust/carrier policies, MTUs, the RoCE GID and the mounted NVMe
subsystem before injecting a fault.
3. Arrange independent automatic restoration before disabling an interface or switch port.
Run probes and storage reads in a service that survives loss of the SSH connection; bound
remote commands so a path change cannot leave a check waiting indefinitely.
4. Inject one fault at a time. Monitor root/alternate port roles, native `core`, client VLANs,
ONT access, PPPoE, DNS through the floating VIPs and storage I/O. Capture BPDUs when changing
the topology and watch for returned own-source packets or MAC flapping.
5. Restore the path and verify the normal RSTP roles, VIP ownership, services and management
access before testing another fault.
Switch changes require confirmation; see [switches.md](switches.md#accessing-the-switches).
+64
View File
@@ -0,0 +1,64 @@
# sfh
"Shill from home" — the NixOS container host for the home site. A VM on `palace` that netboots
from `river` and runs its root off NVMe-oF from `cellar`.
- **Source:** [`nixos/boxes/home/palace/vms/sfh/`](../../../../nixos/boxes/home/palace/vms/sfh)
(`default.nix`, `containers/`)
- **Host:** VM on `palace`
- **nixpkgs:** `mine`
## Role
- Runs the home NixOS containers via `my.containers.instances` (systemd-nspawn); each container is
its own `nixos.systems.*` entry rendered through `my.asContainer`.
- **Netboot client** (`my.netboot.client.enable`): the VM has no boot disk — its `netboot` NIC
on palace's `lan-lo` bridge is matched by a kea client-class on [`river`](../river.md) and
iPXE-boots from `boot.h.nul.ie`.
- **Root on NVMe-oF**: `my.nvme.boot` connects to `nqn.2016-06.io.spdk:sfh`
([`cellar`](../cellar.md), RDMA) from the initrd (`lan-hi` up + `roceBootModules`); `/nix` and
`/persist` are LVs on that volume. `KeepConfiguration=static` on `lan-hi` protects the
NVMe-oF address from networkd reconfigures.
- **Frigate footage disk**: palace passes the `hdds/frigate` LVM LV through as a virtio disk;
sfh mounts it at `/mnt/frigate` (by label) and bind-mounts it into the `hass` container at
`/var/lib/frigate`.
- USB: two host ports are passed to the VM (qemu flags) for the Zigbee coordinator and webcam used
by `hass`; the nspawn unit gets `DeviceAllow` for `char-ttyUSB` and `char-video4linux`.
## Network assignments
See the consolidated [network assignments](../../../networking.md#box-assignments) table (this box: `sfh`).
## Networking
| Interface | `palace` attachment | Purpose |
|---|---|---|
| `lan-hi` | `sfh-hi` SR-IOV VF 2 | Box's `hi` assignment and NVMe/RDMA root path; MTU 9000 |
| `ctrs-hi` | `sfh-ctrs` SR-IOV VF 3 | L3-less MACVLAN parent for each container's `host0`; MTU 9000 |
| `ctrs-core` | Virtio via `sfh-core-tap`, `lan-core` and `host-jim` | L3-less MACVLAN parent for UniFi's `lan-core` management attachment |
| `ctrs-lo` | Virtio via `sfh-lo-tap`, `lan-lo` and `host-jim` | L3-less MACVLAN parent for `hass`'s `lan-lo` and the VM's PXE path |
The two VFs separate the box's RDMA root traffic from container `hi` traffic; they do not provide
redundant switch paths. The Virtio attachments reach the `jim`-facing `palace` host bridges. Container
`host0` names are intentionally unchanged.
The per-container MACVLAN wiring lives in `systemd.nspawn.*.networkConfig` in
[`sfh/default.nix`](../../../../nixos/boxes/home/palace/vms/sfh/default.nix). The
[`palace` interface topology](../palace.md#end-to-end-interface-topology) traces these interfaces
back through the VM handoffs to the physical switch connections.
## Containers
| Container | Role |
|---|---|
| [`hass`](containers/hass.md) | Home Assistant + Frigate + MQTT |
| [`unifi`](containers/unifi.md) | UniFi controller |
## Notable config files
- [`nixos/boxes/home/palace/vms/sfh/default.nix`](../../../../nixos/boxes/home/palace/vms/sfh/default.nix) —
box config: netboot/NVMe-oF boot, container instances, MACVLAN plumbing, Frigate disk.
- [`nixos/boxes/home/palace/vms/sfh/containers/`](../../../../nixos/boxes/home/palace/vms/sfh/containers) —
the container system definitions.
- [`nixos/boxes/home/palace/vms/default.nix`](../../../../nixos/boxes/home/palace/vms/default.nix) —
the VM definition on `palace` (VFs, USB passthrough, netboot NIC, `hdds/frigate` disk).
+64
View File
@@ -0,0 +1,64 @@
# hass
Home automation container: Home Assistant plus its supporting services (MQTT, camera restreaming,
Frigate NVR), running on [`sfh`](../README.md).
- **Source:** [`nixos/boxes/home/palace/vms/sfh/containers/hass.nix`](../../../../../nixos/boxes/home/palace/vms/sfh/containers/hass.nix)
- **Host:** NixOS container on `sfh`
- **nixpkgs:** `mine`
## Role
### Home Assistant
`services.home-assistant` uses declarative configuration (`configWritable = false`). It enables
the `esphome`, `zha`, `denonavr`, `webostv`, `androidtv_remote`, `heos`, `mqtt`, `wled`, `met` and
`google_translate` components, plus custom `alarmo`, `frigate`, `west_wood_club` and Irish Rail
integrations. A `hass-cli` wrapper uses a token from `my.secrets` to reach the local server.
- **mosquitto** — MQTT broker (anonymous local listener; port 1883 allowed, alongside HTTP).
- **go2rtc** — restreams the Reolink living-room camera (RTSP from `reolink-living-room`, on the
`lo` network) and the office USB webcam (`/dev/hass-webcam/video0` via ffmpeg).
- **Frigate** (`services.frigate`, `frigate.h.nul.ie` — the `frigate` alt name on the `hi`
assignment) — records both restreamed cameras with a short retention policy; detection is
disabled.
- External access is via `https://hass.nul.ie` through the `middleman` reverse proxy;
internally it's `hass-ctr.h.nul.ie`. Home Assistant's HTTP settings (port `8123`, forwarded
headers and `middleman`'s addresses as trusted proxies) live in the UI under Settings › System
› Network, stored in `.storage/http`, not in Nix. Update the trusted proxies there if
`middleman`'s addresses change, or logins through the proxy will fail.
- Not a deploy-rs target (`my.deploy.enable = false`) — it's rendered via `my.asContainer` and
started by `sfh`'s `my.containers.instances`.
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `hass`).
## Storage
Frigate footage lives on a **separate HDD LV**: `palace` passes the `hdds/frigate` LVM LV to the
`sfh` VM, sfh mounts it at `/mnt/frigate`, and the container bind-mounts it at `/var/lib/frigate`
(read-write). This keeps recording churn off the NVMe-oF root.
## Devices
Passed through from `sfh` (USB host ports on `palace`):
- Nabu Casa Connect ZBT-1 Zigbee coordinator → `/dev/ttyUSB0` (used by `zha`).
- USB webcam → `/dev/hass-webcam/video0` (go2rtc's `webcam_office` stream). The container
starts with an empty `/dev/hass-webcam` directory if the webcam is absent. Restart the
container after reconnecting the webcam to expose it again.
- The matching raw USB device node allowed through from `sfh`.
## Networking
MACVLAN interfaces created from `sfh`'s container NICs: `host0` on `ctrs-hi` (the `hi` assignment,
alt name `frigate`, default gateway via the VIP) and `lan-lo` on `ctrs-lo` (the `lo`
assignment, no gateway) — the `lo` interface reaches the IoT devices (the Reolink camera lives there).
## Notable config files
- [`nixos/boxes/home/palace/vms/sfh/containers/hass.nix`](../../../../../nixos/boxes/home/palace/vms/sfh/containers/hass.nix) —
container system: Home Assistant, Frigate, mosquitto, go2rtc.
- [`nixos/boxes/home/palace/vms/sfh/default.nix`](../../../../../nixos/boxes/home/palace/vms/sfh/default.nix) —
the `sfh` side: bind mounts, MACVLAN wiring, `DeviceAllow`.
+42
View File
@@ -0,0 +1,42 @@
# unifi
The UniFi network controller, running as a container on [`sfh`](../README.md). It manages the
home UniFi switch `brian` (see [switches.md](../../switches.md)).
- **Source:** [`nixos/boxes/home/palace/vms/sfh/containers/unifi.nix`](../../../../../nixos/boxes/home/palace/vms/sfh/containers/unifi.nix)
- **Host:** NixOS container on `sfh`
- **nixpkgs:** `mine`
## Role
- **UniFi controller** (`services.unifi`, `pkgs.unifi` on `mongodb-7_0`, firewall open; TCP 8443
allowed).
- Not a deploy-rs target (`my.deploy.enable = false`) — it's rendered via `my.asContainer` and
started by `sfh`'s `my.containers.instances`.
## Network assignments
See the consolidated [network assignments](../../../../networking.md#box-assignments) table (this box: `unifi`).
## Status
**Currently enabled.** The container spent a while disabled — its import was commented out of
[`containers/default.nix`](../../../../../nixos/boxes/home/palace/vms/sfh/containers/default.nix)
while there was no UniFi gear to manage — and was re-enabled when the UniFi switch `brian` was
added, gaining a `core` interface (`unifi-ctr-core`) at the same time so it can reach the switch on its
management network. It is imported, listed in `sfh`'s `my.containers.instances`, and
`services.unifi.enable = true`.
## Networking
Two MACVLAN interfaces come from `sfh`'s container NICs: `host0` on `ctrs-hi` carries the `hi`
assignment (`unifi-ctr`, default gateway via the VIP), while `lan-core` on `ctrs-core` carries
the gatewayless `core` assignment (`unifi-ctr-core`). The `core` interface is how the controller
talks to `brian` and the other switches on their management network.
## Notable config files
- [`nixos/boxes/home/palace/vms/sfh/containers/unifi.nix`](../../../../../nixos/boxes/home/palace/vms/sfh/containers/unifi.nix) —
container system: UniFi service, assignments.
- [`nixos/boxes/home/palace/vms/sfh/default.nix`](../../../../../nixos/boxes/home/palace/vms/sfh/default.nix) —
the `sfh` side: container instance, MACVLAN wiring.
+257
View File
@@ -0,0 +1,257 @@
# slop-cannon
Coding agents (Claude Code and Codex), driven from the phone or a browser through
[Paseo](https://github.com/getpaseo/paseo), running in a VM on [`palace`](palace.md) with root
inside it.
- **Source:** [`nixos/boxes/home/palace/vms/slop-cannon.nix`](../../../nixos/boxes/home/palace/vms/slop-cannon.nix)
(the VM itself in [`palace/vms/default.nix`](../../../nixos/boxes/home/palace/vms/default.nix))
- **Host:** VM on `palace`
- **nixpkgs:** `mine`
## VM resources
| vCPUs | RAM | Disk | Network | Other |
|---|---|---|---|---|
| 16c × 2t (overcommitted) | 24 GiB | 512 GiB virtio, NVMe-oF from `cellar` via `palace` | SR-IOV VF 5 (`44:00.6`) on VLAN 120 | installer ISO |
`vm@slop-cannon` has a low `CPUWeight` on `palace`, so `cellar`, `river` and `sfh` win under
contention. `palace` has `kvm_amd` `nested=1`, so the guest has `/dev/kvm`.
## Role
- Runs the Paseo daemon and the agents it starts, as the user `slop-cannon`. Agents have root in
the VM (`wheel`, passwordless `doas`): nested VMs, kernel modules, system services.
- A normal deploy node (`deploy .#slop-cannon`, `ssh-machine slop-cannon`).
- Everything inside the guest is treated as agent-controlled. The boundaries are outside it:
the `untrusted` filter on the routers, the VLAN tag on the NIC and the disk connection on
`palace`. Credentials for deploying or logging into other boxes stay outside the VM, with
[`slop-broker`](../../slop-broker.md) on `palace`.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box:
`slop-cannon`).
## Network
- The only interface, `lan-untrusted`, is SR-IOV VF 5 on `palace`. The NIC tags and filters VLAN
120 and enforces MAC spoof checking on the host side. The guest loads `mlx5_core` at boot.
See the [VF attachment table](palace.md#connectx-4-vfs).
- A static `untrusted` address (outside both routers' DHCP pools), MTU 1500. DNS is Cloudflare,
as `untrusted`'s DHCP and RAs hand out; the routers' resolvers aren't reachable from
`untrusted`.
- The routers keep `untrusted` to the Internet (see
[Untrusted clients](../../networking.md#untrusted-clients)). `git.nul.ie` and
`paseo-relay.nul.ie` resolve to colony IPv6 addresses, which are rejected, so Gitea and the
Paseo relay fall back to IPv4 immediately.
- SSH from `hi` and `lo` works through the routers. The VM shares layer 2 with other clients
on the `untrusted` VLAN.
- Builds use the guest's own Nix daemon and store, behind the same filter.
## Storage
- One virtio disk: GPT with a 2 GiB ESP (partition label `esp`) and an LVM PV in VG `main`.
- `slop-cannon-nix`, `slop-cannon-persist` and `slop-cannon-tmp` are thin LVs in `main/tpool`,
overcommitted, so space goes to whichever needs it. The pool takes 90% of the VG; LVM grows it
into the rest at 80% full (`thin_pool_autoextend_threshold`). Watch `lvs` if it gets close.
- The root is `tmproot`; `/tmp` is its own LV, cleaned on boot and mounted with `discard`, so
agents' scratch files don't use RAM and freed space returns to the pool.
- The disk is `nqn.2016-06.io.spdk:slop-cannon` on [`cellar`](cellar.md), connected by `palace`
(see [`palace`'s disk notes](palace.md#slop-cannons-disk)). The guest never speaks NVMe-oF.
## Users and secrets
| User | Purpose |
|---|---|
| `slop-cannon` | Runs Paseo and the agents; `wheel` and `kvm`; locked password, Dev's SSH key; home persisted; UID/GID pinned in `lib.my.c.ids` |
| `dev` | Administration; locked password, Dev's SSH key |
- No `user-passwd.txt` (`my.user.passwordSecret = null`): root belongs to the agents, so the box
gets no shared secrets. Recovery is through the installer ISO.
- The VM's SSH host key is the age identity for `slop-cannon/paseo.env` and
`slop-cannon/gitea-token`. Agents can read the host key and decrypt anything encrypted to it.
## Paseo
A daemon (`paseo-server`) that starts and manages agents and serves a WebSocket API to the Paseo
app, the web UI and the `paseo` CLI. Claude Code runs through the Claude Agent SDK, using the
installed `claude` and its claude.ai login; Codex runs through `codex app-server`.
### Service
- The `services.paseo` module from our Paseo fork (flake input `paseo`, imported in
`nixos/modules/common.nix`), with a package override for the web UI bug
[getpaseo/paseo#7673](https://github.com/getpaseo/paseo/issues/7673).
- The fork, [`dev/paseo`](https://git.nul.ie/dev/paseo), adds support for colocated Jujutsu
repositories: Jujutsu workspaces, change views and actions in the app, and
`paseo workspace jj` in the CLI. Each `fork/jujutsu-v<version>` branch carries the fork commits
on an upstream release; `main` mirrors upstream. The branch's `docs/jujutsu-fork.md` explains
the controls and how to rebase the fork.
- The fork also compacts an idle Claude agent with a large context shortly before its one-hour
prompt cache expires, as Claude Code does in a terminal. It is on by default and set with
`agents.idleCompaction` (see the fork's `public-docs/configuration.md`).
- The daemon runs the `jj` from the system and user profiles on its `PATH`.
- Runs as `slop-cannon`, so agents use that user's logins and settings, with `~/.paseo` as
`PASEO_HOME`.
- The daemon password comes from the age secret `slop-cannon/paseo.env`. To read it for a new
client, follow [Pair a Paseo client](#pair-a-paseo-client).
- The service is not restarted on deploy, so running agents aren't interrupted. Restart it by hand
(`doas systemctl restart paseo`) to pick up a new config; stopping it stops its agents.
- Startup takes about a minute and a half while bundled plugins load; the daemon answers 503 until
it is ready.
### Settings
`services.paseo.settings` is rewritten into `~/.paseo/config.json` on every start, so changes made
from the app don't survive a restart. It:
- disables the tools Paseo injects into agents (`daemon.mcp.injectIntoAgents = false`), which would
let an agent change its own mode, answer its own permission prompts or open terminals;
- requires relay replay protection;
- turns off dictation and voice, which would otherwise download a large local speech model;
- hides providers other than Claude and Codex;
- adds "Claude, bypass permissions" and "Codex, full access" agent profiles. Each provider's
default mode is hardcoded upstream (Claude `auto`, Codex `auto-review`), and profiles are the
only way to preset one, so pick a profile when starting an agent for the permissive mode.
### Connectivity
- The daemon listens on `127.0.0.1:6767` only. The phone app and the browser reach it through our
relay on [`middleman`](../colony/shill/containers/middleman.md#paseo-relay)
(`paseo-relay.nul.ie`).
- Traffic through the relay is end-to-end encrypted between the app and the daemon; the relay sees
only addresses, timing and sizes. The pairing QR code or link is the trust anchor; treat it like a
password. Switching relays means re-pairing.
- Push notifications go from the daemon to Expo's push service (`exp.host`), one outbound request
per notification carrying its text.
- `middleman` serves the static web app on `slop.nul.ie`. The daemon's own web UI stays off.
### State
The agent home is backed by `/persist/home/slop-cannon`. It holds the provider logins and
sessions, repos, and `~/.paseo`, which contains the daemon keypair, agent records, projects,
workspaces and Paseo-managed Git worktrees. Paired clients trust that daemon keypair. Claude
sessions live under `~/.claude/projects/` and Codex sessions under `~/.codex/sessions/`.
## Repos, worktrees and jj
Repos live under `~/src` as colocated jj clones (see `slop-clone` below). The fork drives them
through `jj`:
- A `local` workspace runs the agent in the checkout itself. Archiving it removes only Paseo's
record; the folder is kept.
- A new jj workspace is a colocated `jj workspace` under `~/.paseo/worktrees` with its own
working-copy change. Use it for parallel or unattended agents. Archiving saves the change for
restore before removing the directory.
- A workspace goes stale when another one rewrites its `@`, typically a `jj git fetch` after its
pull request is merged. Paseo then offers **Update stale workspace** (`jj workspace
update-stale`), which keeps edits jj hadn't recorded in a separate change. Run it once the
workspace's agent is idle, since it changes the files under it.
- Don't run `jj` in a folder while an agent is mid-turn there: jj snapshots its partial edits.
## Terminal access
- The `paseo` CLI talks to the running daemon: `paseo ls`, `paseo logs -f <id>`, `paseo send <id>
"…"`, `paseo permit ls|allow|deny`. It is command-line only, not a chat interface.
- A session can be taken over in the provider's own TUI by its ID: `claude --resume <session>` in
the agent's folder, or `codex resume <session>`. `paseo import` goes the other way. This is a
hand-off, not a shared view: stop the agent in Paseo first and don't type in both.
## Agent permissions
Paseo has the full rights of `slop-cannon`, and `slop-cannon` has root: anyone with the daemon
password or a pairing controls the VM.
- Claude Code and Codex come from the shared `my.agents` home-manager module.
- Claude's user settings deny raw `deploy` and `ssh-machine`, and allow `slop`, since the broker
asks a human where its policy says so. The checkout's `.keys/` only has the committed public
keys, so reading it isn't denied. Claude's managed settings
(`/etc/claude-code/managed-settings.json`) repeat the `deny` rules. All of these match command
text and live inside the guest, so they steer agents towards `slop` rather than enforce
anything.
- Agents are permissive by default, since the VM is the boundary and
[`slop-broker`](../../slop-broker.md) gates everything that needs credentials: Claude starts in
`bypassPermissions` (the `deny` rules still apply), and Codex runs without approvals or its
sandbox (`approval_policy = "never"`, `sandbox_mode = "danger-full-access"`). Agents started
through Paseo use its defaults unless started with one of the profiles above.
- Codex stores its credentials in a file.
### Privileged operations
Agents ask [`slop-broker`](../../slop-broker.md) on `palace` for anything needing credentials, with
the `slop` command (`my.agents.slop.enable`). It connects over vsock (CID 3; see
[`palace`](palace.md#slop-broker)). The agent guide, `slop guide`, is installed as a Claude rule
(`~/.claude/rules/slop.md`) and as Codex's `AGENTS.md`.
The `my.agents.rules.slop-approvals` rule adds the local guidance on waiting for approval
and pausing after expiry to both providers' user-level instructions, including in Paseo sessions.
## SSH and first login
`ssh slop-cannon` (agent user) and `ssh slop-cannon-dev` (`dev`) are the shared aliases, both with
`ForwardAgent=no`. Never forward your SSH agent into the box: agents could use it while you're
logged in. For recovery, use the [VM serial console](../../deployment.md#vm-consoles) for
`slop-cannon` on `palace`.
To set up provider logins and repos on a fresh agent home, connect with `ssh slop-cannon`:
1. `claude auth login` (a full login; `setup-token` tokens are not enough for every feature).
2. `codex login --device-auth`.
3. [Pair a Paseo client](#pair-a-paseo-client).
4. `slop-clone <owner>/<repo>` for each repo. It clones a colocated jj repo over HTTPS into
`~/src/<repo>` and registers it with Paseo as a local workspace.
## Gitea
Agents reach Gitea as a bot user, with its access token (age secret `slop-cannon/gitea-token`,
scopes `write:repository` and `write:issue`).
- **Git** uses HTTPS: a credential helper for `git.nul.ie` sends the token. Commits are still
authored as Dev through the shared Git config; the pushes are the bot's.
- **`tea`**, Gitea's CLI, is wrapped to log in with the same token, so agents can open and update
pull requests.
- **Pull requests:** a rule for every agent (`my.agents.rules.gitea`: a Claude rule, and part of
Codex's `AGENTS.md`) makes a pull request from a branch of its own the default way to finish a
piece of work, and says how with jj and `tea`. A repository's own `AGENTS.md` can allow more,
such as pushing to its main branch.
- **Issues:** the same rule keeps agents' running notes, plans and handoffs in Gitea issues on
the repository they're about, rather than in files on branches that go stale. Durable facts
still go in the repository's docs, and the issue is closed.
- **Access per repo:** where agents should only propose changes (`dev/nixfiles`, `slop-broker`),
protect the main branch so only Dev pushes and merges. Elsewhere the bot's Write access is
enough to push directly.
- **Access:** the bot is a collaborator with Write on each repo agents may use. `master` on
`dev/nixfiles` only takes pushes and merges from Dev (see
[`slop-broker`](../../slop-broker.md#master-is-protected)).
- **Replacing the token:** make a new one for the bot and put it in the secret with
`ragenix -e secrets/slop-cannon/gitea-token.age`, then deploy `slop-cannon`.
## Pair a Paseo client
1. On the VM, run `slop-pair` as `slop-cannon`. It prints the QR code, pairing link and
`PASEO_PASSWORD`. Keep its output private.
2. If you only need the QR code and link, run `paseo daemon pair` as `slop-cannon`. To look up the
password separately, run `doas cat /run/secrets/slop-cannon/paseo.env` on the VM. You can also
decrypt it from a repo checkout with access to the dev age key:
```sh
rage --decrypt -i .keys/dev.key secrets/slop-cannon/paseo.env.age
```
3. On a phone, scan the QR code from the Paseo app. In a browser, open `https://slop.nul.ie` and
use the app's paste-pairing-link option. Enter the value after `PASEO_PASSWORD=` when prompted
and open the paired host. If the browser shows “Password required” after opening the link in
the address bar, remove that host entry and pair again using the paste dialog.
## Notable config files
- [`nixos/boxes/home/palace/vms/slop-cannon.nix`](../../../nixos/boxes/home/palace/vms/slop-cannon.nix) —
the box: users, Paseo, Claude settings, `slop-clone`, `slop-pair`, disk layout, network.
- [`nixos/boxes/home/palace/slop-broker.nix`](../../../nixos/boxes/home/palace/slop-broker.nix) —
the broker's policy for this box and the VM's vsock device.
- [`nixos/boxes/home/palace/vms/default.nix`](../../../nixos/boxes/home/palace/vms/default.nix) —
the VM on `palace` and `slop-cannon-disk.service`.
- [`nixos/boxes/home/palace/default.nix`](../../../nixos/boxes/home/palace/default.nix) — VF 5, the
NVMe host ID and the LVM filter.
- [`home-manager/modules/agents/default.nix`](../../../home-manager/modules/agents/default.nix) —
shared Claude Code and Codex configuration, including the `slop` client and guide.
+104
View File
@@ -0,0 +1,104 @@
# stream
A physical Intel home router with a DHCP WAN from the Virgin Media cable modem. It forms the
redundant router pair with [`river`](river.md) and is dual-homed to both switches.
- **Source:** [`nixos/boxes/home/stream.nix`](../../../nixos/boxes/home/stream.nix) (shared router
config: [`routing-common`](../../../nixos/boxes/home/routing-common), index 1)
- **Host:** physical
- **nixpkgs:** `mine`
## Hardware
| Component | Inventory |
|---|---|
| Platform | BROUNION R86S |
| CPU | Intel Celeron N5105 (4 cores / 4 threads) |
| Memory | 16 GiB |
| Storage | 512 GB Samsung SSD 970 PRO NVMe containing `/boot`, `/nix` and `/persist`; integrated 128 GB eMMC is present but is not used by the declared filesystems |
| Network | Three Intel I225-V 2.5G interfaces (`igc`) and a dual-port Mellanox ConnectX-3 10G SFP+ adapter (`mlx4_en`); `wan`, `lan-jim` and `lan-dave` use three of these ports |
The platform configuration enables `kvm-intel`, `intel_iommu=on` and Intel microcode updates.
## Role
At `routing-common` index 1, `stream` normally holds the secondary position in the router pair.
Pair-wide addressing, VIP, DHCP/DNS and failover behavior is documented in the
[`home` networking overview](../../networking.md#home) and [Router HA](../../networking.md#router-ha).
This page covers `stream`'s Virgin Media WAN, physical platform and redundant switch attachment.
## Network assignments
See the consolidated [network assignments](../../networking.md#box-assignments) table (this box: `stream`).
## WAN (Virgin Media DHCP)
A Quectel RM500U-EA 5G modem is being evaluated as a replacement for this WAN; it is bench-tested
only and nothing here depends on it yet. Note that its SIM is CGNAT, so it cannot carry the public
lease this section assumes — see [wwan.md](wwan.md).
### Link and addressing
`wan` is a renamed igc NIC (`00:f0:cb:ee:ca:dd`) on a physically separate connection to `jim`'s
`stream-wan` port. The Virgin Media modem connects to `shytzel`, which trunks
VLAN 130 to `jim`; `stream-wan` delivers it untagged to the box. See
[switches.md](switches.md) for the fabric side.
`DHCP=ipv4` pulls the public lease. `dhcpV4Config.UseDNS=false` points resolution at the local
recursor, and `IPv6AcceptRA=false` because public IPv6 arrives over the tunnel rather than this WAN.
### Management subnet
The static `192.168.0.100/24` address (host `.100` of `prefixes.modem.v4`) sits on `wan` without a
gateway, keeping the modem UI reachable alongside the DHCP lease.
### WAN readiness
`wan-wait-online.service` polls until the DHCP default route exists, then satisfies
`wan-online.target`. The route is the gate because the permanent modem address would make
networkd's wait-online report success before the public lease arrives, allowing `ipsec` to start
without its public `left=` address.
### Traffic shaping
Egress is shaped at the `wan` root qdisc. A `routing-common` `networkd-dispatcher` rule redirects
ingress through `tc`/`mirred` into `wan-ifb`; each direction has its own configured bandwidth and
uses the DOCSIS overhead preset.
### Per-box `routing-common` options
The modem's management subnet shares the `wan` interface, which `routing-common` itself knows
nothing about. This box sets `my.homeRouter.dns.wanSkipBroadcasts`
([`routing-common/default.nix`](../../../nixos/boxes/home/routing-common/default.nix)) to skip the
modem subnet's broadcast address when auto-selecting the router's own `wan` A record for the zone's
LUA record. `untrusted` clients can't reach the modem subnet: it's private, so the
[`untrusted` filter](../../networking.md#untrusted-clients) rejects it.
## Switching (RSTP)
`stream` is dual-homed to both switches: `lan-dave` (mlx4_en) and `lan-jim` (igc), both MTU 9000,
are ports of the shared `lan` bridge. `routing-common` owns the bridge, its STP setting and the
explicit `dave`/`jim` costs of 10/100. [`routing-common/mstpd.nix`](../../../nixos/boxes/home/routing-common/mstpd.nix)
runs a patched `mstpd` and forces RSTP once `lan` is configured, so exactly one uplink carries
traffic at a time and `dave` is preferred. (The remaining NICs are renamed `et2`/`et5` and left
unconfigured.)
The separate `wan` connection to `jim` is not a bridge port. Retaining it provides an isolated
untagged DHCP handoff for Virgin Media and a simple path for a future replacement direct-IP WAN.
## Deployment
`my.deploy.node.hostname` is currently commented out.
## Disabled printer services
`octoprint` and `mjpg-streamer` are defined but disabled (`enable = false`).
## Notable config files
- [`nixos/boxes/home/stream.nix`](../../../nixos/boxes/home/stream.nix) — box config: DHCP WAN,
modem management, CAKE, `wan-online.target` gate and hardware link matching.
- [`nixos/boxes/home/routing-common/default.nix`](../../../nixos/boxes/home/routing-common/default.nix) —
shared router definition, including the `lan` bridge and port preferences (index 1).
- [`nixos/boxes/home/routing-common/mstpd.nix`](../../../nixos/boxes/home/routing-common/mstpd.nix) —
RSTP on the `lan` bridge.
+346
View File
@@ -0,0 +1,346 @@
# Home switches
Reference for the home switches: MikroTik boxes `jim` and `dave`, Ubiquiti switch `brian`, and
Zyxel L2 switch `shytzel`. These switches are **not** managed by this flake; they are configured by
hand. This page covers the physical topology, VLAN map, and WAN paths.
In short: the Digiweb ISP VLAN (10) is trunked straight through to `river` (which runs PPPoE on it),
and the ONT's untagged management is PVID'd onto VLAN 140 at `brian`, its edge switch. VLAN 10 is
carried untranslated because a single ONT makes it unique on the fabric — see
[the WAN path](#the-digiweb-wan-path-trunked-vlan-10--pvid-140) and
[why not translation](#why-not-translation-for-one-ont). The router side lives in
[river.md](river.md); the logical network map in [networking.md](../../networking.md). The Wi-Fi
APs that hang off these switches are in [aps.md](aps.md). A fourth switch, **fergal**, hangs off jim
but belongs to the colony site — see [fergal](#fergal-portculliss-switch).
## The switches
| | `jim` | `dave` | `brian` | `shytzel` |
|---|---|---|---|---|
| Identity | `jim-sw` | `dave-sw` | UniFi | `shytzel` |
| Model | CRS326-24G-2S+ | CRS504-4XQ | Ubiquiti Switch Pro XG 8 PoE | Zyxel GS1920 |
| Switch chip | Marvell 98DX3236 | Marvell 98DX4310 (+ Atheros 8227 for the 100M management port) | — | — |
| OS | RouterOS 7.25.1 | RouterOS 7.25.1 | UniFi | Zyxel firmware |
| RouterBOOT | 7.25.1 | 7.25.1 | — | — |
| Ports | 24×1G + 2×SFP+ | 4×QSFP28 + 100M management | 8×10GBASE-T PoE + 2×10G SFP+ | Not recorded |
| VLAN configuration | `main`, `vlan-filtering=yes` | `main`, `vlan-filtering=yes` | UniFi VLAN profiles | 802.1Q L2; management only on `core` |
`jim` and `dave` run a single hardware-offloaded bridge (`main`) with VLAN filtering. Access to the
MikroTiks is SSH as `admin` / `admin` by short hostname (see
[Accessing the switches](#accessing-the-switches)). Only `jim` and `dave` can do hardware VLAN
translation (`/interface ethernet switch rule` on the Marvell chips); `brian` and `shytzel` provide
ordinary L2 VLAN switching.
## Physical topology
The Virgin Media modem lands on `shytzel`, which trunks VLAN 130 to `jim`; the Digiweb ONT lands on
`brian`. `brian` has its primary LAG to the `dave` core and an RSTP-protected secondary connection
to `jim`; `jim` and `dave` are also joined directly. The home boxes hang off `dave`'s high-speed
ports, with backup links to `jim`. `jim`'s second SFP+ port (`sfp-spare`, `sfp-sfpplus2`) feeds
[fergal](#fergal-portculliss-switch), which [`portcullis`](../colony/portcullis.md) hangs off while
it is staged at home.
[![Home switch fabric and router connections](diagrams/home-fabric.svg)](diagrams/home-fabric.svg)
The [Mermaid source](diagrams/home-fabric.mmd) defines the logical topology; the rendered SVG
also works in Markdown viewers without Mermaid support.
Solid and dotted lines distinguish normal carrying paths from backup attachments; RSTP selects
ports for the whole fabric. The separate WAN connection to `stream` is outside its LAN bridge.
The 10G trunk from `jim` to [fergal](#fergal-portculliss-switch) serves the staged colony boxes.
### Front-panel port maps
In the rack, viewed from the front, the order is **`brian`, `jim`, `dave`**, with `palace` several
units below. `stream` sits to the left of `brian`; it is drawn above it to make the connections
easier to follow. The map follows each model's physical socket order: `brian` has a single RJ45 row,
`jim` has three banks with even ports above odd ports, and `dave` has four QSFP28 cages. Chassis
widths, spacing and the gap above `palace` are schematic; exact rack-unit positions are not known.
`palace`'s NICs are rear connections, shown only as endpoints rather than an invented front layout.
[![Front-panel socket map in rack order, with matching cable-end tags](diagrams/switch-panels.svg)](diagrams/switch-panels.svg)
Drawn lines and matching letter badges identify the two ends of a cable. Cable routes are
schematic, not a record of how the cables are dressed in the rack. NIC labels give socket
capacity; `stream`'s 2.5G copper ports connect to `jim` at 1G. Q3.1–Q3.4 are breakout lanes within
**one physical cage** on `dave`, not four separate front-panel sockets. Its management RJ45
is separate from the console above it; `jim`'s console is also separate from Ethernet port 1.
<!-- switch-cables -->
| Cable | Endpoint | Endpoint | Connection |
|---|---|---|---|
| **A** | `brian` `9` | `dave` `Q3.2` | 10G; first LAG member |
| **B** | `brian` `10` | `dave` `Q3.4` | 10G; second LAG member |
| **C** | `brian` `5` | `jim` `7` | 1G; redundant fabric trunk |
| **D** | `jim` `S1` | `dave` `Q3.1` | 10G; direct fabric trunk |
| **E** | `jim` `24` | `dave` `MGMT` | 100M; dave management |
| **F** | `jim` `5` | `palace` `host-jim` | 1G; host core / netboot |
| **G** | `jim` `22` | `palace` `river-jim-phy` | 1G; river backup trunk |
| **H** | `dave` `Q1` | `palace` `uplink-dave` | 100G; host PF and guest VFs |
| **I** | `stream` `ETH0` | `jim` `21` | 1G WAN; 2.5G socket on stream |
| **J** | `stream` `ETH1` | `jim` `6` | 1G backup LAN; 2.5G socket on stream |
| **K** | `stream` `SFP+ R` | `dave` `Q3.3` | 10G preferred LAN |
<!-- /switch-cables -->
Port labels describe configured use, not current link state. `jim` ports 1–4 are configured
members of `shytzel-downlink`; only port 1 had an active link at inspection. `brian` port 3 is
reserved for testing `portcullis`, and port 4 serves its second JetKVM.
The panel layouts reference the manufacturers' [Pro XG 8 PoE guide](https://dl.ui.com/qig/usw-pro-xg-8-poe/),
[CRS326-24G-2S+RM panel](https://mikrotik.com/product/CRS326-24G-2SplusRM),
[CRS504-4XQ-IN panel](https://mikrotik.com/product/crs504_4xq_in), and
[R86S panel photograph](https://www.gowinfanless.com/news/blogs/the-r86s-revolution-low-power-2-5gbe-and-10gbe-networking).
`stream`'s connected SFP+ socket is the right-hand one, confirmed physically; the left is unused.
Its copper socket mapping is inferred from PCI order and sequential permanent MACs. The SFP+
sockets are labelled left/right in the drawing because both carry the same printed label.
Port use comes from RouterOS interface/bonding configuration, LLDP, the UniFi controller and
physical connection confirmation.
The editable inventory is [switch-ports.json](diagrams/switch-ports.json); run
`python3 docs/sites/home/diagrams/render-switch-panels.py` to regenerate the SVG and cable table.
Notes:
- **river** uses `palace`'s 100G connection to `dave` and the dedicated 1G `river-jim-phy`
connection to `jim`. The separate `host-jim` connection serves host management and VM netboot.
See [palace's networking](palace.md#networking) for the handoffs and
[failover validation](router-failover.md) for tested failure scenarios.
- `jim`'s `palace-kvm` port is a JetKVM connection, not either of `palace`'s network attachments.
- **stream** (the second router box) is dual-homed to both jim and dave (STP picks the active path).
- The `brian`–`jim` secondary connection provides the redundant Digiweb path. VLANs 10 and 140 are
tagged on `brian-downlink` and `river`, keeping the ONT reachable without `dave`.
### `castle` storage dependency
`castle` is dual-homed without STP: its primary link is dave's 100G `castle` port (`et100g`), while
the backup NIC (`et2.5g`) connects at 1G to jim and is normally down, providing no live failover.
Its root disk is NVMe-oF over `et100g` and dave, so interrupting either freezes `castle` mid-I/O.
Do dave maintenance from a box that does not depend on it, or power `castle` off cleanly first.
## VLANs
| VLAN | Name | Purpose |
|---|---|---|
| — (native) | core | Switch management, `192.168.64.0/24` (`jim` `.10`, `dave` `.11`, `shytzel` `.12`, `brian` `.13`) |
| 100 | hi | High-performance / jumbo network (MTU 9000) |
| 110 | lo | Standard LAN |
| 120 | untrusted | Guest / untrusted network |
| 130 | wan | `stream`'s WAN — tagged from `shytzel`, untagged on `jim`'s `stream-wan` |
| 140 | wan-pon-ont | ONT management, `192.168.100.0/24` (PVID'd at the ONT edge) |
| 10 | pon-isp | Digiweb ISP transport — **trunked straight through** to river, PPPoE runs on it |
| 141 | wan-pon-isp | **Reserved** — the translated ISP VLAN for the future multi-ONT design |
Switch L3 presence (`/interface vlan` on `main`) exists **only** for VLANs the switch is managed
from — `hi` (100) and `lo` (110), plus native core. WAN and guest VLANs deliberately have no switch
L3 interface. jim and dave carry a static IPv4 and **global IPv6** address on `hi`/`lo` (plus a
static default route on each stack) purely for management — they are **pure L2, never routers**. See
[Switches must not route](#switches-must-not-route).
## The Digiweb WAN path (trunked VLAN 10 + PVID 140)
The ONT presents two things on one wire:
- **untagged** management traffic (`192.168.100.x`), and
- **tagged VLAN 10** carrying the Digiweb ISP session (the BRAS requires VLAN 10).
With a **single ONT** there's no reason to translate anything — VLAN 10 is unique on the fabric, so
we just carry it end to end and let river run PPPoE directly on it:
1. **Untagged mgmt → VLAN 140, at the ONT's edge switch (brian).** brian sets the ONT port's PVID to
140 so the untagged management traffic becomes VLAN 140, and allows tagged VLAN 10 through the
same port. river takes `192.168.100.100/24` on VLAN 140 (matching stream's modem-mgmt `.100`) to
reach the ONT web UI at `192.168.100.1`. Doing the PVID at the ONT-facing edge keeps it clean —
the untagged frames never share a domain with anything else.
2. **VLAN 10 (ISP) trunked straight through, untranslated.** The primary path is
brian → dave → palace; the RSTP-protected secondary path reaches jim before returning to the
router attachment. Both carry tagged VLAN 10 by ordinary bridge-VLAN membership. No
`/interface ethernet switch rule`, no pinning, no asymmetric-learning issues — it's just a
normal tagged VLAN. river attaches PPPoE to VLAN 10 directly (`wan-pon-isp` netdev = VLAN
`pon-isp` = 10; baby-jumbo MTU 1508 so PPP nets a clean 1500).
Net result: **river runs PPPoE single-tagged on VLAN 10 and holds a VLAN 140 address to reach the
ONT.** See [`nixos/boxes/home/palace/vms/river.nix`](../../../nixos/boxes/home/palace/vms/river.nix)
for the river side.
```
ONT -- untagged + VLAN 10 -- brian -- VLAN 140 + VLAN 10 -- dave -- palace -- river
|
+-- ONT port PVID 140; VLAN 10 remains tagged
```
### Why not translation (for one ONT)?
Translation would swap VLAN 10 → 141 with two pinned hardware ACL rules to keep VLAN 10 off the rest
of the fabric. That buys nothing with a single ONT — VLAN 10 is already unique, so trunking it is
simpler and rule-free. Translation only earns its keep when **two** ONTs both deliver VLAN 10 and
would collide (below).
## Switch configuration
How each switch is set up for the Digiweb WAN path. **Confirm any change on the box before applying**
(see [Accessing the switches](#accessing-the-switches)).
**brian (UniFi)** — hosts the ONT:
- The ONT port has **native/untagged network = VLAN 140** (PVID) and is a **tagged member of VLAN 10**,
so the ONT's untagged management lands on 140 and its tagged ISP frames pass through.
- The `brian-downlink` LAG up to dave trunks **tagged 140 + tagged 10** (alongside the LAN VLANs).
- Its secondary connection to jim carries the same relevant VLANs and participates in RSTP, so it
normally remains blocked while the primary path is healthy.
**dave (RouterOS)** — trunks both WAN-pon VLANs to `brian-downlink` and `palace`. The ISP VLAN 10 row:
```
/interface bridge vlan add bridge=main vlan-ids=10 tagged=brian-downlink,palace,jim-downlink
```
VLAN 140 also spans `brian-downlink,palace,jim-downlink` (it carries a few other members too).
The direct connection to `jim` must carry both VLANs: if only `palace`'s `dave` connection fails,
the surviving RSTP path from `river` through `jim` can still traverse `dave` to reach `brian`.
These are ordinary tagged VLANs with no switch rules.
**jim (RouterOS)** — the physical `brian-downlink` is the RSTP-protected secondary connection from
`brian`. VLANs 10 and 140 have `brian-downlink`, `river` and `dave-uplink` as tagged members; no
translation rules are involved. RSTP selects one tree for the bridge, so VLAN membership must
include the surviving paths through `dave` as well as the direct backup connection to `brian`.
The `river` port is native `core` with VLANs 10, 100, 110, 120 and 140 tagged. It
faces `palace`'s `river-jim-phy`; `palace-kvm` is the separate JetKVM connection and must remain
unchanged. See [failover validation](router-failover.md) for attachment and switch-outage checks.
Other connections on `jim`:
| Interface | Connection |
|---|---|
| `ether9` | Disconnected, unbridged spare |
| `stream-wan` | Dedicated untagged VLAN 130 handoff to `stream` `wan` |
| `river` | `river-jim-phy`, redundant native-core trunk |
The modem connects to `shytzel`. `stream` has two distinct connections to `jim`: `stream-wan`
for its isolated WAN handoff and `stream` for the `lan-jim` RSTP trunk. VLAN 130 has
`shytzel-downlink` tagged and only `stream-wan` untagged.
`sfp-spare` (`sfp-sfpplus2`) stays at `pvid=1`—the switch feeding `portcullis` is reached over
VLAN 1 untagged—and is a tagged member of `hi` (100) and `lo` (110):
```
/interface bridge vlan set [find bridge=main vlan-ids=100] tagged=...,sfp-spare
/interface bridge vlan set [find bridge=main vlan-ids=110] tagged=...,sfp-spare
```
## Switches must not route
jim and dave (and the `vibe` AP) are **pure L2** — river/stream do all routing. Their per-stack
management addresses and static default routes exist only so the boxes themselves can be reached and
reach out; they must **never** forward traffic or advertise themselves as routers. RouterOS defaults
work against this: `ip-forward` and IPv6 `forward` ship **on**, and with IPv6 forwarding on RouterOS
also emits Router Advertisements (`ra-lifetime=30m`) on every L3 interface — so a switch silently
becomes a competing IPv6 default router.
The required config on each RouterOS box:
```
/ip settings set ip-forward=no
/ipv6 settings set forward=no accept-router-advertisements=no
/ipv6 nd set [find] ra-lifetime=0
```
- `ip-forward=no` / `forward=no` — no L3 forwarding on either stack; IPv6 `forward=no` also stops RA
emission at the source.
- `accept-router-advertisements=no` — with forwarding off RouterOS would otherwise start *accepting*
RAs; this keeps the box on its deterministic **static** default route.
- `ra-lifetime=0` — belt-and-suspenders: even if forwarding is ever re-enabled the box advertises
router-lifetime 0 (i.e. "not a default router"). Setting it also emits a withdrawal RA that
actively clears the rogue default from clients (they otherwise cache it for up to ~30 min).
**After any RouterOS upgrade, re-check `/ip settings` and `/ipv6 settings`** — an upgrade can reset
these to the forwarding-on defaults. `brian` uses UniFi and does not have these RouterOS settings.
## Future: multiple ONTs (per-port VLAN translation)
If a second ONT arrives (e.g. a Digiweb line for stream, or a second river), trunking breaks: both
ONTs deliver **tagged VLAN 10**, and plain bridge-VLAN filtering can't tell them apart. That's when
translation earns its place — a switch rule matches on the **ingress port**, so each ONT's VLAN 10
becomes a *distinct* fabric VLAN:
- ONT-A port: VLAN 10 → **141** (→ river)
- ONT-B port: VLAN 10 → **142** (→ stream / second river)
- mgmt: PVID each ONT port onto its own VLAN (140, 143, …) so both ONTs' `192.168.100.1` stay in
separate L2/L3 domains.
The forward direction isolates naturally (each ONT maps to a different fabric VLAN). The **return**
direction is where port targeting is mandatory: both translate *back* to VLAN 10, so bridge VLAN 10
now has two members and a plain FDB-miss flood would leak one ONT's upstream to the other. Each
return must be pinned to its port with `new-dst-ports`:
```
# ONT-A: 141 in on palace → 10, forced out ONT-A's port
# ONT-B: 142 in on stream → 10, forced out ONT-B's port
```
Each ONT port must also be a tagged member of bridge VLAN 10 for correct egress tagging (the missing
piece that otherwise shows up as pppd "Timeout waiting for PADO"). The pins bypass the FDB, so the
two ISP sessions never mix.
**Why a new switch:** jim (the only box with spare SFP+ *and* the translation feature) had just
**one** free SFP+ port — now taken by fergal — so it can't host two ONTs. The plan is a dedicated
**CRS305-1G-4S+** (4×SFP+, same Marvell rule support) to land multiple ONTs and do the per-port
translation there, feeding distinct fabric VLANs up to dave.
## fergal (portcullis's switch)
**fergal** is an 8-port SFP+ switch running OpenWrt, hanging off jim's `sfp-spare` port. It belongs
to [`portcullis`](../colony/portcullis.md) rather than to the home fabric — it is here only while
that box is staged at home, and goes to Nikhef with it. Nothing in the home fabric depends on it.
What it borrows from home is VLAN 1 untagged on the jim uplink (fergal's own management sits on it,
at `192.168.64.30` on core) plus tagged `hi` (100) and `lo` (110), so `portcullis` can reach those
over 10G. The switch itself — VLAN layout, flash layout, firmware and flashing notes — is
documented in [sites/colony/fergal.md](../colony/fergal.md).
## Accessing the switches
### Upgrades
Save a text export and an encrypted binary backup, and download both before rebooting. Local
upgrade backups are kept outside Git under `.cache/mikrotik/<date>/`; the backup password is
stored alongside them with restricted permissions. Binary backups are intended for restoration
on the same box and RouterOS version.
Upgrade one switch at a time. Upgrade `dave` while `jim` carries the backup path, verify its
return, then upgrade `jim`. Check RouterOS packages first, then upgrade RouterBOOT and reboot
again if its running version differs. After each upgrade, verify bridge VLAN membership, RSTP
roles, hardware offload and the [forwarding/RA settings](#switches-must-not-route).
During failover, use bounded SSH calls and an explicit IPv4 management address where useful.
RouterOS parses newlines in SSH command strings separately: send a multi-statement block as one
line with semicolons so local variables and braces retain their scope.
Whole-switch outage behavior is covered by the
[validated scenarios](router-failover.md#validated-scenarios).
RouterOS uses Ed25519 host keys by default. Upgrading an older installation can change the
host-key type from RSA; verify the box's identity independently before updating the client's
`known_hosts` entry.
### SSH
The switches resolve by **short hostname** on the home network — the home routers serve their
records in the home zone
([`nixos/boxes/home/routing-common/dns.nix`](../../../nixos/boxes/home/routing-common/dns.nix):
`jim` → hi `.10`, `dave` → hi `.11`, `brian` → core `.13`). From a box on the home network just
`ssh admin@jim` / `admin@dave`.
**Key auth** for `admin` is installed on jim/dave (and the `vibe` AP) — `ssh -i ~/.ssh/id_rsa
admin@jim` works keyless (imported via `/user ssh-keys import`). Password `admin`/`admin` remains as
a fallback. Non-interactive password pattern (avoids the ssh-agent hang) if the key isn't available:
```
sshpass -p admin ssh -o IdentityAgent=none -o PubkeyAuthentication=no \
-o PreferredAuthentications=password -o StrictHostKeyChecking=accept-new \
-o UserKnownHostsFile=/tmp/sw_known_hosts admin@jim
```
**Always confirm config changes on the switch** (print the affected menu, apply, re-verify).
`brian` is configured through its UniFi controller. `shytzel` is an L2 managed switch whose
management interface is reachable only through `core`.
## Management IPs
| | core (`192.168.64.0/24`) | hi (`192.168.68.0/22`) | lo (`192.168.72.0/21`) |
|---|---|---|---|
| `jim` | `.10` (on `main`) | `.10` | `.10` |
| `dave` | `.11` (on `management`, the 1G Atheros port) | `.11` | `.11` |
| `brian` | `.13` (`core`) | — | — |
| `shytzel` | `.12` | — | — |
+139
View File
@@ -0,0 +1,139 @@
# Home 5G WWAN modem
Reference for the Quectel **RM500U-EA** USB 5G modem, bought to eventually replace `stream`'s
Virgin Media cable WAN ([stream.md](stream.md)). Like the switches ([switches.md](switches.md)) and
the APs ([aps.md](aps.md)), it is **not** managed by this flake: the module's own settings live in
its NVRAM and are applied out-of-band over AT, and nothing in the repo references it yet.
As of 2026-08-05 it has only been bench-tested on `tower`; `stream` is untouched. The notes below
are the working knowledge from that session — what the module needs in order to connect at all, and
what is still unresolved.
## The hardware
| | |
|---|---|
| Model | Quectel **RM500U-EA** |
| Platform | UNISOC-based (not Qualcomm) — its AT set is the `AT+QCFG`/`AT+QNETDEVCTL` router-firmware family, not the QMI one |
| USB | `2c7c:0900`, SuperSpeed (USB 3.1) |
| Firmware | `RM500UEAAAR03A13M2G` |
| SIM | **GoMo**, which rides eir's network (MCC/MNC **272-03**, AS**15751** Meteor Mobile) |
The SIM's **PIN lock has been disabled** on the SIM itself, so no PIN needs to be entered at boot
and no age secret is required for it. Card identifiers and the PIN are deliberately not recorded
here; read them from the modem with `mmcli` if needed.
## The module must be in MBIM mode
This is the single most important setting. The module ships in **NCM** mode (`AT+QCFG="usbnet",5`),
and in that mode it does not work:
- The PDP context comes up correctly — `AT+CGPADDR` reports a real address and `AT+CGCONTRDP`
reports the APN, DNS servers and prefix — but the `cdc_ncm` interface **never raises carrier**, so
no traffic can leave the box. No combination of `AT+QNETDEVCTL` modes (the `(0-3)` operations,
per profile) changed that.
- ModemManager also mis-reports the module's capability as `gsm-umts` only, and cannot read signal
quality (it sits at 0% while the radio is registered and attached).
Switching to **MBIM** fixes both:
```
AT+QCFG="usbnet",2
AT+CFUN=1,1 # reset so the new USB composition takes effect
```
It then enumerates as `cdc_mbim` with `/dev/cdc-wdm0` and a `wwp*` interface, ModemManager reports
`gsm-umts, lte, 5gnr`, signal quality works, and carrier follows the bearer. The other `usbnet`
values the module advertises are `(1,2,3,5,11,13,15)` — `1` ECM, `2` MBIM, `3` RNDIS, `5` NCM.
To reach the AT ports (`ttyUSB2` and `ttyUSB3` are the AT ones; ModemManager claims them, so stop it
first), any serial terminal works — `minicom -D /dev/ttyUSB2`, or a raw `stty`/`exec` pair on the
device node.
### Router-mode features are not in use
The firmware is the router variant: it can do its own NAT (`AT+QCFG="nat"`) and hand the host a
lease off a private LAN prefix (`AT+QCFG="lanip"`, default `192.168.42.0/24`). It is currently in
bridge mode (`nat=0`) so the host gets the real WAN address. NAT mode was not needed once MBIM
worked, and would mean double NAT.
## Connecting: the APN must be the network-expanded form
The documented consumer APNs (`gomo.ie`, `data.myeirmobile.ie`) **fail**. The connect only succeeds
with the fully expanded name the network itself uses, and only as **IPv4**:
```
mmcli -m <n> --simple-connect="apn=data.myeirmobile.ie.mnc003.mcc272.gprs,ip-type=ipv4"
```
The module has `AT+QCFG="autoapn",1`, so it selects an APN by itself during attach and brings up an
initial EPS bearer regardless. That bearer is where the expanded name comes from: list the modem's
bearers and read the one whose type is `default-attach`.
```
mmcli -m <n> # note the bearer paths and the initial bearer path
mmcli -b <n> # the default-attach bearer carries the real APN
```
Failure modes are worth distinguishing, since they look similar from `mmcli`:
| Symptom | Meaning |
|---|---|
| `MBIM status error: Failure`, immediate | The APN reached the network and was rejected — usually the wrong APN string |
| `Network timeout`, after a long wait | The APN never resolved to anything; wrong name entirely |
| `No valid data port found` | Already connected — the single data port is in use by an existing bearer |
## Bench result on tower
Measured 2026-08-05 on `tower`, indoors, with **no external antennas** and a weak signal
(RSSI around −85 dBm):
| | |
|---|---|
| Access technology | `lte, 5gnr` — 5G **NSA** |
| Throughput | ~64 Mbit/s down, ~26 Mbit/s up |
| Latency | ~76 ms to `1.1.1.1` |
| Bearer-negotiated rates | 150 Mbit/s down, 50 Mbit/s up |
Treat the throughput as a floor, not a characterisation — antennas and siting were both worst-case.
## The address is CGNAT, and the prefix length is a trap
Two separate consequences of how the bearer addresses the host.
### No public IP
The bearer address is in `100.64.0.0/10` and egress is carrier-NAT'd (`*.cgn1.srl.meteor.ie`,
AS15751). There is **no inbound reachability and no public address**. `stream` currently takes a
*public* DHCP lease on `wan` and publishes it — see [stream.md](stream.md#wan-virgin-media-dhcp),
which also drives `my.homeRouter.dns.wanSkipBroadcasts`. Replacing that WAN with this SIM therefore
drops port forwards, inbound WireGuard and anything resolving to `stream`'s WAN address. Making
this a real WAN needs either a public/static IP from the carrier, or `stream`'s inbound
reachability moved onto the AS211024 mesh or a tunnel from `britway`
([networking.md](../../networking.md)).
### The bearer reports a /8
ModemManager reports the address with a **`/8` prefix**, i.e. `100.0.0.0/8`. Configuring that
literally would install a route covering **Tailscale's `100.64.0.0/10`** and break it. Any
configuration for this modem must add the address as a `/32` with an explicit on-link route to the
gateway, and never use the bearer's own prefix length.
For a throwaway test that cannot disturb the box, put the address and default route in their own
routing table behind an `ip rule` matching the source address, and drive traffic onto it with
`ping -I <addr>` / `curl --interface <addr>`.
## Still open
- **IPv6.** GoMo is expected to provide it, but `ip-type=ipv4v6` fails to connect and only
`ip-type=ipv4` works. In NCM mode the module *did* report an IPv6 address and IPv6 DNS servers
(`2001:bb0::11`/`::12`) on the context, so the network clearly offers it — this looks like an APN
or MBIM-session problem rather than a carrier one. Worth retrying with a separate IPv6-only
context, or with the initial EPS bearer settings pinned via
`mmcli --3gpp-set-initial-eps-bearer-settings`.
- **A public or static IP** from GoMo/eir, without which this cannot replace `stream`'s WAN
unchanged (see above).
- **Antenna siting**, and whether 5G **SA** is reachable rather than the NSA seen so far.
- **Flake integration** — nothing exists yet. It would need the MBIM interface configured under
`stream`'s networkd, a `wan-online.target` mechanism equivalent to the current DHCP-route gate,
and a decision on whether ModemManager or a plain `mbimcli` connect script drives the bearer.
+130
View File
@@ -0,0 +1,130 @@
# slop-broker
[`slop-broker`](https://git.nul.ie/dev/slop-broker) carries out privileged operations (SSH
commands, deploys, builds and age secrets, and later DNS and previews) for the coding agents on
[`slop-cannon`](sites/home/slop-cannon.md) and other boxes, under a policy and usually after Dev
approves each one. Agents use the `slop` CLI.
The broker, its NixOS and home-manager modules, its design and the agents' guide live in its own
repository, which this flake takes as the `slop-broker` input. This page covers how these boxes use
it; for how it works, read the repository's
[design](https://git.nul.ie/dev/slop-broker/src/branch/main/docs/design.md).
## Boxes
| Box | Role |
|---|---|
| [`palace`](sites/home/palace.md) | Runs the broker, its builder and the approvals web app's listener; holds the deploy key |
| [`slop-cannon`](sites/home/slop-cannon.md) | The agents' VM; reaches the broker over vsock |
| [`castle`](sites/home/castle.md) | Agents there are a requester over SSH; Dev also approves from it over SSH |
| [`object`](sites/colony/shill/containers/object.md) | The binary cache that `slop build` pushes to |
| [`middleman`](sites/colony/shill/containers/middleman.md) | Publishes the approvals web app at `approve.slop.nul.ie`, Pocket ID at `id.nul.ie` and Paseo's web app at `slop.nul.ie` |
`palace`'s configuration is [`palace/slop-broker.nix`](../nixos/boxes/home/palace/slop-broker.nix):
the requesters, the `agent` policy they share, the secrets, and the web app settings. Its SSH
targets are the deploy-rs nodes on `master`, which the builder reads there, so a new box is a
target once it's merged.
### Updating the broker
- **Deploying `palace` doesn't restart the broker** (`restartIfChanged = false`), so it can see a
deploy of its own box through. Afterwards, restart it for a new version or configuration to take
effect: `doas systemctl --no-block restart slop-broker` on `palace`. A restart drops pending
requests and leases.
- **Deploy every requester with it** when `slop`'s protocol version changes, or their requests fail
with a protocol version error: `slop-cannon`, and `castle` over SSH.
## In this flake
- **Input:** `slop-broker` in [`flake.nix`](../flake.nix) selects a release tag. To upgrade,
change the tag and run `nix flake update slop-broker`.
- Its overlay provides `pkgs.slop-broker`.
- The common modules import `services.slop-broker`, `services.slop-broker-builder`,
`services.slop-broker-cache` and `programs.slop`.
- **Persistence:** [`tmproot.nix`](../nixos/modules/tmproot.nix) keeps `/var/lib/slop-broker` and
the builder's home when those services are enabled.
- **Firewall:** the web app's port is open only to `middleman`, in `palace`'s configuration.
- **Agents:** `my.agents.slop` (in the shared `agents` home-manager module) installs `slop` and adds
the guide (`share/slop-broker/slop-tools.md`) as a Claude rule (`~/.claude/rules/slop.md`) and
as Codex's `AGENTS.md`. `slop-cannon` enables it, allows `Bash(slop:*)` in Claude and keeps the
`deny` rules for raw `deploy` and `ssh-machine`.
- **`AGENTS.md`:** "Working from `slop-cannon`" points agents at `slop` instead of `deploy` and
`ssh-machine`. Extend it as operations land.
- **Devshell:** `slop` and `slop-approve`, built from the locked input. `slop` uses
`.keys/slop-request.key` over SSH when that file exists; an approver key never goes in `.keys/`,
because agents can read the checkout.
## Other requesters and approvers
`castle` uses [`programs.slop`](https://git.nul.ie/dev/slop-broker/src/branch/main/docs/design.md#other-requesters-and-approvers):
its agents are the requester `castle` (same policy as `slop-cannon`), and Dev's approver key is
`sshApprovers.castle`. Both log in to `palace` as `slop`.
## Binary cache
`slop build` pushes into Harmonia's store on `object` as `harmonia`, whose broker key is limited to
the store protocol and GC roots (`services.slop-broker-cache` in `object`'s configuration). CI
collects garbage in that store on every run, which the roots survive until they expire (see the
[design](https://git.nul.ie/dev/slop-broker/src/branch/main/docs/design.md#binary-cache)).
## Secrets
`slop secret` lets agents change age secrets without the dev key. The broker's own age identity
(`palace/slop-broker-age.key`, public key `.keys/slop-broker.pub`) is in `defaultKeys` in
[`secrets.nix`](../secrets.nix), so every secret is encrypted to it; adding it took one full rekey.
- The agent sends the `.age` file from its checkout, and the broker returns new ciphertext, which
the agent commits. Recipients come from the agent's `secrets.nix`.
- Before approval, the builder fetches `master`, looks the file's content up there and evaluates
`master`'s `secrets.nix`. The approval says which file the content really is and whether the
recipients match `master`'s rules for it (see the
[design](https://git.nul.ie/dev/slop-broker/src/branch/main/docs/design.md#secrets)).
- Approvals label recipients by name: `dev` and `slop-broker` through `secrets.names`
(`lib.my.c.ageKeyFiles`), and host keys through the system name `secrets.nix` writes after each
key as its comment.
### `master` is protected
Deploy approvals ("on the branch", the diff since `master`) and secret approvals both trust
`master`, so only Dev may push to it or merge into it: branch protection on `dev/nixfiles` in Gitea
refuses everyone else, including the bot user that agents on `slop-cannon` push as.
## Approval timeout
[`services.slop-broker.timeout` on `palace`](../nixos/boxes/home/palace/slop-broker.nix) gives
each approval step up to 45 minutes. For example, a deploy can wait for builder approval before
the build and for deploy approval afterward, with a separate window for each step.
`slop` prints the window when a request starts waiting (`approvers have 45m to answer`).
Keep `slop` running while the request is pending. Use a background session for commands that
may need approval. If the client disconnects, the broker cancels the pending request.
`slop requests` shows how much time each pending request has left.
## Approvals web app
`middleman` proxies `approve.slop.nul.ie` to port 8095 on `palace`. Approvers sign in through
Pocket ID at `id.nul.ie` (client `slop-approve`, restricted to the group `slop-approvers`; its
secret is `palace/slop-broker-oidc-secret`). Deploys to the routers (`river`, `stream` and
`estuary`) need a fresh passkey. See the
[design](https://git.nul.ie/dev/slop-broker/src/branch/main/docs/design.md#approvals-web-app).
## `slop.nul.ie`
`slop.nul.ie` replaces `paseo.nul.ie` for the Paseo web app on `middleman` (`paseoWebUi` in
`vhosts.nix`, `app.baseUrl` in `slop-cannon.nix`), and `*.slop.nul.ie` is reserved for previews.
The relay stays on `paseo-relay.nul.ie` for now, because existing pairings use that hostname.
Previews on `*.slop.nul.ie` will be same-site with every other `nul.ie` service, so a preview page
can set cookies on `.nul.ie` and browsers send `SameSite=Lax` cookies (including the SSO session)
with its requests to other `nul.ie` services. A separate domain would avoid this; `nul.ie` is kept
for simplicity.
## Rollout
Each step updates this page, the box pages and `AGENTS.md` as it lands.
1. **Done:** `slop.nul.ie`; the broker core, box queries, SSH transport, deploys and builds on
`palace`; `castle` over SSH; Pocket ID at `id.nul.ie`; the approvals web app; secrets.
2. **DNS**, with a Cloudflare token of the broker's own for the public zones.
3. **Previews** on `*.slop.nul.ie`, through `middleman`.
4. **TCP forwards and a cache for VM builds**, if needed.
Generated
+896 -303
View File
File diff suppressed because it is too large. Load diff
+137 -19
View File
@@ -1,42 +1,102 @@
{
description = "System configs";
# Offer our Harmonia and Numtide caches when building the flake, so `nix develop` / `nix build` don't
# rebuild from source. Nix reads `nixConfig` before the flake evaluates and rejects any computed
# value (imports/thunks), so these must stay literal — keep them in sync with `lib.my.c.nix.cache`.
# Consumers must trust these (accept-flake-config / a trusted user) for them to take effect.
nixConfig = {
extra-substituters = [
"https://nix-cache.nul.ie"
"https://cache.numtide.com"
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-cache.nul.ie-1:BzH5yMfF4HbzY1C977XzOxoPhEc9Zbu39ftPkUbH+m4="
"niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
inputs = {
flake-utils.url = "github:numtide/flake-utils";
# libnet.url = "github:reo101/nix-lib-net";
libnetRepo = {
url = "github:oddlama/nixos-extra-modules";
flake = false;
};
devshell.url = "github:numtide/devshell";
devshell.inputs.nixpkgs.follows = "nixpkgs-unstable";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
nixpkgs-stable.url = "nixpkgs/nixos-23.11";
nixpkgs-stable.url = "nixpkgs/nixos-26.05";
nixpkgs-mine.url = "github:devplayer0/nixpkgs/devplayer0";
nixpkgs-mine-stable.url = "github:devplayer0/nixpkgs/devplayer0-stable";
home-manager-unstable.url = "home-manager";
home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable";
home-manager-stable.url = "home-manager/release-23.11";
home-manager-stable.url = "home-manager/release-26.05";
home-manager-stable.inputs.nixpkgs.follows = "nixpkgs-stable";
# Determinate Nix, used as the common Nix implementation across systems, homes, the devshell and
# CI (see lib.my.c.nix). We build it ourselves (FlakeHub's cache needs auth), so it flows through
# our own Harmonia cache like everything else. Let its own lockfile choose the tested nixpkgs
# revision because its packaging carries patches that can conflict with ours.
determinate-nix.url = "https://flakehub.com/f/DeterminateSystems/nix-src/*";
# Stuff used by the flake for build / deployment
ragenix.url = "github:yaxitech/ragenix";
# ragenix.url = "github:yaxitech/ragenix";
ragenix.url = "github:devplayer0/ragenix/add-rekey-one-flag";
ragenix.inputs.nixpkgs.follows = "nixpkgs-unstable";
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs-unstable";
# Stuff used by systems
impermanence.url = "github:nix-community/impermanence";
impermanence.inputs.home-manager.follows = "home-manager-unstable";
boardie.url = "github:devplayer0/boardie";
boardie.inputs.nixpkgs.follows = "nixpkgs-unstable";
nixGL.url = "github:nix-community/nixGL";
nixGL.inputs.nixpkgs.follows = "nixpkgs-unstable";
harmonia.url = "github:nix-community/harmonia";
# harmonia.url = "github:devplayer0/harmonia/cache-config-daemon-store";
harmonia.inputs.nixpkgs.follows = "nixpkgs-unstable";
# Firmware building for the OpenWrt boxes, which aren't managed by this flake otherwise.
# `openwrt-feeds` pins the package feeds; without it, evaluation would reach the OpenWrt
# download server over import-from-derivation and break on hashes that upstream rotates daily.
openwrt-imagebuilder.url = "github:astro/nix-openwrt-imagebuilder";
openwrt-imagebuilder.inputs.nixpkgs.follows = "nixpkgs-unstable";
openwrt-feeds.url = "github:devplayer0/openwrt-feeds";
openwrt-feeds.inputs.nixpkgs.follows = "nixpkgs-unstable";
openwrt-feeds.inputs.openwrt-imagebuilder.follows = "openwrt-imagebuilder";
# Packages not in nixpkgs
sharry.url = "github:eikek/sharry";
sharry.inputs.nixpkgs.follows = "nixpkgs-unstable";
# Keep its tested nixpkgs pin so packages can use the upstream binary cache.
llm-agents.url = "github:numtide/llm-agents.nix";
# Our fork with Jujutsu support, one branch per upstream release it is rebased onto. Don't make
# it follow our nixpkgs: its npm dependency hash is tied to its own nixpkgs pin.
paseo.url = "git+https://git.nul.ie/dev/paseo?ref=fork/jujutsu-v0.17.5";
slop-broker.url = "git+https://git.nul.ie/dev/slop-broker?ref=refs/heads/progress";
slop-broker.inputs.nixpkgs.follows = "nixpkgs-unstable";
borgthin.url = "github:devplayer0/borg";
borgthin.inputs.nixpkgs.follows = "nixpkgs-mine";
attic.url = "github:zhaofengli/attic";
attic.inputs.nixpkgs.follows = "nixpkgs-unstable";
attic.inputs.nixpkgs-stable.follows = "nixpkgs-stable";
# TODO: Update borgthin so this works
# borgthin.inputs.nixpkgs.follows = "nixpkgs-mine";
copyparty.url = "github:9001/copyparty";
copyparty.inputs.nixpkgs.follows = "nixpkgs-unstable";
hass-west-wood.url = "github:devplayer0/hass-west-wood";
hass-west-wood.inputs.nixpkgs.follows = "nixpkgs-unstable";
# Disabled: `pi-coding-agent-bun` breaks `nix flake check` in CI. Its bun2nix `fetchBunDeps`
# calls `builtins.filterSource` on subpaths of the pi.nix flake source (coding-agent/bun.nix),
# which requires that source derivation to be realised in the local store. On a fresh CI runner
# it isn't, so eval aborts with `path '…-source.drv' is not valid`. Works locally only because
# the source is already realised there. Re-enable (and revisit upstream) if we start using pi.
# pi-agent.url = "github:lukasl-dev/pi.nix";
# pi-agent.inputs.nixpkgs.follows = "nixpkgs-unstable";
bootvine = {
url = "git+https://codeberg.org/wvhulle/bootvine";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
};
outputs =
@@ -51,7 +111,7 @@
...
}:
let
inherit (builtins) mapAttrs replaceStrings;
inherit (builtins) mapAttrs replaceStrings elem;
inherit (lib) mapAttrs' filterAttrs nameValuePair recurseIntoAttrs evalModules;
inherit (lib.flake) flattenTree eachDefaultSystem;
inherit (lib.my) mkDefaultSystemsPkgs flakePackageOverlay;
@@ -59,11 +119,27 @@
# Extend a lib with extras that _must not_ internally reference private nixpkgs. flake-utils doesn't, but many
# other flakes (e.g. home-manager) probably do internally.
libOverlay = final: prev: {
my = import ./lib { lib = final; };
my = import ./lib { inherit inputs; lib = final; };
flake = flake-utils.lib;
};
pkgsLibOverlay = final: prev: { lib = prev.lib.extend libOverlay; };
myPkgsOverlay = final: prev: import ./pkgs { lib = final.lib; pkgs = prev; };
# Exposes Determinate Nix under a stable attr name so systems, homes and the devshell all
# resolve the exact same package (referenced as `pkgs'.mine.determinate-nix` in configs).
# `nix-util`'s `readLinkAt.works` unit test creates PATH_MAX-length symlinks, which our CI
# runner's XFS-backed build filesystem rejects (XFS hard-caps symlink targets at 1024 bytes).
# Skip just that test via gtest's GTEST_FILTER so the rest of the suite still gates the build.
determinateOverlay = final: prev: {
determinate-nix =
(inputs.determinate-nix.packages.${prev.stdenv.hostPlatform.system}.default).overrideAttrs (o: {
checkInputs = map
(drv:
if (drv.name or "") == "nix-util-tests-run"
then drv.overrideAttrs (_: { GTEST_FILTER = "-readLinkAt.*"; })
else drv)
o.checkInputs;
});
};
# Override the flake-level lib since we're going to use it for non-config specific stuff
pkgsFlakes = mapAttrs (_: pkgsFlake: pkgsFlake // { lib = pkgsFlake.lib.extend libOverlay; }) {
@@ -90,12 +166,14 @@
(_: path: mkDefaultSystemsPkgs path (system: {
overlays = [
pkgsLibOverlay
myPkgsOverlay
determinateOverlay
inputs.slop-broker.overlays.default
inputs.devshell.overlays.default
inputs.ragenix.overlays.default
inputs.deploy-rs.overlay
inputs.deploy-rs.overlays.default
(flakePackageOverlay inputs.home-manager-unstable system)
inputs.attic.overlays.default
];
}))
pkgsFlakes;
@@ -105,8 +183,21 @@
(_: path: mkDefaultSystemsPkgs path (_: {
overlays = [
pkgsLibOverlay
myPkgsOverlay
determinateOverlay
inputs.slop-broker.overlays.default
];
config = {
# RMS forgive me...
# Normally this is set modularly, but sometimes we need to use other pkgs
allowUnfreePredicate = p: elem (lib.getName p) [
"widevine-cdm"
"chromium-unwrapped"
"chromium"
];
};
}))
pkgsFlakes;
@@ -114,11 +205,13 @@
# Systems
nixos/installer.nix
nixos/boxes/colony
nixos/boxes/colony/portcullis
nixos/boxes/tower
nixos/boxes/castle
nixos/boxes/home/stream.nix
nixos/boxes/home/palace
nixos/boxes/home/castle
nixos/boxes/britway
nixos/boxes/britnet.nix
nixos/boxes/kelder
# Homes
@@ -149,14 +242,20 @@
# Platform independent stuff
{
nixpkgs = pkgs';
inherit lib nixfiles;
inherit inputs lib nixfiles;
overlays.default = myPkgsOverlay;
nixosModules = nixfiles.config.nixos.modules;
homeModules = nixfiles.config.home-manager.modules;
nixosConfigurations = mapAttrs (_: s: s.rendered) nixfiles.config.nixos.systems;
# Containers and the installer override `rendered` with a bare `extendModules` config
# (`my.asContainer` / `my.asISO`) that lacks the `pkgs`/`lib` attrs `eval-config` exposes on a
# normal system. Determinate Nix's flake schemas read `machine.pkgs.stdenv.system` for every
# `nixosConfigurations` entry, so re-attach them from the full system eval (`configuration`).
nixosConfigurations = mapAttrs
(_: s: s.rendered // { inherit (s.configuration) pkgs lib; })
nixfiles.config.nixos.systems;
homeConfigurations = mapAttrs (_: s: s.configuration) nixfiles.config.home-manager.homes;
deploy = nixfiles.config.deploy-rs.rendered;
@@ -184,7 +283,11 @@
deploy = recurseIntoAttrs (pkgs.deploy-rs.lib.deployChecks self.deploy);
};
packages = flattenTree (import ./pkgs { inherit lib pkgs; });
packages = flattenTree (
(import ./pkgs { inherit lib pkgs; }) //
(import ./openwrt { inherit pkgs inputs; }));
llmAgentPackages = import ./ci/llm-agent-packages.nix { inherit lib inputs nixfiles system; };
devShells.default = shell;
@@ -197,8 +300,23 @@
systems' = mapAttrs' (n: v: nameValuePair "system-${n}" v) systems;
packages' = mapAttrs' (n: v: nameValuePair "package-${n}" v) packages;
in
pkgs.linkFarm "ci" (homes' // systems' // packages' // {
homes' // systems' // packages' // {
inherit shell;
});
};
ciIfdReasons =
let
inherit (nixfiles.config) nixos home-manager;
targets = builtins.attrValues nixos.systems ++ builtins.attrValues home-manager.homes;
channels = lib.unique (map (target: target.nixpkgs) (builtins.filter (target: target.system == system) targets));
hasReplacements = channel:
(import ./lib/runtime-dependency-replacements.nix {
inherit lib;
pkgs = pkgs'.${channel}.${system};
pkgsFlake = pkgsFlakes.${channel};
}) != [ ];
in
lib.optional (lib.any hasReplacements channels)
"Runtime dependency replacement reads generated store reference graphs";
}));
}
+1
View File
@@ -2,6 +2,7 @@
home-manager.modules = {
common = ./common.nix;
gui = ./gui;
agents = ./agents;
deploy-rs = ./deploy-rs.nix;
swaync = ./swaync.nix;
};
+505
View File
@@ -0,0 +1,505 @@
#!/usr/bin/env bash
# Source: https://github.com/daniel3303/ClaudeCodeStatusLine
# Single line: Model (effort) | dir@branch | tokens (%used) | 5h @reset | 7d @reset | extra | CLI version
set -f # disable globbing
VERSION="1.4.5"
input=$(cat)
if [ -z "$input" ]; then
printf "Claude"
exit 0
fi
# ANSI colors matching oh-my-posh theme
blue='\033[38;2;0;153;255m'
orange='\033[38;2;255;176;85m'
green='\033[38;2;0;160;0m'
cyan='\033[38;2;46;149;153m'
red='\033[38;2;255;85;85m'
yellow='\033[38;2;230;200;0m'
purple='\033[38;2;167;139;250m'
white='\033[38;2;220;220;220m'
dim='\033[2m'
reset='\033[0m'
# Format token counts (e.g., 50k / 200k)
format_tokens() {
local num=$1
if [ "$num" -ge 1000000 ]; then
awk "BEGIN {v=sprintf(\"%.1f\",$num/1000000)+0; if(v==int(v)) printf \"%dm\",v; else printf \"%.1fm\",v}"
elif [ "$num" -ge 1000 ]; then
awk "BEGIN {printf \"%.0fk\", $num / 1000}"
else
printf "%d" "$num"
fi
}
# Format number with commas (e.g., 134,938)
format_commas() {
printf "%'d" "$1"
}
# Return color escape based on usage percentage
# Usage: usage_color <pct>
usage_color() {
local pct=$1
if [ "$pct" -ge 90 ]; then echo "$red"
elif [ "$pct" -ge 70 ]; then echo "$orange"
elif [ "$pct" -ge 50 ]; then echo "$yellow"
else echo "$green"
fi
}
# Resolve config directory: CLAUDE_CONFIG_DIR (set by alias) or default ~/.claude
claude_config_dir="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
# Return 0 (true) if $1 > $2 using semantic versioning
version_gt() {
local a="${1#v}" b="${2#v}"
local IFS='.'
read -r a1 a2 a3 <<< "$a"
read -r b1 b2 b3 <<< "$b"
a1=${a1:-0}; a2=${a2:-0}; a3=${a3:-0}
b1=${b1:-0}; b2=${b2:-0}; b3=${b3:-0}
[ "$a1" -gt "$b1" ] 2>/dev/null && return 0
[ "$a1" -lt "$b1" ] 2>/dev/null && return 1
[ "$a2" -gt "$b2" ] 2>/dev/null && return 0
[ "$a2" -lt "$b2" ] 2>/dev/null && return 1
[ "$a3" -gt "$b3" ] 2>/dev/null && return 0
return 1
}
# ===== Extract data from JSON =====
model_name=$(echo "$input" | jq -r '.model.display_name // "Claude"')
model_name=$(echo "$model_name" | sed 's/ *(\([0-9.]*[kKmM]*\) context)/ \1/') # "(1M context)" → "1M"
# Context window
size=$(echo "$input" | jq -r '.context_window.context_window_size // 200000')
[ "$size" -eq 0 ] 2>/dev/null && size=200000
# Token usage
input_tokens=$(echo "$input" | jq -r '.context_window.current_usage.input_tokens // 0')
cache_create=$(echo "$input" | jq -r '.context_window.current_usage.cache_creation_input_tokens // 0')
cache_read=$(echo "$input" | jq -r '.context_window.current_usage.cache_read_input_tokens // 0')
current=$(( input_tokens + cache_create + cache_read ))
used_tokens=$(format_tokens $current)
total_tokens=$(format_tokens $size)
if [ "$size" -gt 0 ]; then
pct_used=$(( current * 100 / size ))
else
pct_used=0
fi
pct_remain=$(( 100 - pct_used ))
used_comma=$(format_commas $current)
remain_comma=$(format_commas $(( size - current )))
settings_path="$claude_config_dir/settings.json"
effort_level=""
stdin_effort=$(echo "$input" | jq -r '.effort.level // empty' 2>/dev/null)
if [ -n "$stdin_effort" ]; then
effort_level="$stdin_effort"
elif [ -n "$CLAUDE_CODE_EFFORT_LEVEL" ]; then
effort_level="$CLAUDE_CODE_EFFORT_LEVEL"
elif [ -f "$settings_path" ]; then
effort_val=$(jq -r '.effortLevel // empty' "$settings_path" 2>/dev/null)
[ -n "$effort_val" ] && effort_level="$effort_val"
fi
[ -z "$effort_level" ] && effort_level="medium"
# ===== Claude CLI version =====
# Prefer the version Claude Code passes on stdin (always the running instance);
# fall back to asking whichever `claude` is on PATH.
cli_version=$(echo "$input" | jq -r '.version // empty')
if [ -z "$cli_version" ]; then
cli_version=$(claude --version 2>/dev/null | awk '{print $1}')
fi
# ===== Build single-line output =====
out=""
out+="${blue}${model_name}${reset} ${dim}(${reset}"
case "$effort_level" in
low) out+="${dim}${effort_level}${reset}" ;;
medium) out+="${orange}med${reset}" ;;
high) out+="${green}${effort_level}${reset}" ;;
xhigh) out+="${purple}${effort_level}${reset}" ;;
max) out+="${red}${effort_level}${reset}" ;;
*) out+="${green}${effort_level}${reset}" ;;
esac
out+="${dim})${reset}"
# Current working directory
cwd=$(echo "$input" | jq -r '.cwd // empty')
if [ -n "$cwd" ]; then
display_dir="${cwd##*/}"
git_branch=$(git -C "${cwd}" rev-parse --abbrev-ref HEAD 2>/dev/null)
out+=" ${dim}|${reset} "
out+="${cyan}${display_dir}${reset}"
if [ -n "$git_branch" ]; then
out+="${dim}@${reset}${green}${git_branch}${reset}"
git_stat=$(git -C "${cwd}" diff --numstat 2>/dev/null | awk '{a+=$1; d+=$2} END {if (a+d>0) printf "+%d -%d", a, d}')
[ -n "$git_stat" ] && out+=" ${dim}(${reset}${green}${git_stat%% *}${reset} ${red}${git_stat##* }${reset}${dim})${reset}"
fi
fi
out+=" ${dim}|${reset} "
out+="${orange}${used_tokens}/${total_tokens}${reset} ${dim}(${reset}${green}${pct_used}%${reset}${dim})${reset}"
# ===== Cross-platform OAuth token resolution (from statusline.sh) =====
# Tries credential sources in order: env var → macOS Keychain → Linux creds file → GNOME Keyring
get_oauth_token() {
local token=""
# 1. Explicit env var override
if [ -n "$CLAUDE_CODE_OAUTH_TOKEN" ]; then
echo "$CLAUDE_CODE_OAUTH_TOKEN"
return 0
fi
# 2. macOS Keychain (Claude Code appends a SHA256 hash of CLAUDE_CONFIG_DIR to the service name)
if command -v security >/dev/null 2>&1; then
local keychain_svc="Claude Code-credentials"
if [ -n "$CLAUDE_CONFIG_DIR" ]; then
local dir_hash
dir_hash=$(echo -n "$CLAUDE_CONFIG_DIR" | shasum -a 256 | cut -c1-8)
keychain_svc="Claude Code-credentials-${dir_hash}"
fi
local blob
blob=$(security find-generic-password -s "$keychain_svc" -w 2>/dev/null)
if [ -n "$blob" ]; then
token=$(echo "$blob" | jq -r '.claudeAiOauth.accessToken // empty' 2>/dev/null)
if [ -n "$token" ] && [ "$token" != "null" ]; then
echo "$token"
return 0
fi
fi
fi
# 3. Linux credentials file
local creds_file="${claude_config_dir}/.credentials.json"
if [ -f "$creds_file" ]; then
token=$(jq -r '.claudeAiOauth.accessToken // empty' "$creds_file" 2>/dev/null)
if [ -n "$token" ] && [ "$token" != "null" ]; then
echo "$token"
return 0
fi
fi
# 4. GNOME Keyring via secret-tool
if command -v secret-tool >/dev/null 2>&1; then
local blob
blob=$(timeout 2 secret-tool lookup service "Claude Code-credentials" 2>/dev/null)
if [ -n "$blob" ]; then
token=$(echo "$blob" | jq -r '.claudeAiOauth.accessToken // empty' 2>/dev/null)
if [ -n "$token" ] && [ "$token" != "null" ]; then
echo "$token"
return 0
fi
fi
fi
echo ""
}
# ===== LINE 2 & 3: Usage limits with progress bars =====
# First, try to use rate_limits data provided directly by Claude Code in the JSON input.
# This is the most reliable source — no OAuth token or API call required.
builtin_five_hour_pct=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')
builtin_five_hour_reset=$(echo "$input" | jq -r '.rate_limits.five_hour.resets_at // empty')
builtin_seven_day_pct=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty')
builtin_seven_day_reset=$(echo "$input" | jq -r '.rate_limits.seven_day.resets_at // empty')
use_builtin=false
if [ -n "$builtin_five_hour_pct" ] || [ -n "$builtin_seven_day_pct" ]; then
use_builtin=true
fi
# Cache setup — shared across all Claude Code instances to avoid rate limits
claude_config_dir_hash=$(echo -n "$claude_config_dir" | shasum -a 256 2>/dev/null || echo -n "$claude_config_dir" | sha256sum 2>/dev/null)
claude_config_dir_hash=$(echo "$claude_config_dir_hash" | cut -c1-8)
cache_file="/tmp/claude/statusline-usage-cache-${claude_config_dir_hash}.json"
cache_max_age=60 # seconds between API calls
mkdir -p /tmp/claude
needs_refresh=true
usage_data=""
# Always load cache — used as primary source for API path, and as fallback when builtin reports zero
if [ -f "$cache_file" ] && [ -s "$cache_file" ]; then
cache_mtime=$(stat -c %Y "$cache_file" 2>/dev/null || stat -f %m "$cache_file" 2>/dev/null)
now=$(date +%s)
cache_age=$(( now - cache_mtime ))
if [ "$cache_age" -lt "$cache_max_age" ]; then
needs_refresh=false
fi
usage_data=$(cat "$cache_file" 2>/dev/null)
fi
# When builtin values are all zero AND reset timestamps are missing, it likely indicates
# an API failure on Claude's side — fall through to cached data instead of displaying
# misleading 0%. Genuine zero responses (after a billing reset) still include valid
# resets_at timestamps, so we trust those.
effective_builtin=false
if $use_builtin; then
# Trust builtin if any percentage is non-zero
if { [ -n "$builtin_five_hour_pct" ] && [ "$(printf '%.0f' "$builtin_five_hour_pct" 2>/dev/null)" != "0" ]; } || \
{ [ -n "$builtin_seven_day_pct" ] && [ "$(printf '%.0f' "$builtin_seven_day_pct" 2>/dev/null)" != "0" ]; }; then
effective_builtin=true
fi
# Also trust if reset timestamps are present — genuine zero responses include valid reset times
if ! $effective_builtin; then
if { [ -n "$builtin_five_hour_reset" ] && [ "$builtin_five_hour_reset" != "null" ] && [ "$builtin_five_hour_reset" != "0" ]; } || \
{ [ -n "$builtin_seven_day_reset" ] && [ "$builtin_seven_day_reset" != "null" ] && [ "$builtin_seven_day_reset" != "0" ]; }; then
effective_builtin=true
fi
fi
fi
# Refresh API cache when stale — runs regardless of builtin rate_limits because
# extra_usage is only exposed through the OAuth usage endpoint (not stdin JSON).
# Throttled to cache_max_age and stampede-locked via touch for shared panes.
if $needs_refresh; then
touch "$cache_file" # stampede lock: prevent parallel panes from fetching simultaneously
token=$(get_oauth_token)
if [ -n "$token" ] && [ "$token" != "null" ]; then
response=$(curl -s --max-time 10 \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $token" \
-H "anthropic-beta: oauth-2025-04-20" \
-H "User-Agent: claude-code/2.1.34" \
"https://api.anthropic.com/api/oauth/usage" 2>/dev/null)
# Only cache valid usage responses (not error/rate-limit JSON)
if [ -n "$response" ] && echo "$response" | jq -e '.five_hour' >/dev/null 2>&1; then
usage_data="$response"
echo "$response" > "$cache_file"
fi
fi
# Remove the stampede sentinel if the fetch failed to produce valid JSON —
# otherwise an empty cache file would suppress retries for a full cache_max_age window.
[ -f "$cache_file" ] && [ ! -s "$cache_file" ] && rm -f "$cache_file"
fi
# Cross-platform ISO to epoch conversion
# Converts ISO 8601 timestamp (e.g. "2025-06-15T12:30:00Z" or "2025-06-15T12:30:00.123+00:00") to epoch seconds.
# Properly handles UTC timestamps and converts to local time.
iso_to_epoch() {
local iso_str="$1"
# Try GNU date first (Linux) — handles ISO 8601 format automatically
local epoch
epoch=$(date -d "${iso_str}" +%s 2>/dev/null)
if [ -n "$epoch" ]; then
echo "$epoch"
return 0
fi
# BSD date (macOS) - handle various ISO 8601 formats
local stripped="${iso_str%%.*}" # Remove fractional seconds (.123456)
stripped="${stripped%%Z}" # Remove trailing Z
stripped="${stripped%%+*}" # Remove timezone offset (+00:00)
stripped="${stripped%%-[0-9][0-9]:[0-9][0-9]}" # Remove negative timezone offset
# Check if timestamp is UTC (has Z or +00:00 or -00:00)
if [[ "$iso_str" == *"Z"* ]] || [[ "$iso_str" == *"+00:00"* ]] || [[ "$iso_str" == *"-00:00"* ]]; then
# For UTC timestamps, parse with timezone set to UTC
epoch=$(env TZ=UTC date -j -f "%Y-%m-%dT%H:%M:%S" "$stripped" +%s 2>/dev/null)
else
epoch=$(date -j -f "%Y-%m-%dT%H:%M:%S" "$stripped" +%s 2>/dev/null)
fi
if [ -n "$epoch" ]; then
echo "$epoch"
return 0
fi
return 1
}
# Format ISO reset time to compact local time
# Usage: format_reset_time <iso_string> <style: time|datetime|date>
format_reset_time() {
local iso_str="$1"
local style="$2"
{ [ -z "$iso_str" ] || [ "$iso_str" = "null" ]; } && return
# Parse ISO datetime and convert to local time (cross-platform)
local epoch
epoch=$(iso_to_epoch "$iso_str")
[ -z "$epoch" ] && return
# Format based on style
# Try GNU date first (Linux), then BSD date (macOS)
# Previous implementation piped BSD date through sed/tr, which always returned
# exit code 0 from the last pipe stage, preventing the GNU date fallback from
# ever executing on Linux.
local formatted=""
case "$style" in
time)
formatted=$(date -d "@$epoch" +"%H:%M" 2>/dev/null) || \
formatted=$(date -j -r "$epoch" +"%H:%M" 2>/dev/null)
;;
datetime)
formatted=$(date -d "@$epoch" +"%a %b %-d, %H:%M" 2>/dev/null) || \
formatted=$(date -j -r "$epoch" +"%a %b %-d, %H:%M" 2>/dev/null)
;;
*)
formatted=$(date -d "@$epoch" +"%b %-d" 2>/dev/null) || \
formatted=$(date -j -r "$epoch" +"%b %-d" 2>/dev/null)
;;
esac
[ -n "$formatted" ] && echo "$formatted"
}
sep=" ${dim}|${reset} "
# Render extra_usage segment from API usage data (not available via stdin rate_limits).
# Appends to the global $out. No-op when data is missing or is_enabled is false.
render_extra_usage() {
local data="$1"
[ -z "$data" ] && return
local enabled
enabled=$(echo "$data" | jq -r '.extra_usage.is_enabled // false' 2>/dev/null)
[ "$enabled" != "true" ] && return
local pct used limit
pct=$(echo "$data" | jq -r '.extra_usage.utilization // 0' | awk '{printf "%.0f", $1}')
used=$(echo "$data" | jq -r '.extra_usage.used_credits // 0' | LC_NUMERIC=C awk '{printf "%.2f", $1/100}')
limit=$(echo "$data" | jq -r '.extra_usage.monthly_limit // 0' | LC_NUMERIC=C awk '{printf "%.2f", $1/100}')
if [ -n "$used" ] && [ -n "$limit" ] && [[ "$used" != *'$'* ]] && [[ "$limit" != *'$'* ]]; then
local color
color=$(usage_color "$pct")
out+="${sep}${white}extra${reset} ${color}\$${used}/\$${limit}${reset}"
else
out+="${sep}${white}extra${reset} ${green}enabled${reset}"
fi
}
if $effective_builtin; then
# ---- Use rate_limits data provided directly by Claude Code in JSON input ----
# resets_at values are Unix epoch integers in this source
if [ -n "$builtin_five_hour_pct" ]; then
five_hour_pct=$(printf "%.0f" "$builtin_five_hour_pct")
five_hour_color=$(usage_color "$five_hour_pct")
out+="${sep}${white}5h${reset} ${five_hour_color}${five_hour_pct}%${reset}"
if [ -n "$builtin_five_hour_reset" ] && [ "$builtin_five_hour_reset" != "null" ]; then
five_hour_reset=$(date -j -r "$builtin_five_hour_reset" +"%H:%M" 2>/dev/null || date -d "@$builtin_five_hour_reset" +"%H:%M" 2>/dev/null)
[ -n "$five_hour_reset" ] && out+=" ${dim}@${five_hour_reset}${reset}"
fi
fi
if [ -n "$builtin_seven_day_pct" ]; then
seven_day_pct=$(printf "%.0f" "$builtin_seven_day_pct")
seven_day_color=$(usage_color "$seven_day_pct")
out+="${sep}${white}7d${reset} ${seven_day_color}${seven_day_pct}%${reset}"
if [ -n "$builtin_seven_day_reset" ] && [ "$builtin_seven_day_reset" != "null" ]; then
seven_day_reset=$(date -j -r "$builtin_seven_day_reset" +"%a %b %-d, %H:%M" 2>/dev/null || date -d "@$builtin_seven_day_reset" +"%a %b %-d, %H:%M" 2>/dev/null)
[ -n "$seven_day_reset" ] && out+=" ${dim}@${seven_day_reset}${reset}"
fi
fi
# Render extra_usage from API cache (stdin rate_limits doesn't expose it)
render_extra_usage "$usage_data"
# Cache builtin values so they're available as fallback when API is unavailable.
# Convert epoch resets_at to ISO 8601 for compatibility with the API-format cache parser.
# Preserve extra_usage from prior API response so we don't clobber it.
_fh_reset_json="null"
if [ -n "$builtin_five_hour_reset" ] && [ "$builtin_five_hour_reset" != "null" ] && [ "$builtin_five_hour_reset" != "0" ]; then
_fh_iso=$(date -u -r "$builtin_five_hour_reset" +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null || \
date -u -d "@$builtin_five_hour_reset" +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null)
[ -n "$_fh_iso" ] && _fh_reset_json="\"$_fh_iso\""
fi
_sd_reset_json="null"
if [ -n "$builtin_seven_day_reset" ] && [ "$builtin_seven_day_reset" != "null" ] && [ "$builtin_seven_day_reset" != "0" ]; then
_sd_iso=$(date -u -r "$builtin_seven_day_reset" +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null || \
date -u -d "@$builtin_seven_day_reset" +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null)
[ -n "$_sd_iso" ] && _sd_reset_json="\"$_sd_iso\""
fi
_extra_json=$(echo "$usage_data" | jq -c '.extra_usage // null' 2>/dev/null)
[ -z "$_extra_json" ] && _extra_json="null"
printf '{"five_hour":{"utilization":%s,"resets_at":%s},"seven_day":{"utilization":%s,"resets_at":%s},"extra_usage":%s}' \
"${builtin_five_hour_pct:-0}" "$_fh_reset_json" \
"${builtin_seven_day_pct:-0}" "$_sd_reset_json" \
"$_extra_json" > "$cache_file" 2>/dev/null
elif [ -n "$usage_data" ] && echo "$usage_data" | jq -e '.five_hour' >/dev/null 2>&1; then
# ---- Fall back: API-fetched usage data ----
# ---- 5-hour (current) ----
five_hour_pct=$(echo "$usage_data" | jq -r '.five_hour.utilization // 0' | awk '{printf "%.0f", $1}')
five_hour_reset_iso=$(echo "$usage_data" | jq -r '.five_hour.resets_at // empty')
five_hour_reset=$(format_reset_time "$five_hour_reset_iso" "time")
five_hour_color=$(usage_color "$five_hour_pct")
out+="${sep}${white}5h${reset} ${five_hour_color}${five_hour_pct}%${reset}"
[ -n "$five_hour_reset" ] && out+=" ${dim}@${five_hour_reset}${reset}"
# ---- 7-day (weekly) ----
seven_day_pct=$(echo "$usage_data" | jq -r '.seven_day.utilization // 0' | awk '{printf "%.0f", $1}')
seven_day_reset_iso=$(echo "$usage_data" | jq -r '.seven_day.resets_at // empty')
seven_day_reset=$(format_reset_time "$seven_day_reset_iso" "datetime")
seven_day_color=$(usage_color "$seven_day_pct")
out+="${sep}${white}7d${reset} ${seven_day_color}${seven_day_pct}%${reset}"
[ -n "$seven_day_reset" ] && out+=" ${dim}@${seven_day_reset}${reset}"
render_extra_usage "$usage_data"
else
# No valid usage data — show placeholders
out+="${sep}${white}5h${reset} ${dim}-${reset}"
out+="${sep}${white}7d${reset} ${dim}-${reset}"
fi
# ===== Update check (cached, 24h TTL) =====
# Set STATUSLINE_CHECK_UPDATES=false to disable the update check (no network calls).
update_line=""
if [ "${STATUSLINE_CHECK_UPDATES:-true}" != "false" ]; then
version_cache_file="/tmp/claude/statusline-version-cache.json"
version_cache_max_age=86400 # 24 hours
version_needs_refresh=true
version_data=""
if [ -f "$version_cache_file" ]; then
vc_mtime=$(stat -c %Y "$version_cache_file" 2>/dev/null || stat -f %m "$version_cache_file" 2>/dev/null)
vc_now=$(date +%s)
vc_age=$(( vc_now - vc_mtime ))
if [ "$vc_age" -lt "$version_cache_max_age" ]; then
version_needs_refresh=false
fi
version_data=$(cat "$version_cache_file" 2>/dev/null)
fi
if $version_needs_refresh; then
touch "$version_cache_file" 2>/dev/null
vc_response=$(curl -s --max-time 5 \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/daniel3303/ClaudeCodeStatusLine/releases/latest" 2>/dev/null)
if [ -n "$vc_response" ] && echo "$vc_response" | jq -e '.tag_name' >/dev/null 2>&1; then
version_data="$vc_response"
echo "$vc_response" > "$version_cache_file"
elif [ ! -s "$version_cache_file" ]; then
rm -f "$version_cache_file" 2>/dev/null
fi
fi
if [ -n "$version_data" ]; then
latest_tag=$(echo "$version_data" | jq -r '.tag_name // empty')
if [ -n "$latest_tag" ] && version_gt "$latest_tag" "$VERSION"; then
update_line="\n${dim}Update available: ${latest_tag} → Tell Claude: \"Find my installed status bar and update it\"${reset}"
fi
fi
fi
# Append CLI version as last segment
if [ -n "$cli_version" ]; then
out+=" ${dim}|${reset} ${orange}v${cli_version}${reset}"
fi
# Output
printf "%b" "$out$update_line"
exit 0
+68
View File
@@ -0,0 +1,68 @@
{ lib, pkgs, inputs, config, options, ... }:
let
inherit (lib) mkIf optional optionalAttrs mapAttrs attrValues types;
inherit (lib.my) mkOpt' mkBoolOpt';
cfg = config.my.agents;
agentPkgs = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system};
slopGuide = "${pkgs.slop-broker}/share/slop-broker/slop-tools.md";
# Claude takes a rule file each; Codex takes one `AGENTS.md`
rules = optionalAttrs cfg.slop.enable { slop = slopGuide; }
// mapAttrs (name: text: pkgs.writeText "${name}.md" text) cfg.rules;
codexContext = pkgs.concatText "AGENTS.md" (attrValues rules);
in
{
options.my.agents = {
enable = mkBoolOpt' false "Whether to install and configure coding agents (Claude Code, Codex).";
slop.enable = mkBoolOpt' false "Whether agents use the `slop` client for privileged operations.";
rules = mkOpt' (types.attrsOf types.lines) { }
"Instructions for every agent, by name: a Claude rule each, and appended to Codex's `AGENTS.md`.";
};
config = mkIf cfg.enable {
home.packages = optional cfg.slop.enable pkgs.slop-broker;
programs = {
# TODO: Remove mutableSettings guard when Home Manager 26.11 releases; 26.05 lacks it.
codex = {
enable = true;
package = agentPkgs.codex;
settings.sandbox_workspace_write.network_access = true;
settings.tui = {
status_line = [
"model-with-reasoning"
"current-dir"
"five-hour-limit"
"weekly-limit"
"context-used"
"context-window-size"
"total-input-tokens"
"total-output-tokens"
"used-tokens"
];
status_line_use_colors = true;
};
} // optionalAttrs (options.programs.codex ? mutableSettings) {
mutableSettings = true;
} // optionalAttrs (rules != { }) {
context = "${codexContext}";
};
claude-code = {
enable = true;
package = agentPkgs.claude-code;
inherit rules;
settings = {
model = "opus";
theme = "auto";
statusLine = {
type = "command";
command = ./claude-statusline.sh;
padding = 0;
};
};
};
};
};
}
+86 -30
View File
@@ -2,12 +2,18 @@
let
inherit (builtins) listToAttrs mapAttrs readFile;
inherit (lib)
optionalString nameValuePair concatMapStrings concatStringsSep optionalAttrs versionAtLeast
optionalString nameValuePair concatMapStrings concatStringsSep
mapAttrsToList mkMerge mkIf mkDefault mkOption;
inherit (lib.hm) dag;
inherit (lib.my) mkOpt' dummyOption;
runtimeDependencyReplacements = import ../../lib/runtime-dependency-replacements.nix { inherit lib pkgs pkgsFlake; };
in
{
# Disabled: breaks `nix flake check` in CI (see flake.nix pi-agent note).
# imports = [ inputs.pi-agent.homeModules.default ];
imports = [ inputs.slop-broker.homeModules.slop ];
options = with lib.types; {
my = {
isStandalone = mkOption {
@@ -26,7 +32,22 @@ in
};
};
};
home.activationPackage = mkOption {
apply = drv:
if config.my.isStandalone && runtimeDependencyReplacements != [ ] then
(pkgs.replaceDependencies.override {
replaceDirectDependencies = pkgs.replaceDirectDependencies.override {
nix = config.nix.package;
};
}) {
inherit drv;
replacements = runtimeDependencyReplacements;
}
else drv;
};
};
config = mkMerge [
{
my = {
@@ -46,8 +67,7 @@ in
};
nix = {
package = mkIf (!(versionAtLeast config.home.stateVersion "22.11")) pkgs.nix;
settings = with lib.my.c.nix; {
settings = with lib.my.c.nix; determinateSettings // {
experimental-features = [ "nix-command" "flakes" "ca-derivations" ];
max-jobs = mkDefault "auto";
@@ -64,9 +84,27 @@ in
# never care about.
home-manager.enable = true;
git = {
enable = true;
settings = {
user = {
email = "jackos1998@gmail.com";
name = "Jack O'Sullivan";
};
pull.rebase = true;
};
lfs.enable = true;
};
diff-so-fancy.enable = true;
jujutsu = {
enable = true;
settings.user = config.programs.git.settings.user;
};
lsd = {
enable = mkDefault true;
enableAliases = mkDefault true;
enableFishIntegration = mkDefault true;
};
starship = {
@@ -132,38 +170,50 @@ in
ssh = {
enable = mkDefault true;
matchBlocks = {
enableDefaultConfig = false;
settings = {
nix-dev-vm = {
user = "dev";
hostname = "localhost";
port = 2222;
extraOptions = {
StrictHostKeyChecking = "no";
UserKnownHostsFile = "/dev/null";
};
User = "dev";
HostName = "localhost";
Port = 2222;
StrictHostKeyChecking = "no";
UserKnownHostsFile = "/dev/null";
};
"rsync.net" = {
host = "rsyncnet";
user = "16413";
hostname = "ch-s010.rsync";
Host = "rsyncnet";
User = "16413";
HostName = "ch-s010.rsync";
};
# Coding agents run as `slop-cannon`; never forward an agent there
slop-cannon = {
HostName = "slop-cannon.${lib.my.c.home.domain}";
User = "slop-cannon";
ForwardAgent = "no";
};
slop-cannon-dev = {
HostName = "slop-cannon.${lib.my.c.home.domain}";
User = "dev";
ForwardAgent = "no";
};
shoe = {
host = "shoe.netsoc.tcd.ie shoe";
user = "netsoc";
Host = "shoe.netsoc.tcd.ie shoe";
User = "netsoc";
};
netsocBoxes = {
host = "cube spoon napalm gandalf saruman";
user = "root";
Host = "cube spoon napalm gandalf saruman";
User = "root";
};
"*" = {
IdentityFile = [
"~/.ssh/id_rsa"
"~/.ssh/borg"
];
};
};
extraConfig =
''
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/netsoc
IdentityFile ~/.ssh/borg
'';
};
direnv = {
@@ -199,17 +249,22 @@ in
file
tree
pwgen
python3
minicom
iperf3
mosh
wget
hyx
whois
ldns
minicom
mtr
hyx
ncdu
jq
yq-go
nix-tree
treemd
];
sessionVariables = {
@@ -223,9 +278,10 @@ in
# Note: If globalPkgs mode is on, then these will be overridden by the NixOS equivalents of these options
nixpkgs = {
overlays = [
inputs.deploy-rs.overlay
inputs.deploy-rs.overlays.default
inputs.boardie.overlays.default
inputs.nixGL.overlays.default
# inputs.pi-agent.overlays.default
];
config = {
allowUnfree = true;
@@ -248,13 +304,13 @@ in
ssh.authKeys.files = [ lib.my.c.sshKeyFiles.me ];
};
nix.package = mkIf (versionAtLeast config.home.stateVersion "22.05") pkgs.nix;
nix.package = pkgs'.mine.determinate-nix;
fonts.fontconfig.enable = true;
home = {
packages = with pkgs; [
pkgs'.mine.nix
pkgs'.mine.determinate-nix
];
# Without this, we are at the mercy of whatever version of nix is in $PATH...
@@ -0,0 +1,28 @@
# XTerm's default colors
# Default colors
[colors.primary]
background = '#000000'
foreground = '#ffffff'
# Normal colors
[colors.normal]
black = '#000000'
red = '#cd0000'
green = '#00cd00'
yellow = '#cdcd00'
blue = '#0000ee'
magenta = '#cd00cd'
cyan = '#00cdcd'
white = '#e5e5e5'
# Bright colors
[colors.bright]
black = '#7f7f7f'
red = '#ff0000'
green = '#00ff00'
yellow = '#ffff00'
blue = '#5c5cff'
magenta = '#ff00ff'
cyan = '#00ffff'
white = '#ffffff'
+298 -64
View File
@@ -1,7 +1,8 @@
{ lib, pkgs, config, ... }:
{ lib, pkgs', pkgs, inputs, config, options, ... }:
let
inherit (lib) genAttrs mkIf mkMerge mkForce;
inherit (lib.my) mkBoolOpt';
inherit (lib) genAttrs mkIf mkMerge mkForce mapAttrs mkOptionDefault mkDefault optional optionalAttrs;
inherit (lib.my) mkOpt' mkBoolOpt';
inherit (lib.my.c) pubDomain;
cfg = config.my.gui;
@@ -10,34 +11,114 @@ let
name = "Monocraft";
size = 10;
};
doomWad = pkgs.fetchurl {
url = "https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad";
hash = "sha256-HX1DvlAeZ9kn5BXguPPinDvzMHXoWXIYFvZSpSbKx3E=";
};
subwaySurfers = pkgs.fetchurl {
url = "https://p.${pubDomain}/video/subway-surfers-smol.mkv";
hash = "sha256-fMe7TDRNTymRHIJOi7qG3trzu4GP8a3gCDz+FMkX1dY=";
};
minecraftParkour = pkgs.fetchurl {
url = "https://p.${pubDomain}/video/minecraft-parkour-smol.mkv";
hash = "sha256-723pRm4AsIjY/WFUyAHzTJp+JvH4Pn5hvzF9wHTnOPA=";
};
genLipsum = pkgs.writeScript "lipsum" ''
#!${pkgs.python3.withPackages (ps: [ ps.python-lorem ])}/bin/python
import lorem
print(lorem.get_paragraph(count=5, sep='\n\n'))
'';
doomsaver' = brainrotTextCommand: pkgs.runCommand "doomsaver" {
inherit (pkgs) windowtolayer tmux terminaltexteffects;
chocoDoom = pkgs.chocolate-doom2xx;
ffmpeg = pkgs.ffmpeg-full;
python = pkgs.python3.withPackages (ps: [ ps.filelock ]);
inherit doomWad;
enojy = ./enojy.jpg;
inherit brainrotTextCommand subwaySurfers minecraftParkour;
} ''
mkdir -p "$out"/bin
substituteAll ${./screensaver.py} "$out"/bin/doomsaver
chmod +x "$out"/bin/doomsaver
'';
doomsaver = doomsaver' cfg.screensaver.brainrotTextCommand;
firefoxMemoryControl = pkgs.firefox-memory-control.override {
inherit (cfg.firefoxMemoryControl) lowAvailableMiB highAvailableMiB pollIntervalMs minInactiveMs;
};
in
{
options.my.gui = {
options.my.gui = with lib.types; {
enable = mkBoolOpt' true "Enable settings and packages meant for graphical systems";
manageGraphical = mkBoolOpt' false "Configure the graphical session";
standalone = mkBoolOpt' false "Enable settings for fully Nix managed systems";
screensaver.brainrotTextCommand = mkOpt' (either path str) genLipsum "Command to generate brainrot text.";
firefoxMemoryControl = {
enable = mkBoolOpt' pkgs.stdenv.isLinux "Enable memory-pressure tab unloading in Firefox";
lowAvailableMiB = mkOpt' ints.positive 2048 "Available memory threshold at which Firefox starts unloading tabs.";
highAvailableMiB = mkOpt' ints.positive 3072 "Available memory threshold at which Firefox stops unloading tabs.";
pollIntervalMs = mkOpt' ints.positive 1000 "Memory-pressure polling interval in milliseconds.";
minInactiveMs = mkOpt' ints.unsigned 300000 "Minimum tab inactivity before automatic unloading, in milliseconds.";
};
};
config = mkIf cfg.enable (mkMerge [
{
assertions = [
{
assertion = cfg.firefoxMemoryControl.highAvailableMiB > cfg.firefoxMemoryControl.lowAvailableMiB;
message = "`my.gui.firefoxMemoryControl.highAvailableMiB` must exceed `lowAvailableMiB`.";
}
];
my.agents.enable = mkDefault true;
home = {
packages = with pkgs; [
packages = (with pkgs; [
xdg-utils
font.package
(nerdfonts.override {
fonts = [ "DroidSansMono" "SourceCodePro" ];
})
noto-fonts-emoji
nerd-fonts.sauce-code-pro
nerd-fonts.droid-sans-mono
noto-fonts-color-emoji
grim
slurp
swappy
satty
python310Packages.python-lsp-server
python3Packages.python-lsp-server
nil # nix language server
nixd # another nix language server
zls # zig language server
rust-analyzer
neofetch
];
pyright
cowsay
fortune
jp2a
terminaltexteffects
screenfetch
fastfetch
cmatrix
doomsaver
ffmpeg-full
xournalpp
# Disabled: breaks `nix flake check` in CI (see flake.nix pi-agent note).
# (pkgs.symlinkJoin {
# name = "pi-coding-agent";
# buildInputs = [ pkgs.makeWrapper ];
# paths = [ pkgs.pi-coding-agent-bun ];
# postBuild = ''
# wrapProgram $out/bin/pi \
# --set NPM_CONFIG_PREFIX ${config.home.homeDirectory}/.pi/npm/ \
# --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.nodejs_latest ]}
# '';
# })
]) ++ optional cfg.firefoxMemoryControl.enable firefoxMemoryControl;
};
programs = {
@@ -51,7 +132,15 @@ in
alacritty = {
enable = true;
settings = {
font.normal.family = font.name;
general.import = [ ./alacritty-xterm.toml ];
font = {
size = font.size;
normal = {
family = font.name;
style = "Regular";
};
};
};
};
@@ -59,9 +148,23 @@ in
enable = true;
inherit font;
settings = {
background_opacity = "0.8";
background_opacity = "0.65";
tab_bar_edge = "top";
shell_integration = "no-sudo";
font_features = "${font.name} -liga";
};
};
foot = {
enable = true;
settings = {
main = {
font = "${font.name}:size=${toString font.size}";
};
colors = {
alpha = 0.8;
background = "000000";
};
};
};
@@ -108,6 +211,19 @@ in
};
Install.RequiredBy = [ "sway-session.target" ];
};
activate-linux = {
Unit = {
Description = "Linux activation watermark";
After = "graphical-session.target";
PartOf = "graphical-session.target";
};
Service = {
Type = "simple";
ExecStart = "${pkgs.activate-linux}/bin/activate-linux";
};
Install.RequiredBy = [ "graphical-session.target" ];
};
};
};
@@ -117,6 +233,7 @@ in
wl-clipboard
wev
wdisplays
swaysome
pavucontrol
libsecret
@@ -126,10 +243,11 @@ in
];
pointerCursor = {
package = pkgs.vanilla-dmz;
name = "Vanilla-DMZ";
size = 16;
package = pkgs.posy-cursors;
name = "Posy_Cursor";
size = 32;
gtk.enable = true;
x11.enable = true;
};
};
@@ -138,9 +256,36 @@ in
xsession.preferStatusNotifierItems = true;
wayland = {
windowManager = {
sway = {
sway =
let
cfg = config.wayland.windowManager.sway.config;
mod = cfg.modifier;
renameWs = pkgs.writeShellScript "sway-rename-ws" ''
focused_ws="$(swaymsg -t get_workspaces | jq ".[] | select(.focused)")"
focused_num="$(jq -r ".num" <<< "$focused_ws")"
focused_name="$(jq -r ".name" <<< "$focused_ws")"
placeholder="$(sed -E 's/[0-9]+: //' <<< "$focused_name")"
name="$(rofi -dmenu -p "rename ws $focused_num" -theme+entry+placeholder "\"$placeholder\"")"
if [ -n "$name" ]; then
swaymsg rename workspace "$focused_name" to "$focused_num: $name"
fi
'';
clearWsName = pkgs.writeShellScript "sway-clear-ws-name" ''
focused_ws="$(swaymsg -t get_workspaces | jq ".[] | select(.focused)")"
focused_num="$(jq -r ".num" <<< "$focused_ws")"
focused_name="$(jq -r ".name" <<< "$focused_ws")"
swaymsg rename workspace "$focused_name" to "$focused_num"
'';
in
{
enable = true;
xwayland = true;
extraConfigEarly = ''
set $mod ${mod}
'';
config = {
input = {
"type:touchpad" = {
@@ -155,31 +300,96 @@ in
modifier = "Mod4";
terminal = "kitty";
keybindings =
let
cfg = config.wayland.windowManager.sway.config;
mod = cfg.modifier;
in
lib.mkOptionDefault {
"${mod}+d" = null;
"${mod}+l" = "exec swaylock -i ${./lock.png} -s stretch";
"${mod}+x" = "exec ${cfg.menu}";
"${mod}+Shift+x" = "exec rofi -show drun";
"${mod}+q" = "kill";
"${mod}+Shift+q" = "exec swaynag -t warning -m 'bruh you really wanna kill sway?' -b 'ye' 'systemctl --user stop graphical-session.target && swaymsg exit'";
"${mod}+Shift+d" = ''exec grim - | swappy -f -'';
"${mod}+Shift+s" = ''exec grim -g "$(slurp)" - | swappy -f -'';
"${mod}+Shift+e" = "exec rofi -show emoji";
# Config for this doesn't seem to work :/
"${mod}+c" = ''exec rofi -show calc -calc-command "echo -n '{result}' | ${pkgs.wl-clipboard}/bin/wl-copy"'';
keybindings = mapAttrs (k: mkOptionDefault) {
"${mod}+Left" = "focus left";
"${mod}+Down" = "focus down";
"${mod}+Up" = "focus up";
"${mod}+Right" = "focus right";
"XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5";
"XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5";
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play";
"XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl pause";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
};
"${mod}+Shift+Left" = "move left";
"${mod}+Shift+Down" = "move down";
"${mod}+Shift+Up" = "move up";
"${mod}+Shift+Right" = "move right";
"${mod}+b" = "splith";
"${mod}+v" = "splitv";
"${mod}+f" = "fullscreen toggle";
"${mod}+a" = "focus parent";
"${mod}+s" = "layout stacking";
"${mod}+w" = "layout tabbed";
"${mod}+e" = "layout toggle split";
"${mod}+Shift+space" = "floating toggle";
"${mod}+space" = "focus mode_toggle";
"${mod}+1" = "workspace number 1";
"${mod}+2" = "workspace number 2";
"${mod}+3" = "workspace number 3";
"${mod}+4" = "workspace number 4";
"${mod}+5" = "workspace number 5";
"${mod}+6" = "workspace number 6";
"${mod}+7" = "workspace number 7";
"${mod}+8" = "workspace number 8";
"${mod}+9" = "workspace number 9";
"${mod}+0" = "workspace number 10";
"${mod}+Shift+1" =
"move container to workspace number 1";
"${mod}+Shift+2" =
"move container to workspace number 2";
"${mod}+Shift+3" =
"move container to workspace number 3";
"${mod}+Shift+4" =
"move container to workspace number 4";
"${mod}+Shift+5" =
"move container to workspace number 5";
"${mod}+Shift+6" =
"move container to workspace number 6";
"${mod}+Shift+7" =
"move container to workspace number 7";
"${mod}+Shift+8" =
"move container to workspace number 8";
"${mod}+Shift+9" =
"move container to workspace number 9";
"${mod}+Shift+0" =
"move container to workspace number 10";
"${mod}+Shift+minus" = "move scratchpad";
"${mod}+minus" = "scratchpad show";
"${mod}+Return" = "exec ${cfg.terminal}";
"${mod}+r" = "mode resize";
"${mod}+d" = null;
"${mod}+l" = "exec ${doomsaver}/bin/doomsaver";
"${mod}+q" = "kill";
"${mod}+Shift+c" = "reload";
"${mod}+Shift+q" = "exec swaynag -t warning -m 'bruh you really wanna kill sway?' -b 'ye' 'systemctl --user stop graphical-session.target && swaymsg exit'";
# rofi
"${mod}+x" = "exec ${cfg.menu}";
"${mod}+Shift+x" = "exec rofi -show drun";
"${mod}+Shift+e" = "exec rofi -show emoji";
# Config for this doesn't seem to work :/
"${mod}+c" = ''exec rofi -show calc -calc-command "echo -n '{result}' | ${pkgs.wl-clipboard}/bin/wl-copy"'';
"${mod}+Shift+r" = "exec ${renameWs}";
"${mod}+Shift+n" = "exec ${clearWsName}";
# Screenshots
"${mod}+Shift+d" = ''exec grim - | satty -f - --copy-command "${pkgs.wl-clipboard}/bin/wl-copy"'';
"${mod}+Shift+s" = ''exec grim -g "$(slurp)" - | satty -f - --copy-command "${pkgs.wl-clipboard}/bin/wl-copy"'';
"XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
"XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%";
"XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5";
"XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5";
# Some AVRCP devices alternate play and pause events independently of player state.
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPause" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
};
keycodebindings = {
# keycode for XF86AudioPlayPause (no sym for some reason)
"172" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
@@ -188,6 +398,9 @@ in
menu = "rofi -show run";
bars = mkForce [ ];
};
extraConfig = ''
include ${./swaysome.conf}
'';
swaynag = {
enable = true;
@@ -199,8 +412,12 @@ in
gtk = {
enable = true;
theme = {
name = "Numix";
package = pkgs.numix-gtk-theme;
name = "Adwaita";
package = pkgs.gnome-themes-extra;
};
gtk4.theme = {
name = "Adwaita";
package = pkgs.gnome-themes-extra;
};
iconTheme = {
name = "Numix";
@@ -210,17 +427,10 @@ in
};
qt = {
enable = true;
platformTheme = "gtk";
platformTheme.name = "gtk";
};
services = {
swaync = {
enable = true;
settings = {
widgets = [ "title" "dnd" "mpris" "notifications" ];
};
};
playerctld.enable = true;
spotifyd = {
enable = false;
@@ -237,19 +447,33 @@ in
device_type = "computer";
};
};
easyeffects = {
enable = mkDefault false;
preset = mkDefault "moar-bass";
extraPresets = {
moar-bass = {
output = {
"bass_enhancer#0" = {
amount = 3;
blend = 0;
bypass = false;
floor = 20;
floor-active = false;
harmonics = 8.5;
input-gain = 0;
output-gain = 0;
scope = 100;
};
blocklist = [ ];
plugins_order = [ "bass_enhancer#0" ];
};
};
};
};
};
programs = {
git = {
enable = true;
diff-so-fancy.enable = true;
userEmail = "jackos1998@gmail.com";
userName = "Jack O'Sullivan";
extraConfig = {
pull.rebase = true;
};
};
waybar = import ./waybar.nix { inherit lib pkgs config font; };
rofi = {
enable = true;
@@ -271,7 +495,7 @@ in
chromium = {
enable = true;
package = (pkgs.chromium.override { enableWideVine = true; }).overrideAttrs (old: {
package = (pkgs'.unstable.chromium.override { enableWideVine = true; }).overrideAttrs (old: {
buildCommand = ''
${old.buildCommand}
@@ -297,6 +521,15 @@ in
] (_: "chromium-browser.desktop");
};
};
my = {
swaync = {
enable = true;
settings = {
widgets = [ "title" "dnd" "mpris" "notifications" ];
};
};
};
})
(mkIf (cfg.standalone && !pkgs.stdenv.isDarwin) {
@@ -304,6 +537,7 @@ in
userDirs = {
enable = true;
createDirectories = true;
setSessionVariables = true;
desktop = "$HOME/desktop";
documents = "$HOME/documents";
download = "$HOME/downloads";
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

+257
View File
@@ -0,0 +1,257 @@
#!@python@/bin/python
import argparse
import json
import os
import random
import signal
import subprocess
import sys
import filelock
class Screensaver:
def __init__(self, cmd, env=None, weight=1):
self.cmd = cmd
self.weight = weight
if env is not None:
self.env = os.environ.copy()
for k, v in env.items():
self.env[k] = v
else:
self.env = None
self.proc = None
def start(self):
assert self.proc is None
self.proc = subprocess.Popen(self.cmd, env=self.env)
def wait(self):
assert self.proc is not None
self.proc.wait()
def stop(self, kill=False):
assert self.proc is not None
if kill:
self.proc.kill()
else:
self.proc.terminate()
class DoomSaver(Screensaver):
wad = '@doomWad@'
def __init__(self, demo_index, weight=1.5):
super().__init__(
['@chocoDoom@/bin/chocolate-doom',
'-iwad', self.wad,
'-demoloopi', str(demo_index)],
env={
'SDL_AUDIODRIVER': 'null',
'SDL_VIDEODRIVER': 'caca',
'CACA_DRIVER': 'ncurses',
},
weight=weight,
)
def stop(self):
super().stop(kill=True)
class TTESaver(Screensaver):
effects = (
'beams,binarypath,blackhole,bouncyballs,bubbles,burn,colorshift,crumble,'
'decrypt,errorcorrect,expand,fireworks,middleout,orbittingvolley,overflow,'
'pour,print,rain,randomsequence,rings,scattered,slice,slide,spotlights,'
'spray,swarm,synthgrid,unstable,vhstape,waves,wipe'
).split(',')
def __init__(self, cmd, env=None, weight=1):
super().__init__(cmd, env=env, weight=weight)
self.running = False
def start(self):
self.running = True
def wait(self):
while self.running:
effect_cmd = ['@terminaltexteffects@/bin/tte', random.choice(self.effects)]
print(f"$ {self.cmd} | {' '.join(effect_cmd)}")
content = subprocess.check_output(self.cmd, shell=True, env=self.env, stderr=subprocess.DEVNULL)
self.proc = subprocess.Popen(effect_cmd, stdin=subprocess.PIPE)
self.proc.stdin.write(content)
self.proc.stdin.close()
self.proc.wait()
def stop(self):
self.running = False
self.proc.terminate()
class FFmpegCACASaver(Screensaver):
@staticmethod
def command(video, size):
return ['@ffmpeg@/bin/ffmpeg', '-hide_banner', '-loglevel', 'error',
'-stream_loop', '-1', '-i', video,
'-pix_fmt', 'rgb24', '-window_size', f'{size}x{size}',
'-f', 'caca', '-']
def __init__(self, video, weight=2):
cols, lines = os.get_terminal_size()
# IDK if it's reasonable to do this as "1:1"
size = lines - 4
super().__init__(
self.command(video, size),
env={'CACA_DRIVER': 'ncurses'},
weight=weight,
)
def stop(self):
super().stop(kill=True)
class BrainrotStorySaver(Screensaver):
def __init__(self, video, text_command, weight=2):
cols, lines = os.get_terminal_size()
video_size = lines - 1
video_command = ' '.join(FFmpegCACASaver.command(video, video_size))
text_command = (
f'while true; do {text_command} | '
f'@terminaltexteffects@/bin/tte --wrap-text --canvas-width=80 --canvas-height={video_size//2} --anchor-canvas=c '
'print --final-gradient-stops=ffffff; clear; done' )
self.tmux_session = f'screensaver-{os.urandom(4).hex()}'
super().__init__(
['@tmux@/bin/tmux', 'new-session', '-s', self.tmux_session, '-n', 'brainrot',
text_command, ';', 'split-window', '-hbl', str(lines), video_command],
# ['sh', '-c', text_command],
env={
'CACA_DRIVER': 'ncurses',
'SHELL': '/bin/sh',
},
weight=weight,
)
def stop(self):
subprocess.check_call(['@tmux@/bin/tmux', 'kill-session', '-t', self.tmux_session])
class MultiSaver:
savers = [
DoomSaver(0),
DoomSaver(1),
DoomSaver(2),
Screensaver(['cmatrix']),
TTESaver('screenfetch -N'),
TTESaver('fortune | cowsay'),
TTESaver('top -bn1 | head -n50'),
TTESaver('ss -nltu'),
TTESaver('ss -ntu'),
TTESaver('jp2a --width=100 @enojy@'),
BrainrotStorySaver('@subwaySurfers@', '@brainrotTextCommand@'),
BrainrotStorySaver('@minecraftParkour@', '@brainrotTextCommand@'),
]
state_filename = 'screensaver.json'
def __init__(self, select=None):
self.state_path = os.path.join(f'/run/user/{os.geteuid()}', self.state_filename)
self.lock = filelock.FileLock(f'{self.state_path}.lock')
if select is not None:
assert select >= 0 and select < len(self.savers), 'Invalid screensaver index'
self.selected = self.savers[select]
else:
self.selected = None
self.cleaned_up = False
def select(self):
with self.lock:
if not os.path.exists(self.state_path):
state = {'instances': []}
else:
with open(self.state_path) as f:
state = json.load(f)
if self.selected is None:
available = set(range(len(self.savers)))
new_instances = []
for instance in state['instances']:
if not os.path.exists(f"/proc/{instance['pid']}"):
continue
new_instances.append(instance)
i = instance['saver']
assert i in available
available.remove(i)
assert available, 'No screensavers left'
available = list(available)
weights = []
for i in available:
weights.append(self.savers[i].weight)
selected_i = random.choices(available, weights=weights)[0]
new_instances.append({'pid': os.getpid(), 'saver': selected_i})
state['instances'] = new_instances
# print(f'Selected saver {selected_i}')
self.selected = self.savers[selected_i]
with open(self.state_path, 'w') as f:
json.dump(state, f)
def cleanup(self):
if self.cleaned_up:
return
self.cleaned_up = True
with self.lock:
with open(self.state_path) as f:
state = json.load(f)
for i, instance in enumerate(state['instances']):
if instance['pid'] == os.getpid():
del state['instances'][i]
with open(self.state_path, 'w') as f:
json.dump(state, f)
def run(self):
assert self.selected is not None
self.selected.start()
signal.signal(signal.SIGINT, self._sighandler)
signal.signal(signal.SIGTERM, self._sighandler)
signal.signal(signal.SIGHUP, self._sighandler)
self.selected.wait()
self.cleanup()
def stop(self):
assert self.selected is not None
print('Shutting down')
self.selected.stop()
self.cleanup()
def _sighandler(self, signum, frame):
self.stop()
def main():
parser = argparse.ArgumentParser(description='Wayland terminal-based lock screen')
parser.add_argument('-l', '--locker-cmd', default='swaylock-plugin', help='swaylock-plugin command to use')
parser.add_argument('-t', '--terminal', default='alacritty', help='Terminal emulator to use')
parser.add_argument('-i', '--instance', action='store_true', help='Run as instance')
parser.add_argument('-s', '--screensaver', type=int, help='Force use of specific screensaver')
args = parser.parse_args()
if not args.instance:
cmd = [
args.locker_cmd, '--command-each',
f'@windowtolayer@/bin/windowtolayer -- {args.terminal} -e {sys.argv[0]} --instance']
if args.screensaver is not None:
cmd[-1] += f' --screensaver {args.screensaver}'
subprocess.check_call(cmd)
return
ms = MultiSaver(select=args.screensaver)
ms.select()
ms.run()
if __name__ == '__main__':
main()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 251 KiB

Loaded 100 of 296 files, more files were not shown because too many files have changed in this diff. Show more