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