An example on how to build NixOS VM images by leveraging Packer.
-
To build the image make sure you have QEMU Packer builder configured.
-
Customize
configuration/configuration.nixas you please. -
Run
packer build nixos22.11.pkr.hclthe build KVM image.
You can set the root password through a variable, like this
packer build -var 'root_password=qwertz1234' nixos22.11.pkr.hcl.