1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-09 02:21:02 +01:00

Add lazy-locks setting

This determines whether lock file entries omit a NAR hash. They're
included by default to make lazy trees compatible with older clients.
This commit is contained in:
Eelco Dolstra 2025-06-13 16:56:13 +02:00
parent b3b5dd6665
commit 802f585406
3 changed files with 19 additions and 5 deletions

View file

@ -92,7 +92,7 @@ StorePath EvalState::mountInput(
storeFS->mount(CanonPath(store->printStorePath(storePath)), accessor);
if (requireLockable && (!settings.lazyTrees || !input.isLocked()) && !input.getNarHash())
if (requireLockable && (!settings.lazyTrees || !settings.lazyLocks || !input.isLocked()) && !input.getNarHash())
input.attrs.insert_or_assign("narHash", getNarHash()->to_string(HashFormat::SRI, true));
if (originalInput.getNarHash() && *getNarHash() != *originalInput.getNarHash())