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 {
|
2019-08-15 12:41:18 +00:00
|
|
|
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 {
|
2020-10-22 14:48:32 +00:00
|
|
|
url = "https://git.launchpad.net/safe-rm";
|
2019-08-15 12:41:18 +00:00
|
|
|
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
|
|
|
'';
|
|
|
|
|
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 01:11:51 +00:00
|
|
|
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 ];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "safe-rm";
|
2014-10-21 10:31:28 +00:00
|
|
|
};
|
|
|
|
}
|