nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 43 lines 1.0 kB view raw
1{ 2 lib, 3 rustPlatform, 4 fetchgit, 5 coreutils, 6 installShellFiles, 7}: 8 9rustPlatform.buildRustPackage rec { 10 pname = "safe-rm"; 11 version = "1.1.0"; 12 13 src = fetchgit { 14 url = "https://git.launchpad.net/safe-rm"; 15 rev = "refs/tags/${pname}-${version}"; 16 sha256 = "sha256-7+4XwsjzLBCQmHDYNwhlN4Yg3eL43GUEbq8ROtuP2Kw="; 17 }; 18 19 cargoHash = "sha256-6mPx7qgrsUtjDiFMIL4NTmG9jeC3mBlsQIf/TUB4SQM="; 20 21 postPatch = '' 22 substituteInPlace src/main.rs \ 23 --replace-fail "/bin/rm" "${coreutils}/bin/rm" 24 ''; 25 26 nativeBuildInputs = [ installShellFiles ]; 27 28 # uses lots of absolute paths outside of the sandbox 29 doCheck = false; 30 31 postInstall = '' 32 installManPage safe-rm.1 33 ''; 34 35 meta = with lib; { 36 description = "Tool intended to prevent the accidental deletion of important files"; 37 homepage = "https://launchpad.net/safe-rm"; 38 license = licenses.gpl3Plus; 39 platforms = platforms.all; 40 maintainers = with maintainers; [ SuperSandro2000 ]; 41 mainProgram = "safe-rm"; 42 }; 43}