aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-05-06 20:54:21 -0600
committerQyriad <qyriad@qyriad.me>2024-05-06 20:54:21 -0600
commit005b2b61e671e11d0427507883f8ae66e15d939d (patch)
treed03b819ba2a9f39154950641f333b27dc8f671d1 /src
parent241b9992fd2426c686d47e131a77650bd888d3f0 (diff)
fix fallback chroot store creation after b247ef72d
When /nix/var (or, more precisely, NIX_STATE_DIR) does not exist at all, Lix falls back to creating an adhoc chroot store in XDG_DATA_HOME. b247ef72d[1] changed the way Store classes are initialized, and in the migration, a `params2` was accidentally changed to `params`. This commit restores the correct behavior, and in lieu of a single *character* fix, this commit also changes the variable name to something more reasonable. Fixes #274. [1]: b247ef72dc7bcc857288c0ddcceb3e42f76a78f1 n.b., this code might deserve some more looking at anyway. this fallback store creation throws away *all* Store params passed to openFromNonUri() in favor of an entirely new set which only contains the `root` param, which may or may not be the correct behavior Change-Id: Ibea559b88a50e6d6e75a1f87d9d7816cabb2a8f3
Diffstat (limited to 'src')
-rw-r--r--src/libstore/store-api.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 8c9940c86..f696e4c1f 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -1444,9 +1444,10 @@ std::shared_ptr<Store> openFromNonUri(const std::string & uri, const Store::Para
warn("'%s' does not exist, so Nix will use '%s' as a chroot store", stateDir, chrootStore);
} else
debug("'%s' does not exist, so Nix will use '%s' as a chroot store", stateDir, chrootStore);
- Store::Params params2;
- params2["root"] = chrootStore;
- return LocalStore::makeLocalStore(params);
+ Store::Params chrootStoreParams;
+ chrootStoreParams["root"] = chrootStore;
+ // FIXME? this ignores *all* store parameters passed to this function?
+ return LocalStore::makeLocalStore(chrootStoreParams);
}
#endif
else