nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 variant,
3}:
4let
5 pkgs = import ../../../. { config.allowAliases = false; };
6 lib = pkgs.lib;
7 optionalsWithSuccess =
8 toTry: next:
9 let
10 tried = builtins.tryEval toTry;
11 in
12 lib.optionals tried.success (next tried.value);
13 findAll =
14 path: obj:
15 optionalsWithSuccess obj (
16 obj:
17 if obj ? outPath then
18 optionalsWithSuccess obj.outPath or null (
19 outPath:
20 # filter out unavailable, broken packages, and drvs with broken deps
21 lib.optional (!((obj ? meta) && (!obj.meta.available or false || obj.meta.broken))) {
22 p = path;
23 o = outPath;
24 }
25 )
26 else if (obj.recurseForDerivations or false) || (obj.recurseForRelease or false) then
27 lib.concatLists (
28 lib.mapAttrsToList (
29 name: value: findAll (if path == null then name else path + "." + name) value
30 ) obj
31 )
32 else
33 [ ]
34 );
35in
36findAll null (pkgs.${variant} // { recurseForDerivations = true; })