deploy: rename swarm.enableRequiredServices to deploy.allSwarmServices

Both halves of the old name were wrong about the subject. The services
are required of the SWARM, not of the host, and the option says whether
THIS host runs them — so it described the wrong thing and sat in the
namespace that has to be identical on every host. The new name is mara's
own phrasing of what it means: "deploy all swarm level services on this
host".

mkRenamedOptionModule carries existing configs, read-side references
included, so this warns rather than failing to evaluate.

Three sites were not just the identifier:

- local-defaults.nix set it inside `config.services.hyperhive.swarm =
  { … }`. It moves out as a path beside the other deploy.* setter rather
  than into a second `deploy = { … }` attrset — the warning that file
  already carries about `swarm` applies to any second definition of the
  same parent.
- swarm-required-services.nix bound only `swarmCfg`, now unused; it binds
  and reads `deployCfg`.
- Two comments in that file described a half-migrated state, where the
  switch asserted some `swarm.*.enable` toggles and some `deploy.*` ones.
  Every one of them has been `deploy.*` for several slices now.
This commit is contained in:
atlas 2026-08-30 19:39:52 +02:00 committed by mara
commit 585269b8a3
7 changed files with 58 additions and 47 deletions

View file

@ -110,6 +110,15 @@ in
[ "services" "hyperhive" "swarm" "victorialogs" "retentionPeriod" ]
[ "services" "hyperhive" "deploy" "victorialogs" "retentionPeriod" ]
)
# The switch over all of the above, and the name changes with the path
# because the old one described the wrong subject: those services are
# required of the SWARM, while the option says whether THIS host runs
# them. `allSwarmServices` is mara's own phrasing of what it means.
(lib.mkRenamedOptionModule
[ "services" "hyperhive" "swarm" "enableRequiredServices" ]
[ "services" "hyperhive" "deploy" "allSwarmServices" ]
)
];
# ⚠️ `deploy.forgejo` is declared in ./hive-ci.nix, not here, and it is the
@ -140,7 +149,7 @@ in
Run the swarm's metrics store on this host.
Derives from
{option}`services.hyperhive.swarm.enableRequiredServices` together
{option}`services.hyperhive.deploy.allSwarmServices` together
with {option}`services.hyperhive.deploy.grafana.enable`: a store
with no UI is unreadable and a UI with no store is empty, so there
is no sensible deployment that takes one and not the other from
@ -155,7 +164,7 @@ in
Run the swarm's log store on this host.
Derives from
{option}`services.hyperhive.swarm.enableRequiredServices` for the
{option}`services.hyperhive.deploy.allSwarmServices` for the
same reason as the metrics pair above: a hive that is not the
service host is a *client* of this store, not a second one.
'';
@ -169,7 +178,7 @@ in
Run the swarm's secret store in a `swarm-bao` container on this
host. A swarm has one store and it has to exist somewhere, so
this is asserted from
{option}`services.hyperhive.swarm.enableRequiredServices`
{option}`services.hyperhive.deploy.allSwarmServices`
alongside the other once-per-swarm services.
That assertion is a `mkDefault`, which is what keeps *where* the
@ -193,7 +202,7 @@ in
example = true;
description = ''
Run the swarm's authelia in a `swarm-authelia` container on this
host. {option}`services.hyperhive.swarm.enableRequiredServices`
host. {option}`services.hyperhive.deploy.allSwarmServices`
turns this on a swarm has one SSO provider, and that says it
lives here.
@ -212,7 +221,7 @@ in
Run the **swarm's** telemetry collector on this host.
Derives from
{option}`services.hyperhive.swarm.enableRequiredServices` with the
{option}`services.hyperhive.deploy.allSwarmServices` with the
metrics pair it feeds: a swarm has one of these, and it belongs
wherever the shared services live rather than on every hive.
@ -234,7 +243,7 @@ in
`hive-matrix` container on this host.
Derives from
{option}`services.hyperhive.swarm.enableRequiredServices` with
{option}`services.hyperhive.deploy.allSwarmServices` with
the other once-per-swarm services. Set it here directly to put
the homeserver somewhere other than the host holding the rest.
@ -282,7 +291,7 @@ in
Derived from
{option}`services.hyperhive.deploy.swarm-controller.enable` rather
than from
{option}`services.hyperhive.swarm.enableRequiredServices`: the UI
{option}`services.hyperhive.deploy.allSwarmServices`: the UI
is a view onto the controller's state and reaches it over that
daemon's unix socket, so the host that runs the controller is the
host that can serve the UI. A hive that merely *uses* a swarm has