isolation: forward HIVE_MATRIX_URL so matrix daemon reaches the gateway

This commit is contained in:
damocles 2026-06-15 21:38:34 +02:00
commit d15ecff6d2
3 changed files with 32 additions and 1 deletions

View file

@ -1327,10 +1327,20 @@ in
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
environment = {
HIVE_MATRIX_URL = config.hyperhive.matrix.url;
HIVE_MATRIX_SOCKET = "/run/hive-matrix/socket";
RUST_LOG = "info";
}
# Homeserver URL: by default the daemon inherits the host-forwarded
# HIVE_MATRIX_URL (set isolation-aware by hive-c0re: `matrix.<domain>`
# via the gateway under private-netns isolation, loopback otherwise),
# falling back to the daemon's built-in localhost default if the
# forward is absent. A per-agent `hyperhive.matrix.url` override
# (non-default) is set unit-level so it wins over the forwarded value;
# at the default we deliberately DON'T set it so the forwarded
# isolation-aware value isn't shadowed.
// lib.optionalAttrs (config.hyperhive.matrix.url != "http://localhost:8008") {
HIVE_MATRIX_URL = config.hyperhive.matrix.url;
}
# Multi-account: serialize the *extra* accounts to the JSON the
# daemon parses (`accounts::configured`). Only set when extras are
# declared; the daemon always synthesizes the primary `main`