2020-07-04 07:13:09 +00:00
|
|
|
{ lib
|
2020-10-30 19:13:25 +00:00
|
|
|
, stdenv
|
2020-03-30 01:51:05 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2020-07-04 07:13:09 +00:00
|
|
|
, withFzf ? true
|
|
|
|
, fzf
|
2021-04-09 06:45:17 +00:00
|
|
|
, libiconv
|
2020-03-30 01:51:05 +00:00
|
|
|
}:
|
2021-02-12 01:48:09 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-03-10 21:48:38 +00:00
|
|
|
pname = "zoxide";
|
2021-04-09 06:45:17 +00:00
|
|
|
version = "0.6.0";
|
2020-03-10 21:48:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ajeetdsouza";
|
|
|
|
repo = "zoxide";
|
|
|
|
rev = "v${version}";
|
2021-04-09 06:45:17 +00:00
|
|
|
sha256 = "ZeGFsVBpEhKi4EIhpQlCuriFzmHAgLYw3qE/zqfyqgU=";
|
2020-03-10 21:48:38 +00:00
|
|
|
};
|
|
|
|
|
2021-04-09 06:45:17 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
|
|
|
|
2020-07-04 07:13:09 +00:00
|
|
|
postPatch = lib.optionalString withFzf ''
|
2020-05-25 09:20:00 +00:00
|
|
|
substituteInPlace src/fzf.rs \
|
|
|
|
--replace '"fzf"' '"${fzf}/bin/fzf"'
|
|
|
|
'';
|
2020-03-10 21:48:38 +00:00
|
|
|
|
2021-04-09 06:45:17 +00:00
|
|
|
cargoSha256 = "Hzn01+OhdBrZD1woXN4Pwf/S72Deln1gyyBOWyDC6iM=";
|
2020-03-10 21:48:38 +00:00
|
|
|
|
2020-07-04 07:13:09 +00:00
|
|
|
meta = with lib; {
|
2020-03-10 21:48:38 +00:00
|
|
|
description = "A fast cd command that learns your habits";
|
|
|
|
homepage = "https://github.com/ajeetdsouza/zoxide";
|
|
|
|
license = with licenses; [ mit ];
|
2021-02-12 01:48:09 +00:00
|
|
|
maintainers = with maintainers; [ ysndr cole-h SuperSandro2000 ];
|
2020-03-10 21:48:38 +00:00
|
|
|
};
|
|
|
|
}
|