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
15 , systems ? import ../../ci/supportedSystems.nix
18 lib = import (path + "/lib");
19 hydraJobs = import (path + "/pkgs/top-level/release.nix")
20 # Compromise: accuracy vs. resources needed for evaluation.
22 inherit attrNamesOnly;
25 then [ builtins.currentSystem ]
30 allowBroken = includeBroken;
32 allowInsecurePredicate = x: true;
33 checkMeta = checkMeta;
35 handleEvalIssue = reason: errormsg:
42 if builtins.elem reason fatalErrors
44 # hydra does not build unfree packages, so tons of them are broken yet not marked meta.broken.
45 else if !includeBroken && builtins.elem reason [ "broken" "unfree" ]
47 else if builtins.elem reason [ "unsupported" ]
48 then throw "unsupported"
55 recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };
57 # hydraJobs leaves recurseForDerivations as empty attrmaps;
58 # that would break nix-env and we also need to recurse everywhere.
61 if name == "recurseForDerivations" then true
62 else if lib.isAttrs val && val.type or null != "derivation"
63 then recurseIntoAttrs (tweak val)
67 # Some of these contain explicit references to platform(s) we want to avoid;
68 # some even (transitively) depend on ~/.nixpkgs/config.nix (!)
75 "stdenvBootstrapTools"
77 "lib-tests" # these just confuse the output
81 tweak (builtins.removeAttrs hydraJobs blacklist)