[development] Add claude code plugins
This commit is contained in:
@@ -222,6 +222,7 @@ in
|
||||
|
||||
home.roles = {
|
||||
base.enable = true;
|
||||
development.enable = true;
|
||||
};
|
||||
|
||||
imports = [
|
||||
|
||||
@@ -32,5 +32,4 @@
|
||||
./modules/plasma-manager
|
||||
./modules/tmux
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,16 @@ with lib;
|
||||
|
||||
let
|
||||
cfg = config.home.roles.development;
|
||||
|
||||
# Fetch the claude-plugins repository
|
||||
# Update the rev to get newer versions of the commands
|
||||
claudePluginsRepo = builtins.fetchGit {
|
||||
url = "https://github.com/jeffh/claude-plugins.git";
|
||||
# To update: change this to the latest commit hash
|
||||
# You can find the latest commit at: https://github.com/jeffh/claude-plugins/commits/main
|
||||
rev = "5e3e4d937162185b6d78c62022cbfd1c8ad42c4c";
|
||||
ref = "main";
|
||||
};
|
||||
in
|
||||
{
|
||||
options.home.roles.development = {
|
||||
@@ -21,6 +31,26 @@ in
|
||||
|
||||
programs.kubectl-secure.enable = true;
|
||||
|
||||
# Install Claude Code humanlayer command plugins
|
||||
home.activation.claudeCodeCommands = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
# Clean up old plugin-installed commands to avoid duplicates
|
||||
rm -f ~/.claude/commands/humanlayer:* 2>/dev/null || true
|
||||
|
||||
# Create commands directory if it doesn't exist
|
||||
mkdir -p ~/.claude/commands
|
||||
|
||||
# Copy all humanlayer command files
|
||||
for file in ${claudePluginsRepo}/humanlayer/commands/*.md; do
|
||||
if [ -f "$file" ]; then
|
||||
filename=$(basename "$file" .md)
|
||||
# Create symlink with the namespace prefix
|
||||
ln -sf "$file" ~/.claude/commands/humanlayer:''${filename}.md
|
||||
fi
|
||||
done
|
||||
|
||||
$DRY_RUN_CMD echo "Claude Code humanlayer commands installed successfully"
|
||||
'';
|
||||
|
||||
# Note: modules must be imported at top-level home config
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user