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";