1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-13 14:02:42 +01:00

lockFlake(): When updating a lock, respect the input's lock file

This commit is contained in:
Eelco Dolstra 2025-07-09 17:00:49 +02:00
parent 3cfecd9a80
commit 95437b90fc
2 changed files with 41 additions and 7 deletions

View file

@ -715,16 +715,12 @@ LockedFlake lockFlake(
Finally cleanup([&]() { parents.pop_back(); });
/* Recursively process the inputs of this
flake. Also, unless we already have this flake
in the top-level lock file, use this flake's
own lock file. */
flake, using its own lock file. */
nodePaths.emplace(childNode, inputFlake.path.parent());
computeLocks(
inputFlake.inputs, childNode, inputAttrPath,
oldLock
? std::dynamic_pointer_cast<const Node>(oldLock)
: readLockFile(state.fetchSettings, inputFlake.lockFilePath()).root.get_ptr(),
oldLock ? followsPrefix : inputAttrPath,
readLockFile(state.fetchSettings, inputFlake.lockFilePath()).root.get_ptr(),
inputAttrPath,
inputFlake.path,
false);
}