nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 versionCheckHook,
6 installShellFiles,
7 stdenv,
8 nix-update-script,
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "rip2";
13 version = "0.9.4";
14
15 src = fetchFromGitHub {
16 owner = "MilesCranmer";
17 repo = "rip2";
18 rev = "v${version}";
19 hash = "sha256-lNMFbc0TItvVuzwpVbe7qWlSCzIaFi0/cQwfq2itzbY=";
20 };
21
22 cargoHash = "sha256-KUVybOCtc66AubXjei0YCkXirfuIDgK3xSxjNODun98=";
23
24 nativeBuildInputs = [ installShellFiles ];
25
26 # TODO: Unsure why this test fails, but not a major issue so
27 # skipping for now.
28 checkFlags = [ "--skip=test_filetypes::file_type_3___fifo__" ];
29
30 doInstallCheck = true;
31 nativeInstallCheckInputs = [ versionCheckHook ];
32 versionCheckProgram = "${placeholder "out"}/bin/rip";
33 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
34 installShellCompletion --cmd rip \
35 --bash <($out/bin/rip completions bash) \
36 --fish <($out/bin/rip completions fish) \
37 --zsh <($out/bin/rip completions zsh)
38 '';
39
40 passthru.updateScript = nix-update-script { };
41
42 meta = {
43 description = "Safe and ergonomic alternative to rm";
44 homepage = "https://github.com/MilesCranmer/rip2";
45 license = lib.licenses.gpl3Plus;
46 maintainers = with lib.maintainers; [
47 milescranmer
48 matthiasbeyer
49 ];
50 mainProgram = "rip";
51 };
52}