This repository has no description
1.2 kB
38 lines
1{ self, ... }:
2{
3 perSystem =
4 { pkgs, system, ... }:
5 let
6 # Get paths to MCP servers
7 gitMcpPath = "${self.packages.${system}.git-mcp}/bin/git-mcp";
8 tmuxMcpPath = "${self.packages.${system}.tmux-mcp}/bin/tmux-mcp";
9
10 # Path to CLAUDE.md
11 claudeMd = ./CLAUDE.md;
12 in
13 {
14 packages.claude = self.libWithPkgs.${system}.makeWrapper (self.lib.halalify pkgs.claude-code) {
15 wrapper =
16 { exePath, ... }:
17 ''
18 set -efu
19 set -x
20 # Configure MCP servers using Claude CLI
21 if ${exePath} mcp add git-mcp "${gitMcpPath}" 2>/dev/null && \
22 ${exePath} mcp add tmux-mcp "${tmuxMcpPath}" 2>/dev/null; then
23 echo "MCP servers configured successfully" >&2
24 else
25 echo "Warning: Could not configure MCP servers" >&2
26 fi
27
28 # Set up CLAUDE.md if it doesn't exist
29 CLAUDE_MD_DIR="''${CLAUDE_MD_DIR:-$HOME/.claude}"
30 mkdir -p "$CLAUDE_MD_DIR"
31 if [[ ! -f "$CLAUDE_MD_DIR/CLAUDE.md" ]]; then
32 cp ${claudeMd} "$CLAUDE_MD_DIR/CLAUDE.md"
33 fi
34 exec ${exePath} "$@"
35 '';
36 };
37 };
38}