-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage.nix
More file actions
48 lines (41 loc) · 1.17 KB
/
package.nix
File metadata and controls
48 lines (41 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
lib,
rustPlatform,
clippy,
nix,
enableClippy ? false,
enableChecks ? false,
}:
rustPlatform.buildRustPackage {
pname = "nix-diff";
version = "0.1.0";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"harmonia-store-aterm-0.0.0-alpha.0" = "sha256-FDL2xxAFOYw21VhGYake2fFC9S7jK5kBSM4OfU12VmQ=";
};
};
NIX_CFLAGS_COMPILE = "-Wno-error";
nativeBuildInputs = lib.optional enableClippy clippy ++ lib.optional enableChecks nix;
nativeCheckInputs = [ nix ];
doCheck = false;
buildPhase = lib.optionalString (enableClippy || enableChecks) ''
runHook preBuild
${lib.optionalString enableClippy "cargo clippy --all-targets --all-features -- -D warnings"}
${lib.optionalString enableChecks "cargo test"}
runHook postBuild
'';
installPhase = lib.optionalString (enableClippy || enableChecks) ''
runHook preInstall
touch $out
runHook postInstall
'';
meta = with lib; {
description = "Explain why two Nix derivations differ";
homepage = "https://github.com/nix-community/nix-diff-rs";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
mainProgram = "nix-diff";
};
}