forked from jan-leila/nix-config
		
	installed the eslint mcp server
This commit is contained in:
		
							parent
							
								
									5a53a7bac4
								
							
						
					
					
						commit
						6e0650f73b
					
				
					 2 changed files with 49 additions and 16 deletions
				
			
		|  | @ -70,7 +70,10 @@ in { | |||
|             # claude development | ||||
|             claudeDev = lib.mkIf ai-tooling-enabled { | ||||
|               enable = true; | ||||
|               mcp.nixos.enable = true; | ||||
|               mcp = { | ||||
|                 nixos.enable = true; | ||||
|                 eslint.enable = true; | ||||
|               }; | ||||
|             }; | ||||
| 
 | ||||
|             # misc extensions | ||||
|  |  | |||
|  | @ -10,11 +10,21 @@ | |||
| 
 | ||||
|   mcp-nixos = inputs.mcp-nixos.packages.${pkgs.stdenv.hostPlatform.system}.default; | ||||
| 
 | ||||
|   mcp-eslint = pkgs.writeShellScriptBin "mcp-eslint" '' | ||||
|     ${pkgs.nodejs}/bin/npx --yes @modelcontextprotocol/server-eslint "$@" | ||||
|   ''; | ||||
| 
 | ||||
|   anyProfileHasMcpNixos = lib.any ( | ||||
|     profile: | ||||
|       profile.extraExtensions.claudeDev.enable | ||||
|       && profile.extraExtensions.claudeDev.mcp.nixos.enable | ||||
|   ) (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); | ||||
| in { | ||||
|   options.programs.vscode.profiles = lib.mkOption { | ||||
|     type = lib.types.attrsOf (lib.types.submodule ({config, ...}: { | ||||
|  | @ -29,6 +39,9 @@ in { | |||
|             nixos = { | ||||
|               enable = lib.mkEnableOption "enable NixOS MCP server for Claude Dev"; | ||||
|             }; | ||||
|             eslint = { | ||||
|               enable = lib.mkEnableOption "enable ESLint MCP server for Claude Dev"; | ||||
|             }; | ||||
|           }; | ||||
|         }; | ||||
|       }; | ||||
|  | @ -40,20 +53,37 @@ in { | |||
|     })); | ||||
|   }; | ||||
| 
 | ||||
|   config = lib.mkIf anyProfileHasMcpNixos { | ||||
|     home.file."${config.xdg.configHome}/VSCodium/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json" = { | ||||
|       text = builtins.toJSON { | ||||
|         mcpServers = { | ||||
|           nixos = { | ||||
|             command = "${mcp-nixos}/bin/mcp-nixos"; | ||||
|           }; | ||||
|         }; | ||||
|       }; | ||||
|       force = true; | ||||
|     }; | ||||
| 
 | ||||
|   config = lib.mkMerge [ | ||||
|     (lib.mkIf anyProfileHasMcpNixos { | ||||
|       home.packages = [ | ||||
|         mcp-nixos | ||||
|       ]; | ||||
|     }) | ||||
| 
 | ||||
|     (lib.mkIf anyProfileHasMcpEslint { | ||||
|       home.packages = [ | ||||
|         mcp-eslint | ||||
|         pkgs.eslint | ||||
|       ]; | ||||
|     }) | ||||
| 
 | ||||
|     (lib.mkIf (anyProfileHasMcpNixos || anyProfileHasMcpEslint) { | ||||
|       home.file."${config.xdg.configHome}/VSCodium/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json" = { | ||||
|         text = builtins.toJSON { | ||||
|           mcpServers = | ||||
|             (lib.optionalAttrs anyProfileHasMcpNixos { | ||||
|               nixos = { | ||||
|                 command = "${mcp-nixos}/bin/mcp-nixos"; | ||||
|               }; | ||||
|             }) | ||||
|             // (lib.optionalAttrs anyProfileHasMcpEslint { | ||||
|               eslint = { | ||||
|                 command = "${mcp-eslint}/bin/mcp-eslint"; | ||||
|               }; | ||||
|             }); | ||||
|         }; | ||||
|         force = true; | ||||
|       }; | ||||
|     }) | ||||
|   ]; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue