aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-04-08 23:19:19 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-04-08 23:19:19 +0200
commitee1254d4f50f5908fa4913253a643d14cb263c45 (patch)
tree9442b97be61b4286c0a4ae12a5a9bc54a9e0593f /src
parent6a4c7fb9759dbbf5ddaf0ebd00921d0f8045f355 (diff)
nix: Add --impure as a shorter alias of --no-pure-eval
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/primops/flake.cc2
-rw-r--r--src/nix/installables.cc7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc
index f068569a6..7cfb2038c 100644
--- a/src/libexpr/primops/flake.cc
+++ b/src/libexpr/primops/flake.cc
@@ -289,7 +289,7 @@ static std::tuple<FlakeId, std::map<FlakeId, Flake>> resolveFlake(EvalState & st
#if 0
if (evalSettings.pureEval && !flakeRef.isImmutable() && (!toplevel || !impureTopRef))
- throw Error("mutable flake '%s' is not allowed in pure mode; use --no-pure-eval to disable", flakeRef.to_string());
+ throw Error("mutable flake '%s' is not allowed in pure mode; use --impure to disable", flakeRef.to_string());
#endif
auto flake = getFlake(state, flakeRef);
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index 6d3969e95..631a849cd 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -21,6 +21,13 @@ SourceExprCommand::SourceExprCommand()
.label("file")
.description("evaluate a set of attributes from FILE (deprecated)")
.dest(&file);
+
+ mkFlag()
+ .longName("impure")
+ .description("allow access to mutable paths and repositories")
+ .handler([&](std::vector<std::string> ss) {
+ evalSettings.pureEval = false;
+ });
}
ref<EvalState> SourceExprCommand::getEvalState()