VM builds: Use -smp when enableParallelBuilding is set

This commit is contained in:
Eelco Dolstra 2017-02-21 14:53:16 +01:00
parent 012b5a5c45
commit acb2acf1f5
No known key found for this signature in database
GPG Key ID: 8170B4726D7198DE

View File

@ -242,6 +242,14 @@ rec {
eval "$preVM"
if [ "$enableParallelBuilding" = 1 ]; then
if [ ''${NIX_BUILD_CORES:-0} = 0 ]; then
QEMU_OPTS+=" -smp cpus=$(nproc)"
else
QEMU_OPTS+=" -smp cpus=$NIX_BUILD_CORES"
fi
fi
# Write the command to start the VM to a file so that the user can
# debug inside the VM if the build fails (when Nix is called with
# the -K option to preserve the temporary build directory).