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 |             # claude development | ||||||
|             claudeDev = lib.mkIf ai-tooling-enabled { |             claudeDev = lib.mkIf ai-tooling-enabled { | ||||||
|               enable = true; |               enable = true; | ||||||
|               mcp.nixos.enable = true; |               mcp = { | ||||||
|  |                 nixos.enable = true; | ||||||
|  |                 eslint.enable = true; | ||||||
|  |               }; | ||||||
|             }; |             }; | ||||||
| 
 | 
 | ||||||
|             # misc extensions |             # misc extensions | ||||||
|  |  | ||||||
|  | @ -10,11 +10,21 @@ | ||||||
| 
 | 
 | ||||||
|   mcp-nixos = inputs.mcp-nixos.packages.${pkgs.stdenv.hostPlatform.system}.default; |   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 ( |   anyProfileHasMcpNixos = lib.any ( | ||||||
|     profile: |     profile: | ||||||
|       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); | ||||||
| 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 +39,9 @@ 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"; | ||||||
|  |             }; | ||||||
|           }; |           }; | ||||||
|         }; |         }; | ||||||
|       }; |       }; | ||||||
|  | @ -40,20 +53,37 @@ in { | ||||||
|     })); |     })); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   config = lib.mkIf anyProfileHasMcpNixos { |   config = lib.mkMerge [ | ||||||
|     home.file."${config.xdg.configHome}/VSCodium/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json" = { |     (lib.mkIf anyProfileHasMcpNixos { | ||||||
|       text = builtins.toJSON { |  | ||||||
|         mcpServers = { |  | ||||||
|           nixos = { |  | ||||||
|             command = "${mcp-nixos}/bin/mcp-nixos"; |  | ||||||
|           }; |  | ||||||
|         }; |  | ||||||
|       }; |  | ||||||
|       force = true; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|       home.packages = [ |       home.packages = [ | ||||||
|         mcp-nixos |         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