How to start a daemon properly in NixOS?

Only the shell used by fusuma needs it, technically, but I think the easiest way to ensure it has what it needs is by giving the service the variables - which will therefore launch fusuma with those variables, which in turn will run shells with them.

I don’t know whether the script mentioned by the arch wiki runs on NixOS, or whether you’re even actually using a user service, that part is missing from your snippet.

If you’d like to test whether this is really the issue, just hardcode DISPLAY=:0.0; This is usually the right one, since most of the time you’re only running one X server with one display. You can confirm the correct value to hardcode by just printing the variable to your shell, and rebuilding without restarting X.