1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Add trust-tarballs-from-git-forges setting

If enabled, GitHub flakerefs don't require a content hash, a Git
revision is enough.

Fixes #10297.
This commit is contained in:
Eelco Dolstra 2024-03-27 14:49:45 +01:00
parent de101417eb
commit 46d9e70c20
2 changed files with 19 additions and 2 deletions

View file

@ -294,7 +294,9 @@ struct GitArchiveInputScheme : InputScheme
Git revision alone, we also require a NAR hash for
locking. FIXME: in the future, we may want to require a Git
tree hash instead of a NAR hash. */
return input.getRev().has_value() && input.getNarHash().has_value();
return input.getRev().has_value()
&& (fetchSettings.trustTarballsFromGitForges ||
input.getNarHash().has_value());
}
std::optional<ExperimentalFeature> experimentalFeature() const override