nixpkgs/pkgs/tools/misc/zoxide/default.nix

61 lines
1.1 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, withFzf ? true
, fzf
# checkInputs
, fish
, powershell
, shellcheck
, shfmt
, xonsh
, zsh
}:
let
version = "0.5.0";
in
rustPlatform.buildRustPackage {
2020-03-10 21:48:38 +00:00
pname = "zoxide";
inherit version;
2020-03-10 21:48:38 +00:00
src = fetchFromGitHub {
owner = "ajeetdsouza";
repo = "zoxide";
rev = "v${version}";
sha256 = "143lh94mw31pm9q7ib63h2k842g3h222mdabhf25hpb19lka2w5y";
2020-03-10 21:48:38 +00: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
];
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
cargoSha256 = "05mp101yk1zkjj1gwbkldizq6f9f8089gqgvq42c4ngq88pc7v9a";
2020-03-10 21:48:38 +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 ];
2020-03-19 20:21:46 +00:00
maintainers = with maintainers; [ ysndr cole-h ];
2020-03-10 21:48:38 +00:00
};
}