feat(#2006): add services.hyperhive.manageRootAgent to opt out of root-agent auto-management

This commit is contained in:
damocles 2026-06-26 22:23:28 +02:00 committed by mara
commit 4fa17de387
2 changed files with 50 additions and 5 deletions

View file

@ -187,6 +187,25 @@ in
'';
};
# Whether hive-c0re auto-manages the root/manager agent on startup
# (create it if missing, restart it if present-but-stopped). Some hives
# don't want a root agent auto-managed at all — see issue tracker
# "scope concept: special agents".
options.services.hyperhive.manageRootAgent = lib.mkOption {
type = lib.types.bool;
default = true;
example = false;
description = ''
Whether hive-c0re auto-manages the root (manager) agent on
startup: creating its container when missing and restarting it
when it's present but stopped. Defaults to `true` (the historical
behaviour the root agent was treated as required infrastructure).
Set to `false` on hives that don't want a root agent at all;
hive-c0re then skips the root-agent create/start sweep entirely.
Exposed to hive-c0re as `HYPERHIVE_MANAGE_ROOT_AGENT`.
'';
};
# Hive-wide OTEL stats export. Set ONCE here at host level; the
# meta-flake renderer (`hive-c0re/src/meta.rs::otel_config`) reads the
# HYPERHIVE_OTEL_* env exported below off hive-c0re's unit and injects
@ -873,6 +892,10 @@ in
# prompts). `hive_sh4re::assets::*` reads paths underneath.
# `forge.rs` reads the avatar PNGs from here on startup.
HIVE_ASSETS_DIR = "${cfg.assets}/share/hyperhive";
# Whether hive-c0re auto-manages the root/manager agent on
# startup (`auto_update::ensure_root_agent`). Default true =
# historical behaviour; false makes the root-agent sweep a no-op.
HYPERHIVE_MANAGE_ROOT_AGENT = lib.boolToString config.services.hyperhive.manageRootAgent;
}
// lib.optionalAttrs (config.services.hyperhive.domain != null) {
# Identity env vars threaded into c0re's own service env and