Setting up VM images with nixos is incredibly powerful when coupled with declarative nature of nix language itself.
I am using it for running homelab type services and lab type setups. Here is how I have it working for me:
Create the VM
This is a snippet from a shell script I use
name=nixos1
img=nixos/24.05
cpu=4
mem=8
disk=100
incus launch images:$img $name \
--vm \
-c limits.cpu=4 \
-c limits.memory=${mem}GiB \
-c security.secureboot=false \
--device root,size=${disk}GiB
Assuming you have some nixos configuration, you can upload the config
and update the VM.