1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 22:01:15 +02:00

fix: Evaluate flake parent source without evaluating its outputs

This requires that we refer to the `sourceInfo` instead of the
`result`. However, `sourceInfo` does not create a chain of basedir
resolution, so we add that back with `flakeDir`.
This commit is contained in:
Robert Hensing 2025-04-15 09:28:23 +02:00 committed by Jörg Thalheim
parent 9de9410f29
commit 2109a5a206
2 changed files with 31 additions and 1 deletions

View file

@ -42,13 +42,20 @@ let
parentNode = allNodes.${getInputByPath lockFile.root node.parent};
flakeDir =
let
dir = overrides.${key}.dir or node.locked.path or "";
parentDir = parentNode.flakeDir;
in
if node ? parent then parentDir + ("/" + dir) else dir;
sourceInfo =
if overrides ? ${key} then
overrides.${key}.sourceInfo
else if node.locked.type == "path" && builtins.substring 0 1 node.locked.path != "/" then
parentNode.sourceInfo
// {
outPath = parentNode.result.outPath + ("/" + node.locked.path);
outPath = parentNode.sourceInfo.outPath + ("/" + flakeDir);
}
else
# FIXME: remove obsolete node.info.
@ -93,6 +100,8 @@ let
result
else
sourceInfo;
inherit flakeDir sourceInfo;
}
) lockFile.nodes;