-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathofborg-outpaths.nix
56 lines (50 loc) · 1.72 KB
/
ofborg-outpaths.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env nix-shell
# When using as a callable script, passing `--argstr path some/path` overrides $PWD.
#!nix-shell -p nix -i "nix-env -qaP --no-name --out-path --arg checkMeta true --argstr path $PWD -f"
{ checkMeta ? false
, path ? ./.
, supportedSystems
}:
let
lib = import <nixpkgs/lib>;
hydraJobs = import <nixpkgs/pkgs/top-level/release.nix>
# Compromise: accuracy vs. resources needed for evaluation.
{
inherit supportedSystems;
nixpkgsArgs = {
config = {
allowBroken = false;
allowUnfree = true;
allowInsecurePredicate = x: true;
checkMeta = checkMeta;
handleEvalIssue = reason: errormsg:
let
fatalErrors = [
"unknown-meta" "broken-outputs"
];
in if builtins.elem reason fatalErrors
then abort errormsg
else true;
inHydra = true;
};
};
};
recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };
# hydraJobs leaves recurseForDerivations as empty attrmaps;
# that would break nix-env and we also need to recurse everywhere.
tweak = lib.mapAttrs
(name: val:
if name == "recurseForDerivations" then true
else if lib.isAttrs val && val.type or null != "derivation"
then recurseIntoAttrs (tweak val)
else val
);
# Some of these contain explicit references to platform(s) we want to avoid;
# some even (transitively) depend on ~/.nixpkgs/config.nix (!)
blacklist = [
"tarball" "metrics" "manual"
"darwin-tested" "unstable" "stdenvBootstrapTools"
"moduleSystem" "lib-tests" # these just confuse the output
];
in
tweak (builtins.removeAttrs hydraJobs blacklist)