summary refs log tree commit diff
path: root/pkgs/tools/misc/zoxide
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2020-05-25 04:20:00 -0500
committerMario Rodas <marsam@users.noreply.github.com>2020-05-25 04:20:00 -0500
commit204ea0bfb7e4dcf41c91a6d14e58d42fe08ef9c3 (patch)
treee16da006b06784b88a13ecabbf035032a8eacae5 /pkgs/tools/misc/zoxide
parent82fbcf6ac370e16f362b29df3c7babca36bf032a (diff)
downloadnixpkgs-204ea0bfb7e4dcf41c91a6d14e58d42fe08ef9c3.tar
nixpkgs-204ea0bfb7e4dcf41c91a6d14e58d42fe08ef9c3.tar.gz
nixpkgs-204ea0bfb7e4dcf41c91a6d14e58d42fe08ef9c3.tar.bz2
nixpkgs-204ea0bfb7e4dcf41c91a6d14e58d42fe08ef9c3.tar.lz
nixpkgs-204ea0bfb7e4dcf41c91a6d14e58d42fe08ef9c3.tar.xz
nixpkgs-204ea0bfb7e4dcf41c91a6d14e58d42fe08ef9c3.tar.zst
nixpkgs-204ea0bfb7e4dcf41c91a6d14e58d42fe08ef9c3.zip
zoxide: make fzf optional
Diffstat (limited to 'pkgs/tools/misc/zoxide')
-rw-r--r--pkgs/tools/misc/zoxide/default.nix13
1 files changed, 7 insertions, 6 deletions
diff --git a/pkgs/tools/misc/zoxide/default.nix b/pkgs/tools/misc/zoxide/default.nix
index ab8633c4990..ee15786d40c 100644
--- a/pkgs/tools/misc/zoxide/default.nix
+++ b/pkgs/tools/misc/zoxide/default.nix
@@ -1,7 +1,7 @@
-{ lib
+{ stdenv
 , fetchFromGitHub
 , rustPlatform
-, fzf
+, withFzf ? true, fzf
 }:
 
 rustPlatform.buildRustPackage rec {
@@ -15,13 +15,14 @@ rustPlatform.buildRustPackage rec {
     sha256 = "1zfk9y5f12h2d5zwf2z8c95xwhbhc6ayv971875fbxgz1nd8vqb6";
   };
 
-  buildInputs = [
-    fzf
-  ];
+  postPatch = stdenv.lib.optionalString withFzf ''
+    substituteInPlace src/fzf.rs \
+      --replace '"fzf"' '"${fzf}/bin/fzf"'
+  '';
 
   cargoSha256 = "0z0p3cxxazw19bmk3zw7z2q93p00ywsa2cz1jhy78mn5pq1v95rd";
 
-  meta = with lib; {
+  meta = with stdenv.lib; {
     description = "A fast cd command that learns your habits";
     homepage = "https://github.com/ajeetdsouza/zoxide";
     license = with licenses; [ mit ];