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