diff options
author | alois31 <alois1@gmx-topmail.de> | 2024-10-23 15:20:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-10-23 15:20:51 +0000 |
commit | 2734a9cf94debc6baef4e7d4d9fa28cc28f5b31d (patch) | |
tree | ba6be97cc5ac268941b1c8ac10507786a720357c /src/libstore/globals.cc | |
parent | 5f1344dd8aec59ce654a0fac30b1842e2e68299c (diff) | |
parent | 689eb45630a183f0fbbd8864cb7a3c7cb1704451 (diff) |
* changes:
treewide: make more settings conditionally available
libstore/build: only send overridden settings to the build hook
treewide: consistently mark overridden settings as such
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index f43b759d2..9377ac936 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -69,12 +69,12 @@ Settings::Settings() , nixManDir(canonPath(NIX_MAN_DIR)) , nixDaemonSocketFile(canonPath(getEnvNonEmpty("NIX_DAEMON_SOCKET_PATH").value_or(nixStateDir + DEFAULT_SOCKET_PATH))) { - buildUsersGroup = getuid() == 0 ? "nixbld" : ""; - allowSymlinkedStore = getEnv("NIX_IGNORE_SYMLINK_STORE") == "1"; + buildUsersGroup.setDefault(getuid() == 0 ? "nixbld" : ""); + allowSymlinkedStore.setDefault(getEnv("NIX_IGNORE_SYMLINK_STORE") == "1"); auto sslOverride = getEnv("NIX_SSL_CERT_FILE").value_or(getEnv("SSL_CERT_FILE").value_or("")); if (sslOverride != "") - caFile = sslOverride; + caFile.setDefault(sslOverride); /* Backwards compatibility. */ auto s = getEnv("NIX_REMOTE_SYSTEMS"); @@ -82,17 +82,17 @@ Settings::Settings() Strings ss; for (auto & p : tokenizeString<Strings>(*s, ":")) ss.push_back("@" + p); - builders = concatStringsSep(" ", ss); + builders.setDefault(concatStringsSep(" ", ss)); } #if defined(__linux__) && defined(SANDBOX_SHELL) - sandboxPaths = tokenizeString<StringSet>("/bin/sh=" SANDBOX_SHELL); + sandboxPaths.setDefault(tokenizeString<StringSet>("/bin/sh=" SANDBOX_SHELL)); #endif /* chroot-like behavior from Apple's sandbox */ #if __APPLE__ - sandboxPaths = tokenizeString<StringSet>("/System/Library/Frameworks /System/Library/PrivateFrameworks /bin/sh /bin/bash /private/tmp /private/var/tmp /usr/lib"); - allowedImpureHostPrefixes = tokenizeString<StringSet>("/System/Library /usr/lib /dev /bin/sh"); + sandboxPaths.setDefault(tokenizeString<StringSet>("/System/Library/Frameworks /System/Library/PrivateFrameworks /bin/sh /bin/bash /private/tmp /private/var/tmp /usr/lib")); + allowedImpureHostPrefixes.setDefault(tokenizeString<StringSet>("/System/Library /usr/lib /dev /bin/sh")); #endif /* Set the build hook location @@ -118,10 +118,10 @@ Settings::Settings() if (!pathExists(nixExePath)) { nixExePath = getSelfExe().value_or("nix"); } - buildHook = { + buildHook.setDefault(Strings { nixExePath, "__build-remote", - }; + }); } void loadConfFile() |