From 30a94d35e9d9fc7e518ecd655d4e871a09b59721 Mon Sep 17 00:00:00 2001 From: atlas Date: Wed, 5 Aug 2026 11:15:41 +0200 Subject: [PATCH] refactor(nix): move the swarm display name under services.hyperhive.swarm services.hyperhive.swarmName becomes services.hyperhive.swarm.name, with one mkRenamedOptionModule in hyperhive.nix -- the module that declares it, same convention as the forge and matrix renames, so each migration stays independent of its siblings. hiveName deliberately stays where it is. It names this hive; swarm.name names the group the hive belongs to, and that they now sit one level apart is the distinction rather than an inconsistency. The per-agent hyperhive.swarmName is an internal mirror rendered from the host value and does not move, same split as forge and matrix. --- nix/host-modules/hive-c0re/environment.nix | 4 ++-- nix/host-modules/hyperhive.nix | 26 +++++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/nix/host-modules/hive-c0re/environment.nix b/nix/host-modules/hive-c0re/environment.nix index 0a86bbba..03309b30 100644 --- a/nix/host-modules/hive-c0re/environment.nix +++ b/nix/host-modules/hive-c0re/environment.nix @@ -56,8 +56,8 @@ in // lib.optionalAttrs (config.services.hyperhive.hiveName != null) { HYPERHIVE_HIVE_NAME = config.services.hyperhive.hiveName; } -// lib.optionalAttrs (config.services.hyperhive.swarmName != null) { - HYPERHIVE_SWARM_NAME = config.services.hyperhive.swarmName; +// lib.optionalAttrs (config.services.hyperhive.swarm.name != null) { + HYPERHIVE_SWARM_NAME = config.services.hyperhive.swarm.name; } // lib.optionalAttrs (!config.services.hyperhive.github.enable) { # GitHub integration is on by default; only signal the OFF override to diff --git a/nix/host-modules/hyperhive.nix b/nix/host-modules/hyperhive.nix index 46f7f660..79b40777 100644 --- a/nix/host-modules/hyperhive.nix +++ b/nix/host-modules/hyperhive.nix @@ -7,6 +7,16 @@ ... }: { + # The swarm's display name moved under `swarm` when the swarm-global + # settings were consolidated; the hive's own name and domain stayed put, + # because they describe this hive rather than the swarm it joins. + imports = [ + (lib.mkRenamedOptionModule + [ "services" "hyperhive" "swarmName" ] + [ "services" "hyperhive" "swarm" "name" ] + ) + ]; + # Top-level hyperhive enable flag. When true, automatically enables # hive-c0re and the on-by-default hyperhive subsystems. options.services.hyperhive.enable = lib.mkEnableOption "hyperhive — the agent swarm coordinator"; @@ -39,11 +49,12 @@ ''; }; - # Human display names for hive + swarm. Distinct from the DNS - # domain above (machine-readable) — see - # docs/conventions.md::Hive identity for the - # domain-vs-name-vs-swarm distinction + the env-var - # propagation chain. + # Human display name for this hive. Distinct from the DNS domain + # above (machine-readable) — see docs/conventions.md::Hive identity + # for the domain-vs-name-vs-swarm distinction + the env-var + # propagation chain. The swarm's display name is + # `services.hyperhive.swarm.name`, one level out: this hive is named + # here, the swarm it belongs to is named there. options.services.hyperhive.hiveName = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; @@ -61,7 +72,10 @@ ''; }; - options.services.hyperhive.swarmName = lib.mkOption { + # The one hive-level option that describes something ABOVE the hive, + # which is why it sits under `swarm` with the swarm-global services + # rather than beside `hiveName`. + options.services.hyperhive.swarm.name = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; example = "constellat1on";