I wanted to have a simple user password for testing purposes and stumbeled over this thread
Its as simple as
{
virtualisation.vmVariant = {
# following configuration is added only when building VM with build-vm
users.users.root.initialPassword = "root";
};
}
Everything in virtualisation.vmVariant
is only applied in the VM.