aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/globals.cc
diff options
context:
space:
mode:
authorAlois Wohlschlager <alois1@gmx-topmail.de>2024-09-02 20:09:35 +0200
committerAlois Wohlschlager <alois1@gmx-topmail.de>2024-10-15 19:55:50 +0200
commit4dbbd721eb9db75d4968a624b8cb9e75e979a144 (patch)
treeceee38ee4fc2acc806c124c65a8824f7db52e5c5 /src/libstore/globals.cc
parentf6077314fa6aff862758095bb55fe844e9162a1d (diff)
treewide: consistently mark overridden settings as such
Only overridden settings are sent to the daemon, and we're going to do the same for the build hook to. It needs to be ensured that overridden settings are in fact consistently marked as such, so that they actually get sent. Change-Id: I7cd58d925702f86cf2c35ad121eb191ceb62a355
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r--src/libstore/globals.cc18
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()