Merge pull request #306761 from Cryolitia/sunshine

nixos/sunshine: add autoStart attr
This commit is contained in:
Aleksana 2024-04-26 16:49:15 +08:00 committed by GitHub
commit c1c2a084c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -32,6 +32,13 @@ in
Whether to give the Sunshine binary CAP_SYS_ADMIN, required for DRM/KMS screen capture.
'';
};
autoStart = mkOption {
type = bool;
default = true;
description = ''
Whether sunshine should be started automatically.
'';
};
settings = mkOption {
default = { };
description = ''
@ -135,7 +142,7 @@ in
systemd.user.services.sunshine = {
description = "Self-hosted game stream host for Moonlight";
wantedBy = [ "graphical-session.target" ];
wantedBy = mkIf cfg.autoStart [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];