1 # This expression returns a list of all fetchurl calls used by ‘expr’.
12 uniqueFiles = map (x: x.file) (genericClosure {
13 startSet = map (file: { key = with file; (if type == null then "" else type + "+") + hash; inherit file; }) files;
17 files = map (drv: { urls = drv.urls or [ drv.url ]; hash = drv.outputHash; isPatch = (drv?postFetch && drv.postFetch != ""); type = drv.outputHashAlgo; name = drv.name; }) fetchurlDependencies;
19 fetchurlDependencies =
21 (drv: drv.outputHash or "" != "" && drv.outputHashMode or "flat" == "flat"
22 && (drv ? url || drv ? urls))
25 dependencies = map (x: x.value) (genericClosure {
26 startSet = map keyDrv (derivationsIn' root);
27 operator = { key, value }: map keyDrv (immediateDependenciesOf value);
32 else if isDerivation x then optional (canEval x.drvPath) x
33 else if isList x then concatLists (map derivationsIn' x)
34 else if isAttrs x then concatLists (mapAttrsToList (n: v: addErrorContext "while finding tarballs in '${n}':" (derivationsIn' v)) x)
37 keyDrv = drv: if canEval drv.drvPath then { key = drv.drvPath; value = drv; } else { };
39 immediateDependenciesOf = drv:
40 concatLists (mapAttrsToList (n: v: derivationsIn v) (removeAttrs drv (["meta" "passthru"] ++ optionals (drv?passthru) (attrNames drv.passthru))));
44 else if isDerivation x then optional (canEval x.drvPath) x
45 else if isList x then concatLists (map derivationsIn x)
48 canEval = val: (builtins.tryEval val).success;