refactor(#2862): keep the option at services.hyperhive.snapshotStore

Reverting the namespace move from the previous commit — mara's reason
is better than mine was.

I grouped it with swarm.peers and swarm.wireguard because the module
serves the swarm tier. But those two describe THE SWARM: who is in it,
how it is meshed. snapshotStore describes THIS HOST'S ROLE. On a
standalone store box the operator enables one service, and nesting it
under `swarm` implies they are configuring a swarm when they are not.

The swarm- prefix on the file and units stands: the name says which
tier the component serves, the option path says what you are turning
on. Those are different questions and they are allowed different
answers.
This commit is contained in:
atlas 2026-07-31 18:54:53 +02:00 committed by mara
commit 6a6266cd5e
2 changed files with 5 additions and 5 deletions

View file

@ -19,7 +19,7 @@ assume:
## Enabling it
```nix
services.hyperhive.swarm.snapshotStore = {
services.hyperhive.snapshotStore = {
enable = true;
path = "/var/lib/hyperhive-snapshots"; # must be on btrfs
port = 51821;

View file

@ -25,7 +25,7 @@
...
}:
let
cfg = config.services.hyperhive.swarm.snapshotStore;
cfg = config.services.hyperhive.snapshotStore;
wgCfg = config.services.hyperhive.swarm.wireguard;
# `swarm.wireguard.address` carries a prefix ("10.100.0.1/24") because
@ -93,7 +93,7 @@ let
'';
in
{
options.services.hyperhive.swarm.snapshotStore = {
options.services.hyperhive.snapshotStore = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
@ -137,7 +137,7 @@ in
{
assertion = wgCfg.enable;
message = ''
services.hyperhive.swarm.snapshotStore.enable requires
services.hyperhive.snapshotStore.enable requires
services.hyperhive.swarm.wireguard.enable --- the mesh is the
store's transport AND its authentication (cryptokey routing
binds a peer's source address to its public key). Without it
@ -148,7 +148,7 @@ in
{
assertion = wgCfg.address != "";
message = ''
services.hyperhive.swarm.snapshotStore.enable requires
services.hyperhive.snapshotStore.enable requires
services.hyperhive.swarm.wireguard.address to be set --- the
receiver binds to this host's mesh address, and refuses to
fall back to a wildcard.