-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Added: Extras to Claude Code to bring it to par with claude-code-nix-flake #7711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
a3912b7
to
0a1f01b
Compare
modules/programs/claude-code.nix
Outdated
agentsDir = lib.mkOption { | ||
type = lib.types.nullOr lib.types.path; | ||
default = null; | ||
description = '' | ||
Path to a directory containing agent files for Claude Code. | ||
Agent files from this directory will be symlinked to .claude/agents/. | ||
''; | ||
example = lib.literalExpression ./agents; | ||
}; | ||
|
||
commandsDir = lib.mkOption { | ||
type = lib.types.nullOr lib.types.path; | ||
default = null; | ||
description = '' | ||
Path to a directory containing command files for Claude Code. | ||
Command files from this directory will be symlinked to .claude/commands/. | ||
''; | ||
example = lib.literalExpression ./commands; | ||
}; | ||
|
||
hooksDir = lib.mkOption { | ||
type = lib.types.nullOr lib.types.path; | ||
default = null; | ||
description = '' | ||
Path to a directory containing hook files for Claude Code. | ||
Hook files from this directory will be symlinked to .claude/hooks/. | ||
''; | ||
example = lib.literalExpression ./hooks; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These dir options remind me that I had the intention of refactoring sourceFileOrLines
option so I could just change the type of the corresponding options. I have a branch for it, but just haven't gotten to it, yet. Because, I'd rather have the option support either a directory, an attrset of files, or attrset of lines, etc
2a24d34
to
12b8f77
Compare
Do you think linking the fields to their relevant options in https://docs.anthropic.com/en/docs/claude-code would be helpful? |
In any case, just tried on own fully featured config, seems to work fine thus far 👌 |
Anything I can do to help in merging this into home-manager? |
Sorry, just really busy with work lately... has slowed down my ability to do as much open source atm. I have a branch that I'm working through reworking the type for an option to support lines, paths, or directories. I just didn't want to introduce new options that would get deprecated right away. |
Don't worry, I feel you- I know what it's like. My commit graph is about the same as yours- so it's always really an endless, neverending laundry list. I alone got like 3 years worth of projects in the pipeline, ahahaha. Take your time! I asked just in case there was a separate, unrelated blocker. I'm perfectly fine just merging maim every once in a while to update for the time being. |
Description
This brings the new
claude-code
home-manager settings on par in functionality with claude-code-nix-flake.Originally
claude-code-nix-flake
was built in mind with upstreaming tohome-manager
; it's just that I've waited tillclaude-code
worked with symlinks, since that was broken for a long time. Now, this can be upstreamed.In this case, I've merged the additional settings from the above flake of mine into upstream claude-code.
PS. This is easier to review commit by commit,
Checklist
Change is backwards compatible.
Code formatted with
nix fmt
ornix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt
.Code tested through
nix run .#tests -- test-all
ornix-shell --pure tests -A run.all
.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
If this PR adds an exciting new feature or contains a breaking change.
CC. @khaneliman
What do you think we should do with
claude.json
? It does have some tunable options a person may want to touch such as:Which a user may want to touch.
(Also
mcpServers
, but we found a way around this one by wrapping the CLI).Problem is, claude-code mutates this file, so we can't really symlink it into read-only nix store.
In claude-code-nix-flake; I would merge settings into the existing file; just like I did with others until claude code fixed symlinks. However, I'm not sure how acceptable that is by upstream home-manager standards.