-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnix-du.nix
26 lines (26 loc) · 834 Bytes
/
nix-du.nix
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
{ callPackage, pkgs, lib, graphviz, nix, nlohmann_json, defaultCrateOverrides, xcbuild, pkg-config, boost, darwin, stdenv, rustPlatform }:
let
cargo = import ./Cargo.nix {
inherit pkgs;
defaultCrateOverrides = defaultCrateOverrides // {
nix-du = attrs: {
buildInputs = [
boost
nix
nlohmann_json
] ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
] ++ lib.optional stdenv.isDarwin xcbuild;
};
};
};
nix-du-untested = cargo.rootCrate.build;
nix-du-tested = nix-du-untested.override {
runTests = true;
testInputs = [ graphviz nix ];
};
in
# this hack allows to use inputsFrom in mkShell
nix-du-untested // { tested = nix-du-tested; }