hyperhive/nix/host-modules
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas bdf8fdabd7 feat(#2862): swarm snapshot store, the btrfs receive endpoint
P1 of the storage backend: hives push agent snapshots over the
WireGuard mesh that swarm.nix already brings up. No controller
dependency — a btrfs subvolume tree, a socket-activated receiver, and
the existing mesh.

The mesh is the authentication. Cryptokey routing already binds a
peer's source address to its public key (allowedIPs = [
peer.wireguardAddress ]), so the store adds no key material and no
certs; anything else would authenticate the same fact twice.

Destination is keyed per AGENT, not per hive: after a migration the
same agent's next incremental send arrives from a different hive, and
a per-hive prefix would split its snapshot chain and break the
incremental parent lookup — the exact case this store exists to serve.

The sender unavoidably contributes the agent name (a btrfs stream
carries no such notion, and the subvolume name inside it is the
sender's). So the receiver owns the destination root and VALIDATES the
sender-supplied leaf against a whitelist charset — no slash, no dot,
so neither traversal nor an absolute path can survive it.

ListenStream binds this host's mesh address, never a wildcard, and
that is asserted rather than commented: bound to 0.0.0.0 the socket
would be an unauthenticated remote write into agent state.

swarm.nix: the mesh config moves off the c0re.enable gate onto
swarm.wireguard.enable. The mesh is host networking, not a c0re
feature — a swarm host that runs no hive (this store) previously got
no wg-hive interface at all. Nothing in that block was c0re-specific;
the peer data c0re consumes is rendered in hive-c0re and stays gated
there.

Confinement is deliberately not in the module: it is a property of the
deployment (a dedicated VM, or a container in the all-local case). The
systemd hardening is defence in depth only — btrfs receive needs
CAP_SYS_ADMIN, which can mount() its way out of the namespace those
directives set up. The `dedicated` option turns "this host runs
nothing else" into an assertion the build checks instead of an
assumption the deployer remembers.
2026-07-31 19:03:24 +02:00
..
hive-c0re refactor(#2693): pass claudeCodePackage straight into serve.json 2026-07-27 13:56:28 +02:00
hive-forge refactor(#2427): extract shared hive-CA trust bind-mount helper 2026-07-15 20:12:52 +02:00
hive-gateway fix(gateway): resync the gateway's resolv.conf when the host's changes 2026-07-26 18:01:34 +02:00
lib refactor(#2427): extract shared hive-CA trust bind-mount helper 2026-07-15 20:12:52 +02:00
default.nix feat(#2862): swarm snapshot store, the btrfs receive endpoint 2026-07-31 19:03:24 +02:00
hive-ci.nix fix(#2673): set nix fallback in agent + CI containers 2026-07-25 19:36:31 +02:00
hive-matrix.nix fix: shared-netns infra containers must not run their own firewall 2026-07-14 00:08:33 +02:00
hive-network.nix feat: hive DNS always follows the host resolver 2026-07-13 22:09:53 +02:00
hive-priv.nix fix(#2573): also add /etc/tmpfiles.d to hive-priv ReadWritePaths (same EROFS class) 2026-07-18 16:39:20 +02:00
hive-snapshot-store.nix feat(#2862): swarm snapshot store, the btrfs receive endpoint 2026-07-31 19:03:24 +02:00
hive-tls.nix docs: sweep archaeology comments to present state 2026-07-13 22:16:02 +02:00
hyperhive.nix refactor(#2464): rename hive-ag3nt crate to hive-agent, collapse lib into main 2026-07-15 16:09:39 +02:00
otel.nix refactor: nix/host-modules + nix/agent-modules layout, update doc paths 2026-07-13 22:05:49 +02:00
swarm.nix feat(#2862): swarm snapshot store, the btrfs receive endpoint 2026-07-31 19:03:24 +02:00