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:
parent
049ae47191
commit
453ee9c44c
1 changed files with 25 additions and 27 deletions
|
|
@ -752,22 +752,31 @@ in
|
|||
fi
|
||||
'';
|
||||
|
||||
# Auto-inject the matrix MCP entry when matrix is enabled.
|
||||
# Operator can override or disable by setting their own
|
||||
# `extraMcpServers.matrix` (nix submodule merge takes the operator's
|
||||
# value) or by flipping `hyperhive.matrix.enable = false`.
|
||||
hyperhive.extraMcpServers = lib.mkIf config.hyperhive.matrix.enable {
|
||||
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 = [ "*" ];
|
||||
};
|
||||
};
|
||||
# Auto-inject built-in MCP servers. bash is always present; matrix is
|
||||
# conditional on hyperhive.matrix.enable. Both use lib.mkDefault so
|
||||
# the operator's own agent.nix can override individual entries.
|
||||
hyperhive.extraMcpServers = lib.mkMerge [
|
||||
{
|
||||
bash = lib.mkDefault {
|
||||
command = "${pkgs.hyperhive}/bin/hive-bash-mcp";
|
||||
args = [ ];
|
||||
env.HIVE_BASH_SOCKET = "/run/hive-bash/socket";
|
||||
allowedTools = [ "*" ];
|
||||
};
|
||||
}
|
||||
(lib.mkIf config.hyperhive.matrix.enable {
|
||||
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;
|
||||
|
||||
|
|
@ -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
|
||||
# provisions it after agent containers come up). Without this
|
||||
# the daemon would exit 0 silently on first boot and the MCP
|
||||
|
|
|
|||
Loading…
Reference in a new issue