about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2017-03-08T13·46-0500
committerShea Levy <shea@shealevy.com>2017-03-08T13·46-0500
commit93f863be9626e5455458abf9e449586270e98163 (patch)
treedd56f2d5ef593755bed49cbb1609e8b47980b719 /src/libexpr/primops.cc
parent121a407eecd4a176adbfbacf49735b3dfc303e79 (diff)
Add option to disable import-from-derivation completely, even if the drv is already realized
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 5a570cefb2..93097f3d1b 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -59,6 +59,8 @@ void EvalState::realiseContext(const PathSet & context)
             drvs.insert(decoded.first + "!" + decoded.second);
     }
     if (!drvs.empty()) {
+        if (!settings.enableImportFromDerivation)
+            throw EvalError(format("attempted to realize ‘%1%’ during evaluation but 'allow-import-from-derivation' is false") % *(drvs.begin()));
         /* For performance, prefetch all substitute info. */
         PathSet willBuild, willSubstitute, unknown;
         unsigned long long downloadSize, narSize;