feat(nix): one switch for an all-on-one-host deployment

`services.hyperhive.enableAllLocalDefaults` is the single "everything
runs on this box" toggle, and the autoconfigurable settings default from
it: `swarm.enableRequiredServices` (new — the swarm's shared services
run here) and `swarm.ca.autoConfigure` (previously an explicit false).

Off by default, unchanged from before: a host cannot tell whether it is
the one meant to hold the swarm's services or its CA, so this stays an
operator saying "this is that box". What it replaces is one toggle per
service for the deployment where the answer is "all of them".

Each derived toggle can still be set on its own, so "all local except X"
needs no further option.
This commit is contained in:
atlas 2026-08-05 17:50:46 +02:00
commit b94382b815
3 changed files with 59 additions and 1 deletions

View file

@ -52,12 +52,19 @@ in
options.services.hyperhive.swarm.ca = {
autoConfigure = lib.mkOption {
type = lib.types.bool;
default = false;
default = hyperhiveCfg.enableAllLocalDefaults;
defaultText = lib.literalExpression "services.hyperhive.enableAllLocalDefaults";
example = true;
description = ''
Run the whole swarm CA on this one host: generate the swarm
root when it is missing, and issue this hive's CA under it.
Defaults from `services.hyperhive.enableAllLocalDefaults`, the
all-on-one-box switch which is off, so this is off, and the
paragraph below still describes what a hive does by default.
Set it directly to run the CA on a host that is not otherwise
all-local.
**Off by default, deliberately.** A swarm's services and its
hives can live on different hosts, and this host has no way to
tell whether it is the one holding the root so the swarm CA