feat(nix): derive the hive domain from a new swarm.domain

Every hive in a swarm occupies its own sub-domain of the swarm's, so
the hive domain is derivable rather than something each hive restates.
`services.hyperhive.swarm.domain` is new and nullable; the hive's own
`domain` keeps its existing required-ness and its existing assertion,
and gains a default of `<hiveName>.<swarm.domain>`.

Deliberately a default and not a rename: an alias would reinterpret the
domains hives have already deployed, while a default only fills in the
ones that never set one. Same reason there is no new assertion — the
existing message just names the derivation, so this adds a way to stop
failing rather than a way to fail.
This commit is contained in:
atlas 2026-08-05 14:45:12 +02:00 committed by mara
commit ec565120af
3 changed files with 63 additions and 5 deletions

View file

@ -22,12 +22,23 @@ services.hyperhive = {
domain = "pr1ma.example.com"; # machine-addressable DNS domain
hiveName = "pr1ma"; # human display name (optional)
swarm.name = "constellat1on"; # shared swarm display name (optional)
swarm.domain = "example.com"; # the swarm's DNS domain
};
```
`domain` is required when matrix federation is on (`matrix.enable`);
it drives `HYPERHIVE_HIVE_DOMAIN` in every container so agents can
form qualified labels (`iris@pr1ma.example.com`). `hiveName` and
`domain` is required whenever hyperhive is enabled — eval fails with a
hint if it is unset. It drives `HYPERHIVE_HIVE_DOMAIN` in every
container so agents can form qualified labels
(`iris@pr1ma.example.com`).
You can also *not* write it: with `swarm.domain` and `hiveName` set,
`domain` defaults to `<hiveName>.<swarm.domain>`, since every hive in a
swarm occupies its own sub-domain of it. That is a default and not a
rename — a hive that pins `domain` explicitly keeps exactly the value it
has today, which is the point: re-rooting where a value *comes from*
must not reinterpret the values already deployed.
`hiveName` and
`swarm.name` are purely display — they surface in the dashboard chrome
header and per-agent system prompts. Federated hives at different
domains can share a `swarm.name`; that it sits under `swarm` and