@@ -0,0 +1,39 @@
1+{ lib, stdenv, fetchFromGitHub, makeWrapper
2+, trash-cli, coreutils, which, getopt }:
3+
4+stdenv.mkDerivation rec {
5+ pname = "rmtrash";
6+ version = "1.13";
7+
8+ src = fetchFromGitHub {
9+ owner = "PhrozenByte";
10+ repo = pname;
11+ rev = "v${version}";
12+ sha256 = "04a9c65wnkq1fj8qhdsdbps88xjbp7rn6p27y25v47kaysvrw01j";
13+ };
14+
15+ dontConfigure = true;
16+ dontBuild = true;
17+
18+ nativeBuildInputs = [ makeWrapper ];
19+
20+ installPhase = ''
21+ for f in rm{,dir}trash; do
22+ install -D ./$f $out/bin/$f
23+ wrapProgram $out/bin/$f \
24+ --prefix PATH : ${lib.makeBinPath [ trash-cli coreutils which getopt ]}
25+ done
26+ '';
27+
28+ meta = with lib; {
29+ homepage = "https://github.com/PhrozenByte/rmtrash";
30+ description = "trash-put made compatible with GNUs rm and rmdir";
31+ longDescription = ''
32+ Put files (and directories) in trash using the `trash-put` command in a
33+ way that is, otherwise as `trash-put` itself, compatible to GNUs `rm`
34+ and `rmdir`.
35+ '';
36+ license = licenses.gpl3Plus;
37+ maintainers = with maintainers; [ peelz ];
38+ };
39+}