2020-05-25 10:20:00 +01:00
|
|
|
{ stdenv
|
2020-03-30 02:51:05 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2020-05-25 10:20:00 +01:00
|
|
|
, withFzf ? true, fzf
|
2020-03-30 02:51:05 +01:00
|
|
|
}:
|
2020-03-10 21:48:38 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "zoxide";
|
2020-05-24 23:21:14 +01:00
|
|
|
version = "0.4.1";
|
2020-03-10 21:48:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ajeetdsouza";
|
|
|
|
repo = "zoxide";
|
|
|
|
rev = "v${version}";
|
2020-05-24 23:21:14 +01:00
|
|
|
sha256 = "1zfk9y5f12h2d5zwf2z8c95xwhbhc6ayv971875fbxgz1nd8vqb6";
|
2020-03-10 21:48:38 +00:00
|
|
|
};
|
|
|
|
|
2020-05-25 10:20:00 +01:00
|
|
|
postPatch = stdenv.lib.optionalString withFzf ''
|
|
|
|
substituteInPlace src/fzf.rs \
|
|
|
|
--replace '"fzf"' '"${fzf}/bin/fzf"'
|
|
|
|
'';
|
2020-03-10 21:48:38 +00:00
|
|
|
|
2020-05-24 23:21:14 +01:00
|
|
|
cargoSha256 = "0z0p3cxxazw19bmk3zw7z2q93p00ywsa2cz1jhy78mn5pq1v95rd";
|
2020-03-10 21:48:38 +00:00
|
|
|
|
2020-05-25 10:20:00 +01:00
|
|
|
meta = with stdenv.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 ];
|
2020-03-19 20:21:46 +00:00
|
|
|
maintainers = with maintainers; [ ysndr cole-h ];
|
2020-03-10 21:48:38 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|