Commit 408bbf26b53e

Vincent Demeester <vincent@sbr.pm>
2025-12-10 15:32:39
fix(claude-hooks): Add libnotify dependency for desktop notifications
- Add makeWrapper and libnotify to claude-hooks package dependencies - Wrap claude-hooks-save-session to include notify-send in PATH - Update SessionEnd hook to use absolute path for save-session command - Fixes "notify-send: executable file not found in $PATH" warning Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent dd581a0
Changed files (2)
dots
.config
tools
claude-hooks
dots/.config/claude/settings.json
@@ -25,7 +25,7 @@
         "hooks": [
           {
             "type": "command",
-            "command": "claude-hooks-save-session"
+            "command": "/etc/profiles/per-user/vincent/bin/claude-hooks-save-session"
           }
         ]
       }
tools/claude-hooks/default.nix
@@ -1,6 +1,8 @@
 {
   buildGoModule,
   lib,
+  makeWrapper,
+  libnotify,
 }:
 
 buildGoModule {
@@ -10,6 +12,8 @@ buildGoModule {
 
   vendorHash = "sha256-bdpAteulG3045jPdEpjcT4yGlnxLKDMlK7lk9WVRTKc=";
 
+  nativeBuildInputs = [ makeWrapper ];
+
   # Build all binaries
   subPackages = [
     "cmd/capture-tool-output"
@@ -19,13 +23,17 @@ buildGoModule {
     "cmd/session-stats"
   ];
 
-  # Rename binaries to have consistent prefix
+  # Rename binaries to have consistent prefix and wrap with dependencies
   postInstall = ''
     mv $out/bin/capture-tool-output $out/bin/claude-hooks-capture-tool-output
     mv $out/bin/initialize-session $out/bin/claude-hooks-initialize-session
     mv $out/bin/validate-docs $out/bin/claude-hooks-validate-docs
     mv $out/bin/save-session $out/bin/claude-hooks-save-session
     mv $out/bin/session-stats $out/bin/claude-hooks-session-stats
+
+    # Wrap save-session to include notify-send in PATH
+    wrapProgram $out/bin/claude-hooks-save-session \
+      --prefix PATH : ${lib.makeBinPath [ libnotify ]}
   '';
 
   meta = {