2020-07-18 16:06:22 +00:00
|
|
|
{ lib
|
2020-11-03 02:18:15 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2020-07-18 16:06:22 +00:00
|
|
|
, withFzf ? true
|
|
|
|
, fzf
|
2021-05-03 20:48:10 +00:00
|
|
|
, installShellFiles
|
2021-04-12 18:23:04 +00:00
|
|
|
, libiconv
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "zoxide";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.9.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ajeetdsouza";
|
|
|
|
repo = "zoxide";
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-qmT/gTkizZpyYN/YdobBq2vunGM5SpNpCHIFmg8nPhk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-04-12 18:23:04 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postPatch = lib.optionalString withFzf ''
|
2022-04-27 09:35:20 +00:00
|
|
|
substituteInPlace src/util.rs \
|
2020-05-29 06:06:01 +00:00
|
|
|
--replace '"fzf"' '"${fzf}/bin/fzf"'
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
cargoSha256 = "sha256-1sW6bvRJJp+qT5A9+l8wN3TQuzFDiBoeLyY5JvAA7dQ=";
|
2021-05-03 20:48:10 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
installManPage man/man*/*
|
2021-06-28 23:13:55 +00:00
|
|
|
installShellCompletion --cmd zoxide \
|
|
|
|
--bash contrib/completions/zoxide.bash \
|
|
|
|
--fish contrib/completions/zoxide.fish \
|
|
|
|
--zsh contrib/completions/_zoxide
|
2021-05-03 20:48:10 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A fast cd command that learns your habits";
|
|
|
|
homepage = "https://github.com/ajeetdsouza/zoxide";
|
2021-05-03 20:48:10 +00:00
|
|
|
changelog = "https://github.com/ajeetdsouza/zoxide/raw/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; [ mit ];
|
2021-02-13 14:23:35 +00:00
|
|
|
maintainers = with maintainers; [ ysndr cole-h SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|