inject HYPERHIVE_STATE_DIR into container env + extra MCP server envs

This commit is contained in:
damocles 2026-05-20 12:46:41 +02:00
parent 9cbb05bb86
commit f21ae1ff98
2 changed files with 19 additions and 1 deletions

View file

@ -273,11 +273,22 @@ fn render_flake(
name = name;
email = "${name}@hyperhive";
};
# Container-wide env: every service + co-process daemon can
# resolve the agent's durable state dir without hard-coding it.
environment.variables = {
HIVE_LABEL = name;
HYPERHIVE_STATE_DIR =
if isManager then "/state"
else "/agents/${name}/state";
};
systemd.services.${service}.environment = {
HIVE_PORT = toString port;
HIVE_LABEL = name;
HIVE_DASHBOARD_PORT = toString dashboardPort;
HIVE_OPERATOR_PRONOUNS = operatorPronouns;
HYPERHIVE_STATE_DIR =
if isManager then "/state"
else "/agents/${name}/state";
};
}
];