Running sunshine in NixOS with monitor off?

It's basically the title. I have a gaming desktop computer that I'd like to use with sunshine to stream games to moonlight clients.

I have everything working pretty much perfectly at this point except I can't shut the monitor off without interrupting the stream, which I've learned is because Niri doesn't seam to support headless operation.

So then I added gamescopeSession = true to the steam part of the config, and I can easily sign into the gamescope steam session, but then sunshine doesn't work despite it being set as autoStart in the config (and it autostarts in Niri).

I don't really have any kind of experience with this kind of thing. I've tried to search through the NixOS wiki and even resorted to asking AI but they just keep pulling random things out of their @$$es.

So I guess the question is, what would you do? I want to be able to just turn the computer on (without turning on the monitor) and from there connect to sunshine via a moonlight client either to the desktop or to a gaming session through gamescope and steam (I pretty much only use steam).

I had considered trying to set up Sway as a systemd user instance but the sway github does not recommend this.

In case you want to see the flake: https://codeberg.org/JacoXarles/nix

Thanks everyone!

Posted Jul 23, 2026, 4:53 AM UTC

199
Loading comments…