The derivation in nixpkgs seems to be quite up to date now (1.25 vs. 1.26 on GitHub). So I think you should be able to use that.
If you are on wayland you need to check if your desktop/compositor supports the org.freedesktop.portal.InputCapture portal. If not, I think it’s not really possible. Otherwise, try adding deskflow to system packages and open the network ports. I’m not sure if it uses TCP or UDP so I have opened both.
With this, I’ve been able to successfully connect to clients, but sadly, my compositor doesn’t support the portal, so I cannot tell you if that will get it fully working, sadly.