This repository has no description
4.2 kB
151 lines
1{ self, inputs, ... }:
2{
3 perSystem =
4 { pkgs, system, ... }:
5 let
6 claude = inputs.wrappers.lib.wrapModule {
7 imports = [ self.wrapperModules.claude-code ];
8 inherit pkgs;
9
10 package = self.lib.halalify self.legacyPackages.${system}.llm.claude-code;
11
12 claudeMd = ./CLAUDE.md;
13
14 mcpServers = {
15 git-mcp = {
16 command = "${self.packages.${system}.git-mcp}/bin/git-mcp";
17 };
18 };
19
20 skills = {
21 hedgedoc = "${self.legacyPackages.${system}.skills.hedgedoc}/share/hedgedoc";
22 reverse-engineering = "${
23 self.legacyPackages.${system}.skills.reverse-engineering
24 }/share/reverse-engineering";
25 tmux = "${self.legacyPackages.${system}.skills.tmux}/share/tmux";
26 websearch = "${self.legacyPackages.${system}.skills.websearch}/share/websearch";
27 };
28
29 permissions = {
30 defaultMode = "auto";
31 allow = [
32 # nix operations
33 "Bash(nix build:*)"
34 "Bash(nix eval:*)"
35 "Bash(nix fmt:*)"
36 "Bash(nix flake:*)"
37 "Bash(nix develop:*)"
38 "Bash(nix run:*)"
39 "Bash(nix search:*)"
40 "Bash(nix log:*)"
41 "Bash(nix path-info:*)"
42 "Bash(nix store:*)"
43 "Bash(nix derivation:*)"
44 "Bash(nix hash:*)"
45 "Bash(nix-build:*)"
46 "Bash(nix-instantiate:*)"
47 "Bash(nix-locate:*)"
48 "Bash(nix-prefetch-url:*)"
49 "Bash(nixos-rebuild:*)"
50 "Bash(darwin-rebuild:*)"
51 # clan
52 "Bash(clan:*)"
53 # git read operations
54 "Bash(git status:*)"
55 "Bash(git diff:*)"
56 "Bash(git log:*)"
57 "Bash(git show:*)"
58 "Bash(git branch:*)"
59 "Bash(git remote:*)"
60 "Bash(git stash list:*)"
61 "Bash(git rev-parse:*)"
62 "Bash(git describe:*)"
63 "Bash(git tag:*)"
64 "Bash(git ls-files:*)"
65 "Bash(git ls-remote:*)"
66 # git write operations
67 "Bash(git add:*)"
68 "Bash(git commit:*)"
69 "Bash(git checkout:*)"
70 "Bash(git switch:*)"
71 "Bash(git merge:*)"
72 "Bash(git rebase:*)"
73 "Bash(git stash:*)"
74 "Bash(git cherry-pick:*)"
75 "Bash(git fetch:*)"
76 "Bash(git pull:*)"
77 # common read-only tools
78 "Bash(cat:*)"
79 "Bash(ls:*)"
80 "Bash(find:*)"
81 "Bash(grep:*)"
82 "Bash(rg:*)"
83 "Bash(fd:*)"
84 "Bash(head:*)"
85 "Bash(tail:*)"
86 "Bash(wc:*)"
87 "Bash(sort:*)"
88 "Bash(uniq:*)"
89 "Bash(jq:*)"
90 "Bash(tree:*)"
91 "Bash(file:*)"
92 "Bash(which:*)"
93 "Bash(realpath:*)"
94 "Bash(readlink:*)"
95 "Bash(dirname:*)"
96 "Bash(basename:*)"
97 "Bash(stat:*)"
98 "Bash(du:*)"
99 "Bash(df:*)"
100 "Bash(env:*)"
101 "Bash(echo:*)"
102 "Bash(printf:*)"
103 "Bash(test:*)"
104 "Bash(tr:*)"
105 "Bash(sed:*)"
106 "Bash(awk:*)"
107 "Bash(cut:*)"
108 "Bash(diff:*)"
109 "Bash(tee:*)"
110 "Bash(xargs:*)"
111 "Bash(mkdir:*)"
112 "Bash(cp:*)"
113 "Bash(mv:*)"
114 "Bash(touch:*)"
115 "Bash(chmod:*)"
116 "Bash(ln:*)"
117 # dev tools
118 "Bash(gh:*)"
119 "Bash(shellcheck:*)"
120 "Bash(ruff:*)"
121 "Bash(kagi-search:*)"
122 "Bash(curl:*)"
123 "Bash(tmux:*)"
124 # file edits
125 "Edit"
126 "Write"
127 "Read"
128 ];
129 };
130
131 extraPackages = [
132 self.packages.${system}.kagi-search
133 pkgs.curl
134 pkgs.jq
135 pkgs.python3
136 pkgs.ripgrep
137 pkgs.fd
138 pkgs.tmux
139 pkgs.tree
140 ];
141
142 settings = {
143 # Prefer compact output for better context usage
144 verbose = true;
145 };
146 };
147 in
148 {
149 packages.claude = claude.wrapper;
150 };
151}