Skip to content

Commit 145a04d

Browse files
committed
add claude code
1 parent 9074ae9 commit 145a04d

9 files changed

Lines changed: 139 additions & 81 deletions

File tree

flake.lock

Lines changed: 66 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@
114114
flake = false;
115115
};
116116

117+
go-grip = {
118+
url = "github:chrishrb/go-grip";
119+
};
120+
117121
# glide
118122
glide = {
119123
url = "github:glide-browser/glide.nix";

modules/common/applications/agenix.nix

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
github = {
1111
file = ../../../secrets/github.age;
1212
};
13-
gemini = {
14-
file = ../../../secrets/gemini.age;
13+
claude = {
14+
file = ../../../secrets/claude.age;
1515
};
1616
context7 = {
1717
file = ../../../secrets/context7.age;
@@ -26,8 +26,11 @@
2626
secretsMountPoint = "${config.homePath}/.local/share/agenix/agenix.d";
2727
};
2828

29+
# unset __HM_SESS_VARS_SOURCED && source ~/.zshenv
2930
home.sessionVariables = {
30-
GEMINI_API_KEY = "$(cat ${config.home-manager.users.${config.user}.age.secrets.gemini.path})";
31+
CLAUDE_CODE_OAUTH_TOKEN = "$(cat ${
32+
config.home-manager.users.${config.user}.age.secrets.claude.path
33+
})";
3134
};
3235
};
3336
};

modules/common/nvim/lua/chrishrb/plugins/config/codecompanion/init.lua

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
local codecompanion = require("codecompanion")
2-
local icons = require("chrishrb.config.icons")
32

43
require("dressing").setup({
54
input = {
@@ -11,6 +10,18 @@ require("dressing").setup({
1110
})
1211

1312
codecompanion.setup({
13+
adapters = {
14+
http = {
15+
opts = {
16+
show_presets = false,
17+
show_model_choices = true,
18+
},
19+
copilot = "copilot",
20+
},
21+
acp = {
22+
claude_code = "claude_code",
23+
},
24+
},
1425
prompt_library = {
1526
markdown = {
1627
dirs = {
@@ -27,6 +38,12 @@ codecompanion.setup({
2738
},
2839
history = {
2940
enabled = true,
41+
opts = {
42+
title_generation_opts = {
43+
adapter = "copilot",
44+
model = "gpt-4.1",
45+
},
46+
},
3047
},
3148
},
3249
display = {
@@ -90,15 +107,6 @@ codecompanion.setup({
90107
},
91108
},
92109
opts = {
93-
adapters = {
94-
http = {
95-
opts = {
96-
show_presets = false,
97-
show_model_choices = true,
98-
},
99-
copilot = "copilot",
100-
},
101-
},
102110
log_level = "ERROR",
103111
send_code = true,
104112
system_prompt = require("chrishrb.plugins.config.codecompanion.system_prompt"),

modules/common/shell/utilities.nix

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,40 @@ in
1616
config = {
1717

1818
home-manager.users.${config.user} = {
19-
home.packages = with pkgs; [
20-
age # Encryption
21-
bc # Calculator
22-
dig # DNS lookup
23-
fd # find
24-
htop # Show system processes
25-
killall # Force quit
26-
inetutils # Includes telnet, whois
27-
jq # JSON manipulation
28-
rsync # Copy folders
29-
ripgrep # grep
30-
tree # View directory hierarchy
31-
unzip # Extract zips
32-
ghostscript # edit pdfs
33-
qpdf # split pdfs
34-
ffmpeg
35-
imagemagick # edit images
36-
plantuml # UML diagrams
37-
s3cmd # client for getting data from an s3 bucket
38-
unixtools.watch # watch cmd
39-
go-task # task runner (similar to make)
40-
go-grip # preview md files
41-
mqttx-cli # mqtt client
42-
xh # httpie alternative
43-
klog-time-tracker # time tracking
44-
act # run github actions locally
45-
claude-code # claude ai
46-
postgresql # postgresql
47-
];
19+
home.packages =
20+
with pkgs;
21+
[
22+
age # Encryption
23+
bc # Calculator
24+
dig # DNS lookup
25+
fd # find
26+
htop # Show system processes
27+
killall # Force quit
28+
inetutils # Includes telnet, whois
29+
jq # JSON manipulation
30+
rsync # Copy folders
31+
ripgrep # grep
32+
tree # View directory hierarchy
33+
unzip # Extract zips
34+
ghostscript # edit pdfs
35+
qpdf # split pdfs
36+
ffmpeg
37+
imagemagick # edit images
38+
plantuml # UML diagrams
39+
s3cmd # client for getting data from an s3 bucket
40+
unixtools.watch # watch cmd
41+
go-task # task runner (similar to make)
42+
go-grip # preview md files
43+
mqttx-cli # mqtt client
44+
xh # httpie alternative
45+
klog-time-tracker # time tracking
46+
act # run github actions locally
47+
postgresql # postgresql
48+
]
49+
++ lib.optionals config.ai.enable [
50+
claude-code # claude ai
51+
claude-code-acp # claude code acp adapter needed for codecompanion
52+
];
4853

4954
home.file = {
5055
".rgignore".text = ignorePatterns;

0 commit comments

Comments
 (0)