nixos/sunshine: add autoStart attr

This commit is contained in:
北雁 Cryolitia 2024-04-25 16:53:24 +08:00
parent 17d58b3057
commit 13e6ece470
No known key found for this signature in database
GPG Key ID: 3E5D1772FC8A8EDD

View File

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