[development] Add claude code plugins

This commit is contained in:
2025-11-22 09:32:54 -08:00
parent 977125645b
commit 9059a739a0
3 changed files with 31 additions and 1 deletions

View File

@@ -222,6 +222,7 @@ in
home.roles = { home.roles = {
base.enable = true; base.enable = true;
development.enable = true;
}; };
imports = [ imports = [

View File

@@ -32,5 +32,4 @@
./modules/plasma-manager ./modules/plasma-manager
./modules/tmux ./modules/tmux
]; ];
} }

View File

@@ -4,6 +4,16 @@ with lib;
let let
cfg = config.home.roles.development; 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 in
{ {
options.home.roles.development = { options.home.roles.development = {
@@ -21,6 +31,26 @@ in
programs.kubectl-secure.enable = true; 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 # Note: modules must be imported at top-level home config
}; };
} }