2020-03-10 20:21:47 +02:00
|
|
|
locks: rootSrc: rootSubdir:
|
2020-03-09 16:28:41 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2020-03-10 20:21:47 +02:00
|
|
|
callFlake = sourceInfo: subdir: locks:
|
2020-03-09 16:28:41 +02:00
|
|
|
let
|
2020-03-10 20:21:47 +02:00
|
|
|
flake = import (sourceInfo + "/" + subdir + "/flake.nix");
|
2020-03-09 16:28:41 +02:00
|
|
|
|
|
|
|
inputs = builtins.mapAttrs (n: v:
|
|
|
|
if v.flake or true
|
2020-03-10 20:21:47 +02:00
|
|
|
then callFlake (fetchTree (removeAttrs v.locked ["dir"])) (v.locked.dir or "") v.inputs
|
2020-03-09 16:28:41 +02:00
|
|
|
else fetchTree v.locked) locks;
|
|
|
|
|
|
|
|
outputs = flake.outputs (inputs // { self = result; });
|
|
|
|
|
|
|
|
result = outputs // sourceInfo // { inherit inputs; inherit outputs; inherit sourceInfo; };
|
|
|
|
in
|
|
|
|
assert flake.edition == 201909;
|
|
|
|
|
|
|
|
result;
|
|
|
|
|
2020-03-10 20:21:47 +02:00
|
|
|
in callFlake rootSrc rootSubdir (builtins.fromJSON locks).inputs
|