mara on the PR: "why deprecate individual keys instead of the whole attrset? there is no hyperhive.forge anymore after the move". Right, and mkRenamedOptionModule takes the namespace path directly - the subtree comes with it, nested ci.* included. Fifteen explicit renames collapse to one. The list was also a liability: an option added under swarm.forge later would have needed remembering here to get an alias, so it could silently fall behind the options it mirrors. Re-ran both evals against the new form. Values still map (httpPort 3999, ci.concurrency 7 through the old paths) and the warning still fires; it now names the attrset rather than the leaf, which also means one warning per hive instead of one per option an operator had set.
26 lines
1.1 KiB
Nix
26 lines
1.1 KiB
Nix
# Backwards-compatibility aliases for options that moved under
|
|
# `services.hyperhive.swarm.*` when the swarm-global services were
|
|
# consolidated into one namespace.
|
|
#
|
|
# One rename per moved *namespace*, not per option: `mkRenamedOptionModule`
|
|
# takes the attrset path and carries the whole subtree, nested children
|
|
# included. An existing hive keeps evaluating, and its operator gets a single
|
|
# warning naming both paths rather than one per option they had set.
|
|
#
|
|
# A per-leaf list would also work and would be strictly worse: every option
|
|
# added under `swarm.forge` later would need remembering here to get an alias,
|
|
# so the list is a thing that can silently fall behind the options it mirrors.
|
|
#
|
|
# ⚠️ Only options that are genuinely **swarm-global** belong here. The
|
|
# per-agent `hyperhive.forge.url` (`nix/agent-modules/forge.nix`) is a client
|
|
# pointer at whatever forge an agent talks to — it shares a word with the
|
|
# service and nothing else, and it does not move.
|
|
{ lib, ... }:
|
|
{
|
|
imports = [
|
|
(lib.mkRenamedOptionModule
|
|
[ "services" "hyperhive" "forge" ]
|
|
[ "services" "hyperhive" "swarm" "forge" ]
|
|
)
|
|
];
|
|
}
|