aboutsummaryrefslogtreecommitdiff
path: root/src/nix-env
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2023-08-11 20:32:03 +0200
committerGitHub <noreply@github.com>2023-08-11 20:32:03 +0200
commit584ff408a4e2b6eb0d74989778c640a92089b6d4 (patch)
tree12b3b1691759a901bf248433e93e9f6e0e851301 /src/nix-env
parent010dc7958e23dd8acc72a154e40a6ce5761dccdf (diff)
parent9b908fa70a07219a110ddd63ec3593c2c2269918 (diff)
Merge pull request #8735 from obsidiansystems/defexpr
Factor out `nix-defexpr` path computation
Diffstat (limited to 'src/nix-env')
-rw-r--r--src/nix-env/nix-env.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index 8dd071aa6..b112e8cb3 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -15,6 +15,7 @@
#include "value-to-json.hh"
#include "xml-writer.hh"
#include "legacy.hh"
+#include "eval-settings.hh" // for defexpr
#include <cerrno>
#include <ctime>
@@ -1399,7 +1400,7 @@ static int main_nix_env(int argc, char * * argv)
globals.instSource.type = srcUnknown;
globals.instSource.systemFilter = "*";
- Path nixExprPath = settings.useXDGBaseDirectories ? createNixStateDir() + "/defexpr" : getHome() + "/.nix-defexpr";
+ Path nixExprPath = getNixDefExpr();
if (!pathExists(nixExprPath)) {
try {