fix(nix): merge duplicate hyperhive.extraMcpServers assignments in harness-base

bash and matrix MCP entries were both assigned to the same attribute in the
same attrset literal, causing nix evaluation to fail with "attribute already
defined". Merged both into a single lib.mkMerge list under one assignment.
This commit is contained in:
atlas 2026-06-03 19:00:12 +02:00
commit 453ee9c44c

View file

@ -752,22 +752,31 @@ in
fi fi
''; '';
# Auto-inject the matrix MCP entry when matrix is enabled. # Auto-inject built-in MCP servers. bash is always present; matrix is
# Operator can override or disable by setting their own # conditional on hyperhive.matrix.enable. Both use lib.mkDefault so
# `extraMcpServers.matrix` (nix submodule merge takes the operator's # the operator's own agent.nix can override individual entries.
# value) or by flipping `hyperhive.matrix.enable = false`. hyperhive.extraMcpServers = lib.mkMerge [
hyperhive.extraMcpServers = lib.mkIf config.hyperhive.matrix.enable { {
matrix = lib.mkDefault { bash = lib.mkDefault {
command = "${pkgs.hyperhive}/bin/hive-matrix-mcp"; command = "${pkgs.hyperhive}/bin/hive-bash-mcp";
args = [ ]; args = [ ];
# Same socket path the hive-matrix-daemon service binds env.HIVE_BASH_SOCKET = "/run/hive-bash/socket";
# via its `RuntimeDirectory = "hive-matrix"`. Keeps the allowedTools = [ "*" ];
# bridge + daemon in sync without baking the path into };
# the Rust default — the env override wins for both. }
env.HIVE_MATRIX_SOCKET = "/run/hive-matrix/socket"; (lib.mkIf config.hyperhive.matrix.enable {
allowedTools = [ "*" ]; matrix = lib.mkDefault {
}; command = "${pkgs.hyperhive}/bin/hive-matrix-mcp";
}; args = [ ];
# Same socket path the hive-matrix-daemon service binds
# via its `RuntimeDirectory = "hive-matrix"`. Keeps the
# bridge + daemon in sync without baking the path into
# the Rust default — the env override wins for both.
env.HIVE_MATRIX_SOCKET = "/run/hive-matrix/socket";
allowedTools = [ "*" ];
};
})
];
environment.etc."hyperhive/extra-mcp.json".text = builtins.toJSON config.hyperhive.extraMcpServers; environment.etc."hyperhive/extra-mcp.json".text = builtins.toJSON config.hyperhive.extraMcpServers;
@ -1149,17 +1158,6 @@ in
}; };
}; };
# Inject the bash MCP bridge into every agent's extraMcpServers.
# The bridge connects to hive-bash-daemon on the same socket.
hyperhive.extraMcpServers = {
bash = lib.mkDefault {
command = "${pkgs.hyperhive}/bin/hive-bash-mcp";
args = [ ];
env.HIVE_BASH_SOCKET = "/run/hive-bash/socket";
allowedTools = [ "*" ];
};
};
# Re-fire the daemon when the matrix token appears (hive-c0re # Re-fire the daemon when the matrix token appears (hive-c0re
# provisions it after agent containers come up). Without this # provisions it after agent containers come up). Without this
# the daemon would exit 0 silently on first boot and the MCP # the daemon would exit 0 silently on first boot and the MCP