1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-02 15:11:00 +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 81672fee2a
commit 2ecc5156f4
2 changed files with 41 additions and 7 deletions

View file

@ -723,16 +723,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);