Nixos-install fails with 'all build users are currently in use'

I am installing nixos onto an older dell poweredge r630. The box has two cpus and 28 cores in total. During the installation process, I get ‘all build users are currently in use …’. I added nix.nrBuildUsers = 100; and nix.maxJobs = 10; into the /mnt/nixos/configuration.nix with no change in behavior. I am not exactly sure what’s going on, so I could us some suggestions.

Update:
Managed to solve the problem with
nixos-install --max-jobs 1 --cores 1


Hi, did you manage to solve the problem since then?
I have the same problem:

[...]
building '/nix/store/xkqnsfpk28pk8nqf4ck1hjalny71il5h-login.defs.drv'...
error: all build users are currently in use; consider creating additional users and adding them to the 'nixbld' group

I also tried increasing nix.nrBuildUsers; and nix.maxJobs; to no avail.

trying to install from USB to a server:

[nixos@nixos:~]$ sudo inxi -M -S -z
System: Kernel: 5.4.84 x86_64 bits: 64 Console: tty 0 Distro: NixOS 20.09.2338.3d2d8f281a2 (Nightingale)
Machine: Type: Kvm System: Supermicro product: Super Server v: 0123456789 serial: <filter>
Mobo: Supermicro model: H11DSU-iN v: 2.10 serial: <filter> UEFI: American Megatrends v: 2.1 date: 02/21/2020

Update2:
On a 32 core server it also worked:
nixos-install --max-jobs 32 --cores 32

I ran into this too when installing on a HP Z820, also with 28 cores / 56 threads (dual E5-2680 v4). Interestingly, I don’t remember running into the same error when installing on a 64 core Dell R815 (quad Opteron 6380).

Looking at the configuration for a workaround I may have forgotten, I noticed back then nixos-generate-config added a line like nix.maxJobs = lib.mkDefault 64; to hardware-configuration.nix, whereas on my new install it is absent and I have max-jobs = auto in /etc/nix/nix.conf

It seems that change to nixos-generate-config has led to insufficient build users being created, since the default is

    nix.nrBuildUsers = mkDefault (lib.max 32 (if cfg.maxJobs == "auto" then 0 else cfg.maxJobs));

So, you found the right settings, but they won’t apply until after you switch to the new configuration, which requires specifying --max-jobs or -j in order for nixos-rebuild or nixos-install to succeed.

Ideally, I think nix should be patched for max-jobs = auto to take the number of build users into account…