I wrote how to install Nix in a Qube
Nix template is more interesting.
I didn’t find any Nix related template even in the community testing repository
I installed Guix OS in a HVM, but in fact it’s more useful in an AppVM, see the unman’s guide:
Nix is a package system, not an OS, so you can adapt the solene’s guide to a dedicated Nix templateVM (by cloning a Debian or Fedora templateVM).
I didn’t use Guix foreign for a long time, but using it in an AppVM (non-guix) should be pretty similar to Nix in stand alone right?
Using Nix in a template seems tricky to me, because you may want to provide a pre-filled store in the template, but you may also want to have additional changes in an AppVM, I don’t think the persistent mode allow to merge a template directory + a persistent directory
This could be improved soon when the stacking nix store will be available, see Super Colliding Nix Stores - Announcements - NixOS Discourse and my comment Super Colliding Nix Stores - #6 by Solene - Announcements - NixOS Discourse for the use case