@@ -23,7 +23,9 @@ UDSRemoteStoreConfig::UDSRemoteStoreConfig(const std::filesystem::path & path, c
2323 : Store::Config{params}
2424 , LocalFSStore::Config{params}
2525 , RemoteStore::Config{params}
26- , path{path.empty () ? settings.nixDaemonSocketFile : path}
26+ , path{
27+ path.empty () ? getDefaultDaemonSocketPath () : path,
28+ }
2729{
2830}
2931
@@ -34,10 +36,8 @@ std::string UDSRemoteStoreConfig::doc()
3436 ;
3537}
3638
37- // A bit gross that we now pass empty string but this is knowing that
38- // empty string will later default to the same nixDaemonSocketFile. Why
39- // don't we just wire it all through? I believe there are cases where it
40- // will live reload so we want to continue to account for that.
39+ // Empty authority will default to the per-store socket path based on
40+ // stateDir.
4141UDSRemoteStoreConfig::UDSRemoteStoreConfig (const Params & params)
4242 : UDSRemoteStoreConfig(" " , params)
4343{
@@ -56,7 +56,7 @@ StoreReference UDSRemoteStoreConfig::getReference() const
5656 /* We specifically return "daemon" here instead of "unix://" or "unix://${path}"
5757 * to be more compatible with older versions of nix. Some tooling out there
5858 * tries hard to parse store references and it might not be able to handle "unix://". */
59- if (path == settings. nixDaemonSocketFile )
59+ if (path == getEnvOsNonEmpty ( OS_STR ( " NIX_DAEMON_SOCKET_PATH " )). value_or ( getDefaultDaemonSocketPath (). string ()) )
6060 return {
6161 .variant = StoreReference::Daemon{},
6262 .params = getQueryParams (),
0 commit comments