2020-07-04 09:13:09 +02:00
|
|
|
{ lib
|
2020-10-30 20:13:25 +01:00
|
|
|
, stdenv
|
2020-03-30 03:51:05 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2020-07-04 09:13:09 +02:00
|
|
|
, withFzf ? true
|
|
|
|
, fzf
|
2020-10-30 20:13:25 +01:00
|
|
|
# checkInputs
|
|
|
|
, fish
|
|
|
|
, powershell
|
|
|
|
, shellcheck
|
|
|
|
, shfmt
|
|
|
|
, xonsh
|
|
|
|
, zsh
|
2020-03-30 03:51:05 +02:00
|
|
|
}:
|
2021-02-12 02:48:09 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-03-10 22:48:38 +01:00
|
|
|
pname = "zoxide";
|
2021-02-12 02:48:09 +01:00
|
|
|
version = "0.5.0";
|
2020-03-10 22:48:38 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ajeetdsouza";
|
|
|
|
repo = "zoxide";
|
|
|
|
rev = "v${version}";
|
2020-10-30 20:13:25 +01:00
|
|
|
sha256 = "143lh94mw31pm9q7ib63h2k842g3h222mdabhf25hpb19lka2w5y";
|
2020-03-10 22:48:38 +01:00
|
|
|
};
|
|
|
|
|
2020-10-30 20:13:25 +01:00
|
|
|
# tests are broken on darwin
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
|
|
|
# fish needs a writable HOME for whatever reason
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
fish
|
|
|
|
powershell
|
|
|
|
shellcheck
|
|
|
|
shfmt
|
|
|
|
xonsh
|
|
|
|
zsh
|
|
|
|
];
|
|
|
|
|
2020-07-04 09:13:09 +02:00
|
|
|
postPatch = lib.optionalString withFzf ''
|
2020-05-25 11:20:00 +02:00
|
|
|
substituteInPlace src/fzf.rs \
|
|
|
|
--replace '"fzf"' '"${fzf}/bin/fzf"'
|
|
|
|
'';
|
2020-03-10 22:48:38 +01:00
|
|
|
|
2020-10-30 20:13:25 +01:00
|
|
|
cargoSha256 = "05mp101yk1zkjj1gwbkldizq6f9f8089gqgvq42c4ngq88pc7v9a";
|
2020-03-10 22:48:38 +01:00
|
|
|
|
2020-07-04 09:13:09 +02:00
|
|
|
meta = with lib; {
|
2020-03-10 22:48:38 +01:00
|
|
|
description = "A fast cd command that learns your habits";
|
|
|
|
homepage = "https://github.com/ajeetdsouza/zoxide";
|
|
|
|
license = with licenses; [ mit ];
|
2021-02-12 02:48:09 +01:00
|
|
|
maintainers = with maintainers; [ ysndr cole-h SuperSandro2000 ];
|
2020-03-10 22:48:38 +01:00
|
|
|
};
|
|
|
|
}
|