From 6ea43c1151fb84cd76d1fa5727e2b50670c3c322 Mon Sep 17 00:00:00 2001 From: atlas Date: Wed, 5 Aug 2026 17:58:31 +0200 Subject: [PATCH] feat(nix): matrix follows the swarm's shared-services toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Matrix is a swarm-wide service — one homeserver, not one per hive — so its `enable` defaults from `swarm.enableRequiredServices` rather than being flipped on its own. That toggle is off by default, so matrix is off by default exactly as before; what changes is that a host declaring "the swarm's services live here" gets the homeserver with it. The forge needs no equivalent: it is mandatory and deploys with hyperhive itself, so it has no enable to derive. --- nix/host-modules/hive-matrix.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/nix/host-modules/hive-matrix.nix b/nix/host-modules/hive-matrix.nix index 35c2bbdb..f737c9fb 100644 --- a/nix/host-modules/hive-matrix.nix +++ b/nix/host-modules/hive-matrix.nix @@ -99,12 +99,19 @@ in options.services.hyperhive.swarm.matrix = { enable = lib.mkOption { type = lib.types.bool; - default = false; + default = config.services.hyperhive.swarm.enableRequiredServices; + defaultText = lib.literalExpression "services.hyperhive.swarm.enableRequiredServices"; description = '' Run hive-matrix — a private matrix-tuwunel homeserver (in a - nixos-container) for hyperhive agents. Off by default while - the integration phases in; flip to `true` once the operator - has set `services.hyperhive.domain` and is ready to onboard agents. + nixos-container) for hyperhive agents. + + Matrix is a swarm-wide service — one homeserver, not one per + hive — so this defaults from + `services.hyperhive.swarm.enableRequiredServices`, which says + the swarm's shared services live on this host. That is off by + default, so this is off by default, as before. Set it directly + to run the homeserver somewhere other than the host that holds + the rest of the swarm's services. ''; };