1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 06:52:43 +01:00

Fix emitting narHash in lock files when lazy trees are disabled

This commit is contained in:
Eelco Dolstra 2025-05-12 17:27:05 +02:00
parent 9bbe06be3a
commit 4ea5cb3832
3 changed files with 3 additions and 2 deletions

View file

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