nixpkgs/pkgs/tools/system/safe-rm/default.nix

37 lines
968 B
Nix
Raw Normal View History

2021-05-23 19:38:00 +00:00
{ lib, rustPlatform, fetchgit, coreutils, installShellFiles }:
2014-10-21 10:31:28 +00:00
2021-05-23 19:38:00 +00:00
rustPlatform.buildRustPackage rec {
pname = "safe-rm";
2021-05-23 19:38:00 +00:00
version = "1.1.0";
2014-10-21 10:31:28 +00:00
src = fetchgit {
url = "https://git.launchpad.net/safe-rm";
rev = "refs/tags/${pname}-${version}";
2021-05-23 19:38:00 +00:00
sha256 = "sha256-7+4XwsjzLBCQmHDYNwhlN4Yg3eL43GUEbq8ROtuP2Kw=";
2014-10-21 10:31:28 +00:00
};
2021-05-23 19:38:00 +00:00
cargoSha256 = "sha256-durb4RTzEun7HPeYfvDJpvO+6L7tNFmAxdIwINbwZrg=";
2021-03-05 03:19:30 +00:00
2021-05-23 19:38:00 +00:00
postPatch = ''
substituteInPlace src/main.rs \
--replace "/bin/rm" "${coreutils}/bin/rm"
2014-10-21 10:31:28 +00:00
'';
2021-05-23 19:38:00 +00:00
nativeBuildInputs = [ installShellFiles ];
# uses lots of absolute paths outside of the sandbox
doCheck = false;
2014-10-21 10:31:28 +00:00
2021-05-23 19:38:00 +00:00
postInstall = ''
installManPage safe-rm.1
2014-10-21 10:31:28 +00: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 19:38:00 +00:00
license = licenses.gpl3Plus;
2014-10-21 10:31:28 +00:00
platforms = platforms.all;
2021-05-23 19:38:00 +00:00
maintainers = with maintainers; [ SuperSandro2000 ];
2014-10-21 10:31:28 +00:00
};
}