about summary refs log tree commit diff
path: root/nix-repl.cc
diff options
context:
space:
mode:
authorScott Olson <scott@solson.me>2016-02-17T00·40-0600
committerScott Olson <scott@solson.me>2016-02-17T00·40-0600
commitcfc874ee52008f523a86b5079243deabaecb62e4 (patch)
tree936d90ca11efb518c535d17c306229198e45c978 /nix-repl.cc
parentdc8b51754b1531ce15dd47cc727ea52b34680bff (diff)
Open the store before constructing EvalState.
EvalState requires the `store` global to be initialized before it is constructed
in some cases, e.g. when it needs to download a tarball for something in
NIX_PATH. Hence, this fixes #13.
Diffstat (limited to 'nix-repl.cc')
-rw-r--r--nix-repl.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/nix-repl.cc b/nix-repl.cc
index 1077f5d8f616..cdf6a79e9206 100644
--- a/nix-repl.cc
+++ b/nix-repl.cc
@@ -78,8 +78,6 @@ NixRepl::NixRepl(const Strings & searchPath)
     , staticEnv(false, &state.staticBaseEnv)
 {
     curDir = absPath(".");
-
-    store = openStore();
 }
 
 
@@ -622,6 +620,7 @@ int main(int argc, char * * argv)
             return true;
         });
 
+        store = openStore();
         NixRepl repl(searchPath);
         repl.mainLoop(files);
     });