If you wish to run [[NixOS]] container on a NixOS host, checkout NixOS’s declarative container management which may be a more appealing option than LXD. For VMs, see microvm.nix.