1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

* Move initialisation of variables like nixConfDir from libmain to

libstore so that the Perl bindings can use it as well.  It's vital
  that the Perl bindings use the configuration file, because otherwise
  nix-copy-closure will fail with a ‘database locked’ message if the
  value of ‘use-sqlite-wal’ is changed from the default.
This commit is contained in:
Eelco Dolstra 2011-11-22 17:28:41 +00:00
parent 4e1ea17052
commit 993fa94fb4
6 changed files with 46 additions and 36 deletions

View file

@ -18,10 +18,8 @@ using namespace nix;
void doInit()
{
if (!store) {
nixStore = canonPath(getEnv("NIX_STORE_DIR", getEnv("NIX_STORE", "/nix/store")));
nixStateDir = canonPath(getEnv("NIX_STATE_DIR", "/nix/var/nix"));
nixDBPath = getEnv("NIX_DB_DIR", nixStateDir + "/db");
try {
setDefaultsFromEnvironment();
store = openStore();
} catch (Error & e) {
croak(e.what());