Something went wrong. Try again.
🤖 ai coding agent configs (pi, opencode, claude-code)
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104{ ... }: { den.aspects.agents.claude-code.homeManager = { config, lib, pkgs, inputs', self', ... }: let agentsDir = "${config.home.homeDirectory}/shinyflakes/modules/aspects/agents"; mkLink = config.lib.file.mkOutOfStoreSymlink;
# niri, zellij and busctl come from the session PATH so they match the # running compositor / multiplexer / bus. claudeNotify = pkgs.writeShellApplication { name = "claude-notify"; runtimeInputs = with pkgs; [ coreutils gnused jq libnotify ]; text = '' CLAUDE_NOTIFY_ICON=${./icons/claude.png} '' + builtins.readFile ./claude-notify.sh; };
# Resurrection + "! " tab cue; zellij comes from PATH to match the running server. claudeZellij = pkgs.writeShellApplication { name = "claude-zellij"; runtimeInputs = [ pkgs.jq ]; text = builtins.readFile ./claude-zellij.sh; };
hook = pkg: extra: [ { hooks = [ ( { type = "command"; command = lib.getExe pkg; } // extra ) ]; } ];
zellijHook = hook claudeZellij { async = true; };
# Hooks ship as a personal plugin instead of settings.json, so settings.json # stays mutable for imperative `claude plugin install`. hooksPlugin = pkgs.runCommand "claude-code-notify-plugin" { } '' install -Dm644 ${pkgs.writers.writeJSON "plugin.json" { name = "notify"; }} \ $out/.claude-plugin/plugin.json install -Dm644 ${ pkgs.writers.writeJSON "hooks.json" { hooks = { Stop = hook claudeNotify { async = true; } ++ zellijHook; StopFailure = hook claudeNotify { async = true; } ++ zellijHook; Notification = hook claudeNotify { async = true; }; # Blocks until a notification button is clicked or the session is # back on screen; `ask` gives up after 3500s. PermissionRequest = hook claudeNotify { timeout = 3600; } ++ zellijHook; SessionStart = hook claudeNotify { } ++ zellijHook; SessionEnd = hook claudeNotify { }; UserPromptSubmit = zellijHook; PostToolUse = zellijHook; PostToolUseFailure = zellijHook; }; } } $out/hooks/hooks.json ''; in { home.packages = [ pkgs.claude-code-router # nvim review tab for agent changes, driven by the nvim-review skill self'.packages.claude-review ];
# Shared skills live at ~/.agents/skills (read by OpenCode and others). # Claude Code doesn't read that path, so each skill is also linked into # ~/.claude/skills individually, leaving room for HM-managed plugins there. # Skill edits are live; adding a new skill needs a rebuild. home.file = { ".agents/skills".source = mkLink "${agentsDir}/skills"; } // lib.mapAttrs' ( name: _: lib.nameValuePair ".claude/skills/${name}" { source = mkLink "${agentsDir}/skills/${name}"; } ) (lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./skills));
programs.claude-code = { enable = true; package = inputs'.llm-agents.packages.claude-code; plugins.notify = hooksPlugin; }; };}