summary refs log tree commit diff
path: root/pkgs/tools/security/pass/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/security/pass/default.nix')
-rw-r--r--pkgs/tools/security/pass/default.nix24
1 files changed, 17 insertions, 7 deletions
diff --git a/pkgs/tools/security/pass/default.nix b/pkgs/tools/security/pass/default.nix
index 1aa5e0b51f1..c03029232ac 100644
--- a/pkgs/tools/security/pass/default.nix
+++ b/pkgs/tools/security/pass/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl
-, coreutils, gnused, getopt, pwgen, git, tree, gnupg
+, coreutils, gnused, getopt, pwgen, git, tree, gnupg, which
 , makeWrapper
 
 , xclip ? null, xdotool ? null, dmenu ? null
@@ -59,6 +59,16 @@ stdenv.mkDerivation rec {
     '' else ""}
   '';
 
+  wrapperPath = with stdenv.lib; makeSearchPath "bin/" ([
+    coreutils
+    gnused
+    getopt
+    git
+    gnupg
+    tree
+    which
+  ] ++ ifEnable x11Support [ dmenu xclip xdotool ]);
+
   postFixup = ''
     # Fix program name in --help
     substituteInPlace $out/bin/pass \
@@ -66,11 +76,11 @@ stdenv.mkDerivation rec {
 
     # Ensure all dependencies are in PATH
     wrapProgram $out/bin/pass \
-      --prefix PATH : "${coreutils}/bin:${gnused}/bin:${getopt}/bin:${gnupg}/bin:${git}/bin:${tree}/bin:${pwgen}/bin${if x11Support then ":${xclip}/bin" else ""}"
-
-    ${if x11Support then ''
-      wrapProgram $out/bin/passmenu \
-        --prefix PATH : "$out/bin:${xdotool}/bin:${dmenu}/bin"
-    '' else ""}
+      --prefix PATH : "${wrapperPath}"
+  '' + stdenv.lib.optionalString x11Support ''
+    # We just wrap passmenu with the same PATH as pass. It doesn't
+    # need all the tools in there but it doesn't hurt either.
+    wrapProgram $out/bin/passmenu \
+      --prefix PATH : "$out/bin:${wrapperPath}"
   '';
 }