deploy: give every option an enable, and name the controller one
Two corrections from review, applied forward on this branch rather than
by rewriting it.
`deploy.<service>` was a bare bool, which makes
`deploy.forgejo = { enable; ci; }` unrepresentable -- the nested
CI-runner sub-option this namespace was designed around. Every entry is
now an attrset with an `enable`, so a second per-host deployment
decision becomes an ordinary addition rather than a migration.
`deploy.controller` is now `deploy.swarm-controller`, consistent with
`deploy.swarm-ui`, which was introduced in the same commit.
89 references rewritten across 24 files -- nix, Rust, docs, and the
repo's own CLAUDE.md.
The prefix-anchored sweep missed exactly one, and it was live code:
hive-tls.nix spells it `hyperhiveCfg.deploy.controller` -- the only
`hyperhiveCfg` prefix among 45 references. A suffix grep
(`\.deploy\.<name>`) finds it; a path-anchored one cannot, because the
head of a reference is whatever alias the reading file happens to bind.
This commit is contained in:
parent
ba5ab313b3
commit
d3b40da1c8
24 changed files with 137 additions and 121 deletions
|
|
@ -71,25 +71,27 @@ in
|
|||
# authelia: a swarm has one SSO provider, and this says it lives here.
|
||||
# With it off the hive is a *client* — `swarm.authelia.url` still points
|
||||
# at whoever runs it.
|
||||
config.services.hyperhive.deploy.authelia = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
config.services.hyperhive.deploy.authelia.enable = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
|
||||
# The queue. Same rule: once per swarm, optional.
|
||||
config.services.hyperhive.deploy.nats = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
config.services.hyperhive.deploy.nats.enable = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
|
||||
# The swarm collector that feeds the metrics pair, and the only tier
|
||||
# holding the upstream credential. ⚠️ NOT the per-hive collector below,
|
||||
# which every hive runs.
|
||||
config.services.hyperhive.deploy.otel = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
config.services.hyperhive.deploy.otel.enable = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
|
||||
# The metrics pair, deriving together on purpose: 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 this switch. An
|
||||
# operator who wants exactly one still sets it directly, which
|
||||
# `mkDefault` allows.
|
||||
config.services.hyperhive.deploy.victoriametrics = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
config.services.hyperhive.deploy.grafana = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
config.services.hyperhive.deploy.victoriametrics.enable =
|
||||
lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
config.services.hyperhive.deploy.grafana.enable = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
|
||||
# The log store, from the same switch for the same reason as the rest: a
|
||||
# hive that is not the service host is a *client* of it, not a second one.
|
||||
config.services.hyperhive.deploy.victorialogs = lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
config.services.hyperhive.deploy.victorialogs.enable =
|
||||
lib.mkDefault swarmCfg.enableRequiredServices;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue