about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/system/safe-rm
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/system/safe-rm')
-rw-r--r--nixpkgs/pkgs/tools/system/safe-rm/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/system/safe-rm/default.nix b/nixpkgs/pkgs/tools/system/safe-rm/default.nix
new file mode 100644
index 000000000000..c81eea889023
--- /dev/null
+++ b/nixpkgs/pkgs/tools/system/safe-rm/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchgit, perl, coreutils }:
+
+stdenv.mkDerivation rec {
+  pname = "safe-rm";
+  version = "0.12";
+
+  src = fetchgit {
+    url = "https://git.launchpad.net/safe-rm";
+    rev = "refs/tags/${pname}-${version}";
+    sha256 = "0zkmwxyl1870ar6jr9h537vmqgkckqs9jd1yv6m4qqzdsmg5gdbq";
+  };
+
+  # pod2man
+  nativeBuildInputs = [ perl ];
+
+  propagatedBuildInputs = [ coreutils perl ];
+
+  postFixup = ''
+    sed -e 's@/bin/rm@${coreutils}/bin/rm@' -i $out/bin/safe-rm
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp safe-rm $out/bin
+
+    mkdir -p $out/share/man/man1
+    pod2man safe-rm > $out/share/man/man1/safe-rm.1
+  '';
+
+  meta = with lib; {
+    description = "Tool intended to prevent the accidental deletion of important files";
+    homepage = "https://launchpad.net/safe-rm";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = [ maintainers.koral ];
+  };
+}