mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-02 19:49:18 +00:00
Export resolveEnabled from lib.hm.mcp and use it in antigravity-cli. Add test cases for direct disabled and enabled declarations.
94 lines
3.2 KiB
Nix
94 lines
3.2 KiB
Nix
{ pkgs, ... }:
|
|
|
|
{
|
|
programs = {
|
|
antigravity-cli = {
|
|
enable = true;
|
|
package = pkgs.writeShellScriptBin "antigravity-cli" "";
|
|
enableMcpIntegration = true;
|
|
settings = {
|
|
colorScheme = "terminal";
|
|
toolPermission = "request-review";
|
|
};
|
|
mcpServers = {
|
|
github = {
|
|
url = "https://api.githubcopilot.com/mcp/";
|
|
};
|
|
filesystem = {
|
|
command = "npx";
|
|
args = [
|
|
"-y"
|
|
"@modelcontextprotocol/server-filesystem"
|
|
"/tmp"
|
|
];
|
|
};
|
|
explicit-disabled = {
|
|
command = "disabled-direct-cmd";
|
|
disabled = true;
|
|
};
|
|
explicit-enabled = {
|
|
command = "enabled-direct-cmd";
|
|
enabled = true;
|
|
};
|
|
};
|
|
};
|
|
mcp = {
|
|
enable = true;
|
|
servers = {
|
|
filesystem = {
|
|
command = "npx";
|
|
args = [
|
|
"-y"
|
|
"@modelcontextprotocol/server-filesystem"
|
|
"/other-tmp"
|
|
];
|
|
};
|
|
database = {
|
|
command = "npx";
|
|
args = [
|
|
"-y"
|
|
"@bytebase/dbhub"
|
|
"--dsn"
|
|
"postgresql://user:pass@localhost:5432/db"
|
|
];
|
|
env = {
|
|
DATABASE_URL = "postgresql://user:pass@localhost:5432/db";
|
|
url = "https://token.example/env";
|
|
};
|
|
};
|
|
remote-server = {
|
|
url = "https://remote.example/mcp";
|
|
headers = {
|
|
"Authorization" = "Bearer token";
|
|
};
|
|
};
|
|
disabled-server = {
|
|
command = "disabled-cmd";
|
|
enabled = false;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
nmt.script = ''
|
|
assertFileExists home-files/.gemini/config/mcp_config.json
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"github"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"serverUrl"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"url"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json 'https://token.example/env'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"filesystem"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"database"'
|
|
assertFileNotRegex home-files/.gemini/config/mcp_config.json '"other-tmp"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"remote-server"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"serverUrl": "https://remote.example/mcp"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"type": "http"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"disabled-server"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"explicit-disabled"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"explicit-enabled"'
|
|
assertFileRegex home-files/.gemini/config/mcp_config.json '"disabled": true'
|
|
assertFileNotRegex home-files/.gemini/config/mcp_config.json '"enabled": false'
|
|
assertFileNotRegex home-files/.gemini/config/mcp_config.json '"enabled": true'
|
|
assertFileNotRegex home-files/.gemini/config/mcp_config.json '"command": null'
|
|
assertFileNotRegex home-files/.gemini/config/mcp_config.json '"env": {}'
|
|
'';
|
|
}
|