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

Compute NAR hash for Git archive flakes if --no-trust-tarballs-from-git-forges

This commit is contained in:
Eelco Dolstra 2025-02-10 19:38:47 +01:00
parent 2890a2e25d
commit 3432184136
2 changed files with 8 additions and 1 deletions

View file

@ -299,6 +299,13 @@ struct GitArchiveInputScheme : InputScheme
false,
"«" + input.to_string() + "»");
if (!input.settings->trustTarballsFromGitForges)
// FIXME: computing the NAR hash here is wasteful if
// copyInputToStore() is just going to hash/copy it as
// well.
input.attrs.insert_or_assign("narHash",
accessor->hashPath(CanonPath::root).to_string(HashFormat::SRI, true));
return {accessor, input};
}