Merge pull request #6357 from NixOS/jobs-vs-users
nix-daemon: Sanity check maxJobs vs nrBuildUsers
This commit is contained in:
commit
65438da88a
1 changed files with 6 additions and 1 deletions
|
@ -323,7 +323,12 @@ in
|
|||
fi
|
||||
'';
|
||||
|
||||
users.extraUsers = map makeNixBuildUser (range 1 cfg.nrBuildUsers);
|
||||
users.extraUsers =
|
||||
if cfg.nrBuildUsers >= cfg.maxJobs then
|
||||
map makeNixBuildUser (range 1 cfg.nrBuildUsers)
|
||||
else
|
||||
throw "Not enough build users (${cfg.nrBuildUsers}) to support ${cfg.maxJobs} build jobs. Change nrBuildUsers or maxJobs."
|
||||
;
|
||||
|
||||
system.activationScripts.nix = stringAfter [ "etc" "users" ]
|
||||
''
|
||||
|
|
Loading…
Reference in a new issue