Quick way to migrate a remote nixos instance?

I have a vps installed with nixops (in digitalocean, to be specific) now I want to move all of its content (services and data) to another vps (also in digitalocean). What’s the quickest way to do this?

I ended up manually copy several data directories in /var/lib (I had to look at nixos services source code to find out which ones). However I still wonder if there’s any better way

Not really. Depending on where the machine is hosted and the hardware compatibility, you might be able to copy the disk image (or use a provider’s snapshot/image functionality to “clone” the machine). Otherwise you could use rsync to transfer the entire filesystem (via a “rescue” system of some sort) then rerun nixos-generate-config to get a configuration that will hopefully work on the new hardware (emulated or not).