I would first try to do exactly what the tutorial you linked to is doing and get that working. Because even on NixOS, you can still create user systemd units under .config (I am pretty sure atleast). Then I would also inspect so that the generated unit file looks good with systemctl cat.
systemd.user.services does not create unit files under the users .config, but instead creates global services in `/etc/systemd/user´ which get run for each user on the system. So there might be some subtle difference there.
That part shouldn’t have caused any issues in this case, by the way, so you can probably just switch back to doing it with your NixOS config.
You may want to switch to creating the service with home-manager if you use that, to prevent any other users from auto-launching this, but this will only apply to non-system users, so it shouldn’t do any harm in most cases.
Removing the env var presumably works because you install adb with NixOS as well? You could tryADB=${pkgs.android-tools}/some/subdir/adb instead.
Yep, fair enough. So to explain why your initial attempt didn’t work - the ADB variable clearly needs to point to your system’s adb binary, which scrcpy will use to know where adb is.
/home/usr/.android/adb.5037 is almost certainly not an adb binary - it looks more like a PID-file (hence the 5037 suffix, which is probably the PID of the adb process at some point in the past), which is used to track that there is a running adb server, and can be used to prevent launching multiple or help killing a server that has gone haywire. These files are usually empty, but sometimes contain some metadata.
So with your original systemd unit scrcpy was trying to execute a random text file, which obviously didn’t work.
Obviously scrcpy is also just clever enough to use the adb from your $PATH, but the tutorial you followed assumes you have android-tools installed in a prefix, presumably following on from an earlier tutorial from their site or the official android-tools installation instructions. This does not apply to distro packages, but guides like giving non-distro-specific instructions because that is more generic, and gives you more up-to-date installations on the distros that update more slowly (though in practice it typically still only works on debian/ubuntu).
If you want to, you can still point at the correct adb binary for NixOS, which is somewhere in the android-tools package, but it’s pretty pointless since you still need to have programs.adb.enable set to get the correct udev rules installed as well.