From 07340b8be742e08f1a000475eb1f389d5525d6c8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 6 Aug 2011 18:23:38 +0000 Subject: [PATCH] * Add the Nix corepkgs to the end of the search path. This makes it possible for other Nix expressions to use corepkgs (mostly useful for the buildenv function). --- src/libexpr/eval.cc | 2 ++ tests/lang/eval-okay-search-path.nix | 4 ++-- tests/lang/eval-okay-search-path.out | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 674fa96f0..ed5486f5b 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 02920149b..21485dbbf 100644 --- a/tests/lang/eval-okay-search-path.nix +++ b/tests/lang/eval-okay-search-path.nix @@ -1,3 +1,3 @@ +assert builtins.pathExists ; + import + import + import + import - - diff --git a/tests/lang/eval-okay-search-path.out b/tests/lang/eval-okay-search-path.out index d1cc1b4e5..d0bc8c5e8 100644 --- a/tests/lang/eval-okay-search-path.out +++ b/tests/lang/eval-okay-search-path.out @@ -1 +1 @@ -"abc" +"abcc"