about summary refs log tree commit diff
path: root/pkgs/tools/security/rbw
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2020-10-01 04:20:00 +0000
committerMario Rodas <marsam@users.noreply.github.com>2020-10-01 04:20:00 +0000
commit56f9e7571cd088f8488de72169e51f6a2e69ef60 (patch)
treea5abce587d9e5251ef85439641ba7aabd47d0a03 /pkgs/tools/security/rbw
parentd3669570d29f284ed95760519c1056920030e77d (diff)
rbw: fix build on darwin
Diffstat (limited to 'pkgs/tools/security/rbw')
-rw-r--r--pkgs/tools/security/rbw/default.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/tools/security/rbw/default.nix b/pkgs/tools/security/rbw/default.nix
index 9eb670102fb8d..dd7d96c361a90 100644
--- a/pkgs/tools/security/rbw/default.nix
+++ b/pkgs/tools/security/rbw/default.nix
@@ -1,11 +1,12 @@
 { lib
+, stdenv
 , rustPlatform
 , fetchCrate
 , pinentry
 , openssl
 , pkgconfig
 , makeWrapper
-, cargo
+, Security
 
 # rbw-fzf
 , withFzf ? false, fzf, perl
@@ -34,9 +35,11 @@ rustPlatform.buildRustPackage rec {
     makeWrapper
   ];
 
+  buildInputs = lib.optionals stdenv.isDarwin [ Security ];
+
   postPatch = ''
     substituteInPlace src/pinentry.rs \
-        --replace "Command::new(\"pinentry\")" "Command::new(\"${pinentry}/bin/pinentry\")"
+      --replace 'Command::new("pinentry")' 'Command::new("${pinentry}/${pinentry.binaryPath or "bin/pinentry"}")'
   '' + lib.optionalString withFzf ''
     patchShebangs bin/rbw-fzf
     substituteInPlace bin/rbw-fzf \