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 {
|
2019-08-15 13:41:18 +01:00
|
|
|
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 {
|
2020-10-22 15:48:32 +01:00
|
|
|
url = "https://git.launchpad.net/safe-rm";
|
2019-08-15 13:41:18 +01:00
|
|
|
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
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-11-11 13:20:43 +00:00
|
|
|
description = "Tool intended to prevent the accidental deletion of important files";
|
2020-04-01 02:11:51 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|