@igel , see Incomplete documentation for "build-vm" options (can be used only inside "virtualisation.vmVariant") · Issue #196755 · NixOS/nixpkgs · GitHub .
You must specify virtualisation.cores
inside of virtualisation.vmVariant
.
For example:
{
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
virtualisation.cores = 1;
};
}