about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libexpr/eval.cc2
-rw-r--r--tests/lang/eval-okay-search-path.nix4
-rw-r--r--tests/lang/eval-okay-search-path.out2
3 files changed, 5 insertions, 3 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 674fa96f0bc0..ed5486f5bdac 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -186,6 +186,8 @@ EvalState::EvalState()
     searchPathInsertionPoint = searchPath.end();
     Strings paths = tokenizeString(getEnv("NIX_PATH", ""), ":");
     foreach (Strings::iterator, i, paths) addToSearchPath(*i);
+    printMsg(lvlError, nixDataDir);
+    addToSearchPath("nix=" + nixDataDir + "/nix/corepkgs");
     searchPathInsertionPoint = searchPath.begin();
 }
 
diff --git a/tests/lang/eval-okay-search-path.nix b/tests/lang/eval-okay-search-path.nix
index 02920149b5be..21485dbbf62e 100644
--- a/tests/lang/eval-okay-search-path.nix
+++ b/tests/lang/eval-okay-search-path.nix
@@ -1,3 +1,3 @@
-import <a.nix> + import <b.nix> + import <c.nix> + import <dir5/c.nix>
-
+assert builtins.pathExists <nix/buildenv>;
 
+import <a.nix> + import <b.nix> + import <c.nix> + import <dir5/c.nix>
diff --git a/tests/lang/eval-okay-search-path.out b/tests/lang/eval-okay-search-path.out
index d1cc1b4e5215..d0bc8c5e86b2 100644
--- a/tests/lang/eval-okay-search-path.out
+++ b/tests/lang/eval-okay-search-path.out
@@ -1 +1 @@
-"abc"
+"abcc"