Files
agent-skills/nix/home.nix
T
naps62 60f39cdcbb feat: track both entry files in the repo
~/.claude/CLAUDE.md was in no git repo despite heavy editing, and
~/.codex/AGENTS.md was a hand-synced duplicate of it. Both now live in
entry/ and import the shared fragments; RTK.md moves to claude-md/ so
Codex stops carrying its own copy.

Claude's imports are ~/-anchored so they resolve through the symlink.

Also drops kt from the comment rule scope.
2026-08-01 15:02:28 +00:00

36 lines
1.8 KiB
Nix

# Home-manager module: link centralized agent skills into Claude Code + Codex.
# Usage: add this flake as an input, then import this module in your home config.
#
# inputs.agent-skills.url = "git+https://git.naps.pt/yolo/agent-skills.git";
# # in home.nix imports: inputs.agent-skills.homeModules.default
#
# recursive=true links each FILE individually, so machine-local skills can still
# live alongside the managed ones in the same dir (a whole-dir symlink would not).
{ agent-skills }:
{ ... }:
{
home.file = {
".claude/skills" = { source = "${agent-skills}/skills"; recursive = true; };
".agents/skills" = { source = "${agent-skills}/skills"; recursive = true; };
".claude/commands" = { source = "${agent-skills}/commands"; recursive = true; };
".claude/hooks" = { source = "${agent-skills}/hooks"; recursive = true; };
# CLAUDE.md fragments land in ~/.claude root, pulled in by `@name.md` imports.
# Listed one by one: recursive on ~/.claude would fight every other tool
# writing there (settings.json, projects/, file-history/).
".claude/writing.md".source = "${agent-skills}/claude-md/writing.md";
".claude/operating.md".source = "${agent-skills}/claude-md/operating.md";
# Path-scoped: loads only when Claude reads a matching source file.
".claude/rules/code-comments.md".source = "${agent-skills}/claude-md/code-comments.md";
".claude/RTK.md".source = "${agent-skills}/claude-md/RTK.md";
# Entry files: machine-local sections + @imports of the fragments above.
".claude/CLAUDE.md".source = "${agent-skills}/entry/CLAUDE.md";
".codex/AGENTS.md".source = "${agent-skills}/entry/codex-AGENTS.md";
};
}
# Hook wiring lives in ~/.claude/settings.json, which this module does not own.
# See hooks/README.md for the snippet.