Watch
0
0
Fork
You've already forked hyperhive
0

nix: warn on the ignored swarm-ui switches instead of failing eval

deploy.swarm-ui.enable and swarm.ui.enable are declared again as
nullOr bool, default null, and do nothing. Setting either adds an eval
warning that swarm-ui now runs wherever swarm-controller runs.
This commit is contained in:
atlas 2026-10-13 10:09:44 +02:00 • committed by mara
commit 44346d8c6c
3 changed files with 36 additions and 33 deletions

View file

@ -28,13 +28,23 @@
# spread across the service modules, so all of them have a single home
# and a single file to delete when the deprecation window closes — the
# shape ./swarm-peers-removed.nix already uses.
{ lib, ... }:
{ config, lib, ... }:
let
# Shared by the two removed spellings of the swarm UI's own switch below.
swarmUiSwitchRemoved = ''
swarm-ui now runs wherever swarm-controller runs. Remove this
definition; services.hyperhive.deploy.swarm-controller.enable decides it.
'';
# The swarm UI's own switch, in both spellings. Accepted and ignored: a
# definition only produces a warning, so a host that still sets one keeps
# evaluating. `null` is "not set".
swarmUiSwitchIgnored = lib.mkOption {
type = lib.types.nullOr lib.types.bool;
default = null;
visible = false;
description = ''
No effect. swarm-ui runs wherever swarm-controller runs.
'';
};
swarmUiSwitchWarning =
path: value:
lib.optional (value != null)
"services.hyperhive.${path} no longer has any effect: swarm-ui now runs wherever swarm-controller runs. Remove this setting; services.hyperhive.deploy.swarm-controller.enable decides it.";
# Shared by the two removed spellings of the status-publishing secret below.
statusSecretRemoved = ''
@ -98,20 +108,6 @@ in
be deleted.
''
)
(lib.mkRemovedOptionModule [
"services"
"hyperhive"
"swarm"
"ui"
"enable"
] swarmUiSwitchRemoved)
(lib.mkRemovedOptionModule [
"services"
"hyperhive"
"deploy"
"swarm-ui"
"enable"
] swarmUiSwitchRemoved)
(lib.mkRenamedOptionModule
[ "services" "hyperhive" "swarm" "authelia" "enable" ]
[ "services" "hyperhive" "deploy" "authelia" "enable" ]
@ -451,7 +447,7 @@ in
[ "services" "hyperhive" "deploy" "victoriametrics" "package" ]
)
# With this one `services.hyperhive.swarm.ui` holds nothing at all: its
# `enable` is removed above and its `package` is renamed here.
# `enable` is an ignored switch (declared below) and its `package` is renamed here.
(lib.mkRenamedOptionModule
[ "services" "hyperhive" "swarm" "ui" "package" ]
[ "services" "hyperhive" "deploy" "swarm-ui" "package" ]
@ -490,7 +486,14 @@ in
# ⚠️ Only `deploy.forgejo.enable` is declared here. The rest of
# `deploy.forgejo` is in ./hive-forge/default.nix: the knobs live with the
# module that reads them; this file stays the registry of toggles.
options.services.hyperhive.swarm.ui.enable = swarmUiSwitchIgnored;
config.warnings =
swarmUiSwitchWarning "deploy.swarm-ui.enable" config.services.hyperhive.deploy.swarm-ui.enable
++ swarmUiSwitchWarning "swarm.ui.enable" config.services.hyperhive.swarm.ui.enable;
options.services.hyperhive.deploy = {
swarm-ui.enable = swarmUiSwitchIgnored;
forgejo.enable = lib.mkOption {
type = lib.types.bool;
default = false;