bandwhich: 0.23.0 -> 0.23.1; move to by-name; nixfmt; useFetchCargoVendor (#356934)
[NixPkgs.git] / pkgs / by-name / tr / trashy / package.nix
blob8798f7ab5ed7dee8610bf6f209fba4ecd0e04644
2   lib,
3   rustPlatform,
4   fetchCrate,
5   installShellFiles,
6   stdenv,
7 }:
9 rustPlatform.buildRustPackage rec {
10   pname = "trashy";
11   version = "2.0.0";
13   src = fetchCrate {
14     inherit pname version;
15     hash = "sha256-1xHyhAV8hpgMngQdamRzEliyG60t+I3KfsDJi0+180o=";
16   };
18   cargoHash = "sha256-ZWqWtWzb+CLH1ravBb/oV+aPxplEyiC1wEFhvchcLqg=";
20   nativeBuildInputs = [ installShellFiles ];
22   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
23     installShellCompletion --cmd trash \
24       --bash <($out/bin/trash completions bash) \
25       --fish <($out/bin/trash completions fish) \
26       --zsh <($out/bin/trash completions zsh) \
27   '';
29   meta = with lib; {
30     description = "Simple, fast, and featureful alternative to rm and trash-cli";
31     homepage = "https://github.com/oberblastmeister/trashy";
32     changelog = "https://github.com/oberblastmeister/trashy/blob/v${version}/CHANGELOG.md";
33     license = with licenses; [
34       asl20 # or
35       mit
36     ];
37     maintainers = with maintainers; [ oberblastmeister ];
38     mainProgram = "trash";
39     # darwin is unsupported due to https://github.com/Byron/trash-rs/issues/8
40     platforms = platforms.linux;
41   };