2022-09-09 14:08:57 +00:00
|
|
|
{ lib, fetchFromGitHub, rustPlatform, installShellFiles }:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "trashy";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "2.0.0";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "oberblastmeister";
|
|
|
|
repo = "trashy";
|
|
|
|
rev = "v${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
sha256 = "sha256-xYSk0M8oNwbwZbKWDXMQlnt7vKi0p3+2Tr4eXCvtHEM=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
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 ];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|