3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/system/safe-rm/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
968 B
Nix
Raw Normal View History

2021-05-23 20:38:00 +01:00
{ lib, rustPlatform, fetchgit, coreutils, installShellFiles }:
2014-10-21 11:31:28 +01:00
2021-05-23 20:38:00 +01:00
rustPlatform.buildRustPackage rec {
pname = "safe-rm";
2021-05-23 20:38:00 +01:00
version = "1.1.0";
2014-10-21 11:31:28 +01:00
src = fetchgit {
url = "https://git.launchpad.net/safe-rm";
rev = "refs/tags/${pname}-${version}";
2021-05-23 20:38:00 +01:00
sha256 = "sha256-7+4XwsjzLBCQmHDYNwhlN4Yg3eL43GUEbq8ROtuP2Kw=";
2014-10-21 11:31:28 +01:00
};
2021-05-23 20:38:00 +01:00
cargoSha256 = "sha256-durb4RTzEun7HPeYfvDJpvO+6L7tNFmAxdIwINbwZrg=";
2021-03-05 03:19:30 +00:00
2021-05-23 20:38:00 +01:00
postPatch = ''
substituteInPlace src/main.rs \
--replace "/bin/rm" "${coreutils}/bin/rm"
2014-10-21 11:31:28 +01:00
'';
2021-05-23 20:38:00 +01:00
nativeBuildInputs = [ installShellFiles ];
# uses lots of absolute paths outside of the sandbox
doCheck = false;
2014-10-21 11:31:28 +01:00
2021-05-23 20:38:00 +01:00
postInstall = ''
installManPage safe-rm.1
2014-10-21 11:31:28 +01:00
'';
meta = with lib; {
2014-11-11 13:20:43 +00:00
description = "Tool intended to prevent the accidental deletion of important files";
homepage = "https://launchpad.net/safe-rm";
2021-05-23 20:38:00 +01:00
license = licenses.gpl3Plus;
2014-10-21 11:31:28 +01:00
platforms = platforms.all;
2021-05-23 20:38:00 +01:00
maintainers = with maintainers; [ SuperSandro2000 ];
2014-10-21 11:31:28 +01:00
};
}