mirror of
https://github.com/NixOS/nix
synced 2025-07-02 17:41:48 +02:00
Convert Settings to the new config system
This makes all config options self-documenting. Unknown or unparseable config settings and --option flags now cause a warning.
This commit is contained in:
parent
6bd9576aeb
commit
ba9ad29fdb
18 changed files with 348 additions and 546 deletions
|
@ -462,7 +462,7 @@ UserLock::UserLock()
|
|||
assert(settings.buildUsersGroup != "");
|
||||
|
||||
/* Get the members of the build-users-group. */
|
||||
struct group * gr = getgrnam(settings.buildUsersGroup.c_str());
|
||||
struct group * gr = getgrnam(settings.buildUsersGroup.get().c_str());
|
||||
if (!gr)
|
||||
throw Error(format("the group ‘%1%’ specified in ‘build-users-group’ does not exist")
|
||||
% settings.buildUsersGroup);
|
||||
|
@ -1690,10 +1690,7 @@ void DerivationGoal::startBuilder()
|
|||
|
||||
/* Are we doing a chroot build? */
|
||||
{
|
||||
string x = settings.useSandbox;
|
||||
if (x != "true" && x != "false" && x != "relaxed")
|
||||
throw Error("option ‘build-use-sandbox’ must be set to one of ‘true’, ‘false’ or ‘relaxed’");
|
||||
if (x == "true") {
|
||||
if (settings.sandboxMode == smEnabled) {
|
||||
if (get(drv->env, "__noChroot") == "1")
|
||||
throw Error(format("derivation ‘%1%’ has ‘__noChroot’ set, "
|
||||
"but that's not allowed when ‘build-use-sandbox’ is ‘true’") % drvPath);
|
||||
|
@ -1704,9 +1701,9 @@ void DerivationGoal::startBuilder()
|
|||
#endif
|
||||
useChroot = true;
|
||||
}
|
||||
else if (x == "false")
|
||||
else if (settings.sandboxMode == smDisabled)
|
||||
useChroot = false;
|
||||
else if (x == "relaxed")
|
||||
else if (settings.sandboxMode == smRelaxed)
|
||||
useChroot = !fixedOutput && get(drv->env, "__noChroot") != "1";
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue