mirror of
https://github.com/NixOS/nix
synced 2025-06-25 23:11:16 +02:00
Enforce use of immutable flakes in pure mode
... plus a temporary hack to allow impure flakes at top-level for the default installation source.
This commit is contained in:
parent
ba05f29838
commit
272b58220d
6 changed files with 46 additions and 19 deletions
|
@ -22,9 +22,6 @@ GitInfo exportGit(ref<Store> store, const std::string & uri,
|
|||
std::optional<std::string> ref, std::string rev,
|
||||
const std::string & name)
|
||||
{
|
||||
if (evalSettings.pureEval && rev == "")
|
||||
throw Error("in pure evaluation mode, 'fetchGit' requires a Git revision");
|
||||
|
||||
if (!ref && rev == "" && hasPrefix(uri, "/") && pathExists(uri + "/.git")) {
|
||||
|
||||
bool clean = true;
|
||||
|
@ -218,6 +215,9 @@ static void prim_fetchGit(EvalState & state, const Pos & pos, Value * * args, Va
|
|||
// whitelist. Ah well.
|
||||
state.checkURI(url);
|
||||
|
||||
if (evalSettings.pureEval && rev == "")
|
||||
throw Error("in pure evaluation mode, 'fetchGit' requires a Git revision");
|
||||
|
||||
auto gitInfo = exportGit(state.store, url, ref, rev, name);
|
||||
|
||||
state.mkAttrs(v, 8);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue