depot/third_party/nixpkgs/pkgs/tools/misc/trashy/default.nix
Default email a0cb138ada Project import generated by Copybara.
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
2023-02-02 18:25:31 +00:00

35 lines
1.1 KiB
Nix

{ lib, fetchFromGitHub, rustPlatform, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "trashy";
version = "2.0.0";
src = fetchFromGitHub {
owner = "oberblastmeister";
repo = "trashy";
rev = "v${version}";
sha256 = "sha256-xYSk0M8oNwbwZbKWDXMQlnt7vKi0p3+2Tr4eXCvtHEM=";
};
cargoSha256 = "sha256-ZWqWtWzb+CLH1ravBb/oV+aPxplEyiC1wEFhvchcLqg=";
# this patch must be removed after oberblastmeister/trashy#70 is solved or new
# version is released.
cargoPatches = [ ./lock-version.patch ];
nativeBuildInputs = [ installShellFiles ];
preFixup = ''
installShellCompletion --cmd trash \
--bash <($out/bin/trash completions bash) \
--fish <($out/bin/trash completions fish) \
--zsh <($out/bin/trash completions zsh) \
'';
meta = with lib; {
description = "A simple, fast, and featureful alternative to rm and trash-cli.";
homepage = "https://github.com/oberblastmeister/trashy";
license = with licenses; [ asl20 /* or */ mit ];
maintainers = with maintainers; [ oberblastmeister ];
};
}