feat(peon-ping): add peon-ping package and home-manager module#49
feat(peon-ping): add peon-ping package and home-manager module#49jonpulsifer merged 1 commit intomainfrom
Conversation
Vendor peon-ping v2.8.1 package and an adapted home-manager module (from nix-community/home-manager#8750) so it can be used before the upstream PRs are merged. Package (pkgs/peon-ping.nix): - Cross-platform support (macOS + Linux) — libnotify conditional on Linux - Installs adapters, scripts, and skills alongside the main peon.sh - Shell completions for bash and fish Module (home/modules/peon-ping.nix): - programs.peon-ping.enable installs package and sound packs - Copies packs as real files (not symlinks) to avoid peon's realpath path-traversal check rejecting nix store paths - Symlinks peon.sh and adapters/ into hooks dir for IDE detection - enableClaudeCodeIntegration merges hooks into settings.json - enableGeminiIntegration merges adapter hooks into ~/.gemini/settings.json - Seeds mutable default config on first activation Also fixes pre-existing syntax error in gcloud.nix (stray 'w' prefix). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jonathan Pulsifer <jonathan@moonpay.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on March 12
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| ${pkgs.jq}/bin/jq --argjson peon "$PEON_HOOKS" ' | ||
| .hooks as $existing | | ||
| reduce ($peon | keys[]) as $event (.; .hooks[$event] = (($existing[$event] // []) + $peon[$event])) | ||
| ' "$CLAUDE_SETTINGS" > "$CLAUDE_SETTINGS.tmp" && mv "$CLAUDE_SETTINGS.tmp" "$CLAUDE_SETTINGS" |
There was a problem hiding this comment.
Claude Code hooks duplicate on every activation
High Severity
The claudeCodePeonPingHooks activation script appends peon-ping hooks to .hooks[$event] on every run without checking whether they already exist. Each home-manager switch will add another duplicate copy of every peon-ping hook entry, causing the settings.json hooks arrays to grow unboundedly. The jq reduce expression concatenates $existing[$event] (which already includes peon hooks from prior runs) with $peon[$event] again.
| home.activation.geminiPeonPingHooks = lib.mkIf cfg.enableGeminiIntegration ( | ||
| lib.hm.dag.entryAfter [ "writeBoundary" ] '' | ||
| GEMINI_SETTINGS="''${GEMINI_CONFIG_DIR:-$HOME/.gemini}/settings.json" | ||
| ADAPTER="$HOME/.claude/hooks/peon-ping/adapters/gemini.sh" |
There was a problem hiding this comment.
Gemini adapter path ignores CLAUDE_CONFIG_DIR variable
Medium Severity
The ADAPTER path in the Gemini hooks activation is hardcoded to $HOME/.claude/hooks/peon-ping/adapters/gemini.sh, but the installPeonPingPacks activation installs adapters under ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/hooks/peon-ping/adapters/. When CLAUDE_CONFIG_DIR is set to a non-default path, the Gemini hooks will reference a non-existent adapter location.
Additional Locations (1)
|
|
||
| if [ -f "$GEMINI_SETTINGS" ]; then | ||
| ${pkgs.jq}/bin/jq --argjson peon "$GEMINI_HOOKS" '.hooks = $peon' \ | ||
| "$GEMINI_SETTINGS" > "$GEMINI_SETTINGS.tmp" && mv "$GEMINI_SETTINGS.tmp" "$GEMINI_SETTINGS" |
There was a problem hiding this comment.
Gemini hooks overwrite all existing user hooks
Medium Severity
The Gemini hooks activation uses .hooks = $peon which replaces the entire hooks object in the Gemini settings file, clobbering any pre-existing non-peon hooks the user may have configured. The comment says "Merge peon-ping hooks into Gemini CLI settings.json" but the implementation performs a full replacement rather than a merge.


Summary
Vendor peon-ping v2.8.1 and an adapted home-manager module (from nix-community/home-manager#8750) so it can be used before the upstream PRs are merged. Includes cross-platform support (macOS + Linux), Claude Code hooks integration, and Gemini CLI adapter hooks.
Changes
pkgs/peon-ping.nix— Local package derivation for peon-ping v2.8.1 with macOS support (libnotify conditional on Linux), installs adapters/scripts/skillshome/modules/peon-ping.nix— Home-manager module adapted from upstream PR: pack installation (as real files, not symlinks, to avoid realpath security check), Claude Code + Gemini CLI hook integration via activation scripts, mutable config seedingflake.nix— Added peon-ping to overlayhome/home.nix+home/work.nix— Import module, enable with Claude Code + Gemini integrationhome/modules/gcloud.nix— Fix pre-existing syntax error (straywprefix)home/modules/ai/default.nix— Formatting only (linter)Test Plan
nix build .#legacyPackages.aarch64-darwin.peon-ping— package builds on macOSpeon help— binary runs correctlynix build .#default --dry-run— work config evaluatesnix build .#homebook --dry-run— homebook config evaluatesnix eval .#packages.x86_64-linux.default --apply 'x: "ok"'— Linux config evaluates🤖 Generated with Claude Code
Note
Medium Risk
Introduces new activation scripts that mutate local tool config files (
~/.claude/settings.json, Gemini settings) and manage on-disk assets, which could override user changes or break agent hook behavior if misconfigured.Overview
Vendors
peon-pingv2.8.1 as a new Nix package and exposes it via the flake overlay so it can be installed cross-platform.Adds a Home Manager module (
programs.peon-ping) that installs sound packs into~/.claude/hooks/peon-ping, optionally seeds a mutable default config, and can automatically merge hook configurations into Claude Code and Gemini CLI settings via activation scripts; the module is imported and enabled inhome.nixandwork.nix.Also fixes a small syntax issue in
modules/gcloud.nixand applies formatting-only changes inmodules/ai/default.nix.Written by Cursor Bugbot for commit 31bdd42. This will update automatically on new commits. Configure here.