1 #!/usr/bin/env nix-shell
2 # When using as a callable script, passing `--argstr path some/path` overrides $PWD.
3 #!nix-shell -p nix -i "nix-env -qaP --no-name --out-path --arg checkMeta true -f pkgs/top-level/release-outpaths.nix"
6 # https://raw.githubusercontent.com/NixOS/ofborg/74f38efa7ef6f0e8e71ec3bfc675ae4fb57d7491/ofborg/src/outpaths.nix
8 , includeBroken ? true # set this to false to exclude meta.broken packages from the output
11 # used by pkgs/top-level/release-attrnames-superset.nix
12 , attrNamesOnly ? false
14 # Set this to `null` to build for builtins.currentSystem only
24 lib = import (path + "/lib");
25 hydraJobs = import (path + "/pkgs/top-level/release.nix")
26 # Compromise: accuracy vs. resources needed for evaluation.
28 inherit attrNamesOnly;
31 then [ builtins.currentSystem ]
36 allowBroken = includeBroken;
38 allowInsecurePredicate = x: true;
39 checkMeta = checkMeta;
41 handleEvalIssue = reason: errormsg:
48 if builtins.elem reason fatalErrors
50 # hydra does not build unfree packages, so tons of them are broken yet not marked meta.broken.
51 else if !includeBroken && builtins.elem reason [ "broken" "unfree" ]
53 else if builtins.elem reason [ "unsupported" ]
54 then throw "unsupported"
61 recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };
63 # hydraJobs leaves recurseForDerivations as empty attrmaps;
64 # that would break nix-env and we also need to recurse everywhere.
67 if name == "recurseForDerivations" then true
68 else if lib.isAttrs val && val.type or null != "derivation"
69 then recurseIntoAttrs (tweak val)
73 # Some of these contain explicit references to platform(s) we want to avoid;
74 # some even (transitively) depend on ~/.nixpkgs/config.nix (!)
81 "stdenvBootstrapTools"
83 "lib-tests" # these just confuse the output
87 tweak (builtins.removeAttrs hydraJobs blacklist)