Split out of https://github.com/hebasto/bitcoin/pull/316/files#r1711537463
nproc is linux only, getconf _NPROCESSORS_ONLN is used in the Linux kernel for the same task (works on Mac as well): https://github.com/torvalds/linux/blob/master/tools/testing/selftests/rcutorture/bin/kvm-build.sh#L44
On linux:
# nproc
8
root@rescue ~ # getconf _NPROCESSORS_ONLN
8
Note that in the productivity doc the recommended core count is one less than before, seems simpler to me this way.