evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / zo / zoxide / package.nix
blob5c1ba44d156dcdaa817741a2ad1bb0b0a8d1f0ba
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , rustPlatform
5 , withFzf ? true
6 , fzf
7 , installShellFiles
8 , libiconv
9 }:
11 rustPlatform.buildRustPackage rec {
12   pname = "zoxide";
13   version = "0.9.6";
15   src = fetchFromGitHub {
16     owner = "ajeetdsouza";
17     repo = "zoxide";
18     rev = "refs/tags/v${version}";
19     hash = "sha256-3XC5K4OlituoFMPN9yJkYi+tkH6M0KK5jVAGdr/GLd0=";
20   };
22   nativeBuildInputs = [ installShellFiles ];
24   buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
26   postPatch = lib.optionalString withFzf ''
27     substituteInPlace src/util.rs \
28       --replace '"fzf"' '"${fzf}/bin/fzf"'
29   '';
31   cargoHash = "sha256-ZRsnoLysNzDIi9hDOqwAzbxcyFQgn2Wv3gRNAjV5HfE=";
33   postInstall = ''
34     installManPage man/man*/*
35     installShellCompletion --cmd zoxide \
36       --bash contrib/completions/zoxide.bash \
37       --fish contrib/completions/zoxide.fish \
38       --zsh contrib/completions/_zoxide
39   '';
41   meta = with lib; {
42     description = "Fast cd command that learns your habits";
43     homepage = "https://github.com/ajeetdsouza/zoxide";
44     changelog = "https://github.com/ajeetdsouza/zoxide/blob/v${version}/CHANGELOG.md";
45     license = with licenses; [ mit ];
46     maintainers = with maintainers; [ ysndr cole-h SuperSandro2000 ];
47     mainProgram = "zoxide";
48   };