about summary refs log tree commit diff
path: root/pkgs/tools/misc/trashy/default.nix
blob: 7d3b3952a7ca39aec0ab77a4deb343983d1ba676 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ lib, fetchFromGitHub, rustPlatform, installShellFiles }:

rustPlatform.buildRustPackage rec {
  pname = "trashy";
  version = "1.0.3";

  src = fetchFromGitHub {
    owner = "oberblastmeister";
    repo = "trashy";
    rev = "v${version}";
    sha256 = "sha256-b50Q7knJzXKDfM1kw6wLvXunhgOXVs+zYvZx/NYqMdk=";
  };

  cargoSha256 = "sha256-2hNNLXuAHd1bquhHimniqryTVMfBmPAOossggICScqQ=";

  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 ];
  };
}