diff --git a/scripts/nix-profile-daemon.sh.in b/scripts/nix-profile-daemon.sh.in
index e0c24954a65e5608b020f533fb4f673caace0cbf..4bc7c6fc59316b58502421c7d4629bba5fd25706 100644
--- a/scripts/nix-profile-daemon.sh.in
+++ b/scripts/nix-profile-daemon.sh.in
@@ -24,5 +24,4 @@ else
   done
 fi
 
-export NIX_PATH="nixpkgs=@localstatedir@/nix/profiles/per-user/root/channels/nixpkgs:@localstatedir@/nix/profiles/per-user/root/channels"
 export PATH="$HOME/.nix-profile/bin:@localstatedir@/nix/profiles/default/bin:$PATH"
diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in
index 0768c805a0cad2a991f2fe39b39df401845c557d..8cba1c522fa73d34b3a77d27a6b7881b99d8e5ae 100644
--- a/scripts/nix-profile.sh.in
+++ b/scripts/nix-profile.sh.in
@@ -5,11 +5,6 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
 
     NIX_LINK=$HOME/.nix-profile
 
-
-    # Append ~/.nix-defexpr/channels to $NIX_PATH so that <nixpkgs>
-    # paths work when the user has fetched the Nixpkgs channel.
-    export NIX_PATH=${NIX_PATH:+$NIX_PATH:}$HOME/.nix-defexpr/channels
-
     # Set up environment.
     # This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
     export NIX_PROFILES="@localstatedir@/nix/profiles/default $HOME/.nix-profile"
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index bb6b23ff15aabf3e1f8ecf0dee4fb3505ef3fccd..65466a0b4e7ee436a965fb815dcfd259669f5715 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -275,6 +275,17 @@ static Strings parseNixPath(const string & s)
 }
 
 
+static Strings getDefaultNixPath()
+{
+    Strings res;
+    auto add = [&](const Path & p) { if (pathExists(p)) { res.push_back(p); } };
+    add(getHome() + "/.nix-defexpr/channels");
+    add("nixpkgs=" + settings.nixStateDir + "/nix/profiles/per-user/root/channels/nixpkgs");
+    add(settings.nixStateDir + "/nix/profiles/per-user/root/channels");
+    return res;
+}
+
+
 EvalState::EvalState(const Strings & _searchPath, ref<Store> store)
     : sWith(symbols.create("<with>"))
     , sOutPath(symbols.create("outPath"))
@@ -314,7 +325,8 @@ EvalState::EvalState(const Strings & _searchPath, ref<Store> store)
 
     /* Initialise the Nix expression search path. */
     if (!evalSettings.pureEval) {
-        Strings paths = parseNixPath(getEnv("NIX_PATH").value_or(""));
+        auto nixPath = getEnv("NIX_PATH");
+        auto paths = nixPath ? parseNixPath(*nixPath) : getDefaultNixPath();
         for (auto & i : _searchPath) addToSearchPath(i);
         for (auto & i : paths) addToSearchPath(i);
     }