Deploy a minimum NixOS VM on Proxmox at speed
Note
The image can be build locally, or by using the included GitHub action.
Credit to @Mayniklas, @NixOS-Pilots and inspired by Mayniklas/nixos-proxmox.
# build VMA image
nix build .#proxmox-image
Upload the image to a location, that is accessible by Proxmox.
# scp build artifact to Proxmox
scp ./result/*.vma.zst root@<proxmox-ip>:/root/
Create a VM using qmrestore
# import the VM from VMA image
# unique is required to randomize the MAC address of the network interface
# storage is the name of the storage, where we create the VM
qmrestore ./vzdump-qemu-nixos-*.vma.zst 999 --unique true --storage <storage, e.g. local-lvm>
nixos-rebuild switch --flake .#proxmox-host