aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval-settings.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval-settings.cc')
-rw-r--r--src/libexpr/eval-settings.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libexpr/eval-settings.cc b/src/libexpr/eval-settings.cc
index 422aaf8d5..93b4a5289 100644
--- a/src/libexpr/eval-settings.cc
+++ b/src/libexpr/eval-settings.cc
@@ -63,7 +63,7 @@ Strings EvalSettings::getDefaultNixPath()
};
if (!evalSettings.restrictEval && !evalSettings.pureEval) {
- add(settings.useXDGBaseDirectories ? getStateDir() + "/nix/defexpr/channels" : getHome() + "/.nix-defexpr/channels");
+ add(getNixDefExpr() + "/channels");
add(rootChannelsDir() + "/nixpkgs", "nixpkgs");
add(rootChannelsDir());
}
@@ -92,4 +92,11 @@ EvalSettings evalSettings;
static GlobalConfig::Register rEvalSettings(&evalSettings);
+Path getNixDefExpr()
+{
+ return settings.useXDGBaseDirectories
+ ? getStateDir() + "/nix/defexpr"
+ : getHome() + "/.nix-defexpr";
+}
+
}