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

@ -132,6 +132,32 @@ in
'';
};
# The one switch for "everything runs on this box". Every autoconf
# toggle in the tree defaults from it, so an all-local deployment is a
# single line rather than one line per service that grew a toggle.
options.services.hyperhive.enableAllLocalDefaults = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = ''
Run the whole swarm on this host: the swarm-wide services
(`services.hyperhive.swarm.enableRequiredServices`) and the swarm
CA (`services.hyperhive.swarm.ca.autoConfigure`) all default from
this, and anything autoconfigurable added later should too.
**Off by default, and that is the load-bearing part.** A swarm's
services and its hives can live on different hosts, and a host has
no way to tell which ones it is meant to be so this is an
operator saying "this is that box", never something inferred.
Turn it on for a dev box or a single-hive swarm and get a working
deployment with no further configuration; leave it off and every
swarm-level artifact is operator-provided.
Each derived toggle can still be set explicitly to override this
one, so "all local except X" needs no new option.
'';
};
# Whether this hive runs "ruthless" — with no root/manager agent at
# all. Some hives don't want a root agent — see issue tracker
# "scope concept: special agents".