feat: installed mcp servers for vitest and eslint

This commit is contained in:
Leyla Becker 2025-09-12 00:41:17 -05:00
parent 2745af9443
commit ca9f54d795
2 changed files with 41 additions and 6 deletions

View file

@ -72,6 +72,8 @@ in {
enable = true; enable = true;
mcp = { mcp = {
nixos.enable = true; nixos.enable = true;
eslint.enable = true;
vitest.enable = true;
}; };
}; };

View file

@ -15,6 +15,20 @@
profile.extraExtensions.claudeDev.enable profile.extraExtensions.claudeDev.enable
&& profile.extraExtensions.claudeDev.mcp.nixos.enable && profile.extraExtensions.claudeDev.mcp.nixos.enable
) (lib.attrValues config.programs.vscode.profiles); ) (lib.attrValues config.programs.vscode.profiles);
anyProfileHasMcpEslint = lib.any (
profile:
profile.extraExtensions.claudeDev.enable
&& profile.extraExtensions.claudeDev.mcp.eslint.enable
) (lib.attrValues config.programs.vscode.profiles);
anyProfileHasMcpVitest = lib.any (
profile:
profile.extraExtensions.claudeDev.enable
&& profile.extraExtensions.claudeDev.mcp.vitest.enable
) (lib.attrValues config.programs.vscode.profiles);
anyProfileHasMcp = anyProfileHasMcpNixos || anyProfileHasMcpEslint || anyProfileHasMcpVitest;
in { in {
options.programs.vscode.profiles = lib.mkOption { options.programs.vscode.profiles = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule ({config, ...}: { type = lib.types.attrsOf (lib.types.submodule ({config, ...}: {
@ -29,6 +43,12 @@ in {
nixos = { nixos = {
enable = lib.mkEnableOption "enable NixOS MCP server for Claude Dev"; enable = lib.mkEnableOption "enable NixOS MCP server for Claude Dev";
}; };
eslint = {
enable = lib.mkEnableOption "enable ESLint MCP server for Claude Dev";
};
vitest = {
enable = lib.mkEnableOption "enable Vitest MCP server for Claude Dev";
};
}; };
}; };
}; };
@ -47,14 +67,27 @@ in {
]; ];
}) })
(lib.mkIf anyProfileHasMcpNixos { (lib.mkIf anyProfileHasMcp {
home.file."${config.xdg.configHome}/VSCodium/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json" = { home.file."${config.xdg.configHome}/VSCodium/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json" = {
text = builtins.toJSON { text = builtins.toJSON {
mcpServers = { mcpServers =
nixos = { (lib.optionalAttrs anyProfileHasMcpNixos {
command = "${mcp-nixos}/bin/mcp-nixos"; nixos = {
}; command = "${mcp-nixos}/bin/mcp-nixos";
}; };
})
// (lib.optionalAttrs anyProfileHasMcpEslint {
eslint = {
command = "${pkgs.nodejs}/bin/npx";
args = ["-y" "@eslint/mcp@latest"];
};
})
// (lib.optionalAttrs anyProfileHasMcpVitest {
vitest = {
command = "${pkgs.nodejs}/bin/npx";
args = ["-y" "@djankies/vitest-mcp"];
};
});
}; };
force = true; force = true;
}; };