Files
nixpkgs/pkgs/development/rocm-modules/release-attrPaths-gen.nix
Wolfgang Walther 058fad7135 rocm-modules/release-attrPaths-gen.nix: fix import
This seems to have been moved to a different folder, so that the
relative path wasn't correct anymore.
2026-01-18 16:15:07 +01:00

37 lines
1023 B
Nix

{
variant,
}:
let
pkgs = import ../../../. { config.allowAliases = false; };
lib = pkgs.lib;
optionalsWithSuccess =
toTry: next:
let
tried = builtins.tryEval toTry;
in
lib.optionals tried.success (next tried.value);
findAll =
path: obj:
optionalsWithSuccess obj (
obj:
if obj ? outPath then
optionalsWithSuccess obj.outPath or null (
outPath:
# filter out unavailable, broken packages, and drvs with broken deps
lib.optional (!((obj ? meta) && (!obj.meta.available or false || obj.meta.broken))) {
p = path;
o = outPath;
}
)
else if (obj.recurseForDerivations or false) || (obj.recurseForRelease or false) then
lib.concatLists (
lib.mapAttrsToList (
name: value: findAll (if path == null then name else path + "." + name) value
) obj
)
else
[ ]
);
in
findAll null (pkgs.${variant} // { recurseForDerivations = true; })