NixOS is available on the image server https://images.lxd.canonical.com
You can simply create an instance like so:
lxc launch images:nixos/25.05 --vm nix
–vm is optional, you can also choose to create a LXC.
Obtain a shell:
lxc exec nix -- /bin/sh
note: If you wish to create a LXC instead, its mandatory to configure security.nesting=true