diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-07-14 18:24:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-14 18:24:08 +0200 |
commit | ca4d5bee09df0393dd525b3cd5159a23d4683f2e (patch) | |
tree | eb1da85d12a862516f57b6bf67cf02218b772137 /src | |
parent | 73ff9b863c479c79ee2dd73039504060b8483d0d (diff) | |
parent | ff49c75502845d9938f3a479f1696ee30d3b45b1 (diff) |
Merge pull request #6804 from edolstra/fix-auto-chroot
Disable auto-chroot if $NIX_STORE_DIR is set
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/store-api.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 05353bce2..45c53f23e 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -1321,7 +1321,7 @@ std::shared_ptr<Store> openFromNonUri(const std::string & uri, const Store::Para else if (pathExists(settings.nixDaemonSocketFile)) return std::make_shared<UDSRemoteStore>(params); #if __linux__ - else if (!pathExists(stateDir) && params.empty() && getuid() != 0) { + else if (!pathExists(stateDir) && params.empty() && getuid() != 0 && !getEnv("NIX_STORE_DIR").has_value()) { /* If /nix doesn't exist, there is no daemon socket, and we're not root, then automatically set up a chroot store in ~/.local/share/nix/root. */ |