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

Complain when using --pure-eval with --file

This never worked and cannot work because in pure eval mode, the
evaluator doesn't have access to the file.
This commit is contained in:
Eelco Dolstra 2025-04-30 22:29:27 +02:00
parent 9099b7dd87
commit d46f741cdf
2 changed files with 8 additions and 1 deletions

View file

@ -491,7 +491,11 @@ Installables SourceExprCommand::parseInstallables(
throw UsageError("'--file' and '--expr' are exclusive");
// FIXME: backward compatibility hack
if (file) evalSettings.pureEval = false;
if (file) {
if (evalSettings.pureEval && evalSettings.pureEval.overridden)
throw UsageError("'--file' is not compatible with '--pure-eval'");
evalSettings.pureEval = false;
}
auto state = getEvalState();
auto vFile = state->allocValue();