From 6a6266cd5e822856a596ba3ab9168bde708f0f77 Mon Sep 17 00:00:00 2001 From: atlas Date: Fri, 31 Jul 2026 18:54:53 +0200 Subject: [PATCH] refactor(#2862): keep the option at services.hyperhive.snapshotStore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- docs/snapshot-store.md | 2 +- nix/host-modules/swarm-snapshot-store.nix | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/snapshot-store.md b/docs/snapshot-store.md index daaa8542..8bacdd21 100644 --- a/docs/snapshot-store.md +++ b/docs/snapshot-store.md @@ -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; diff --git a/nix/host-modules/swarm-snapshot-store.nix b/nix/host-modules/swarm-snapshot-store.nix index d8049684..bcbafc99 100644 --- a/nix/host-modules/swarm-snapshot-store.nix +++ b/nix/host-modules/swarm-snapshot-store.nix @@ -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.