We do not use the Nextcloud package from NixOS, instead we set up Nginx, PHP and Mariadb and we install Nextcloud itself by hand in /data/web. This makes it easy to import the installation from the old VPS and upgrade it independently of NixOS.
PHP settings are taken from the NixOS wiki at <https://nixos.wiki/wiki/Nginx>.
This is a NixOS system definition for a minimal working system with only an SSH server.