diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-06-18 17:04:11 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-06-18 17:04:11 +0200 |
commit | 4202a3bc4e7ce687be245539f6d796226f7d9e37 (patch) | |
tree | 5831b2c010ecf1d46e3e53147a64159992577566 /src/libstore/local-fs-store.hh | |
parent | e6150de90d8db101209fc6363f5f7696ee8192c4 (diff) |
UDSRemoteStore: Support the 'root' store parameter
Useful when we're using a daemon with a chroot store, e.g.
$ NIX_DAEMON_SOCKET_PATH=/tmp/chroot/nix/var/nix/daemon-socket/socket nix-daemon --store /tmp/chroot
Then the client can now connect with
$ nix build --store unix:///tmp/chroot/nix/var/nix/daemon-socket/socket?root=/tmp/chroot nixpkgs#hello
Diffstat (limited to 'src/libstore/local-fs-store.hh')
-rw-r--r-- | src/libstore/local-fs-store.hh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/local-fs-store.hh b/src/libstore/local-fs-store.hh index 55941b771..f8b19d00d 100644 --- a/src/libstore/local-fs-store.hh +++ b/src/libstore/local-fs-store.hh @@ -18,6 +18,9 @@ struct LocalFSStoreConfig : virtual StoreConfig const PathSetting logDir{(StoreConfig*) this, false, rootDir != "" ? rootDir + "/nix/var/log/nix" : settings.nixLogDir, "log", "directory where Nix will store state"}; + const PathSetting realStoreDir{(StoreConfig*) this, false, + rootDir != "" ? rootDir + "/nix/store" : storeDir, "real", + "physical path to the Nix store"}; }; class LocalFSStore : public virtual LocalFSStoreConfig, public virtual Store @@ -34,7 +37,7 @@ public: /* Register a permanent GC root. */ Path addPermRoot(const StorePath & storePath, const Path & gcRoot); - virtual Path getRealStoreDir() { return storeDir; } + virtual Path getRealStoreDir() { return realStoreDir; } Path toRealPath(const Path & storePath) override { |