about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/rmtrash/default.nix
blob: 61b8ead738cfd77894b0ca149f98e883bd2f5905 (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
32
33
34
35
36
37
{ lib, stdenvNoCC, fetchFromGitHub, makeWrapper
, trash-cli, coreutils, which, getopt }:

stdenvNoCC.mkDerivation rec {
  pname = "rmtrash";
  version = "1.14";

  src = fetchFromGitHub {
    owner = "PhrozenByte";
    repo = pname;
    rev = "v${version}";
    sha256 = "0wfb2ykzlsxyqn9krfsis9jxhaxy3pxl71a4f15an1ngfndai694";
  };

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    for f in rm{,dir}trash; do
      install -D ./$f $out/bin/$f
      wrapProgram $out/bin/$f \
        --prefix PATH : ${lib.makeBinPath [ trash-cli coreutils which getopt ]}
    done
  '';

  meta = with lib; {
    homepage = "https://github.com/PhrozenByte/rmtrash";
    description = "trash-put made compatible with GNUs rm and rmdir";
    longDescription = ''
      Put files (and directories) in trash using the `trash-put` command in a
      way that is, otherwise as `trash-put` itself, compatible to GNUs `rm`
      and `rmdir`.
    '';
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ peelz ];
    platforms = platforms.all;
  };
}