Merge pull request #6357 from NixOS/jobs-vs-users

nix-daemon: Sanity check maxJobs vs nrBuildUsers
This commit is contained in:
Wout Mertens 2015-02-16 11:42:24 +01:00
commit 65438da88a

View file

@ -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" ]
''