From 13e6ece4709970e8f36f2713366ee9902e6ef137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E9=9B=81=20Cryolitia?= Date: Thu, 25 Apr 2024 16:53:24 +0800 Subject: [PATCH] nixos/sunshine: add autoStart attr --- nixos/modules/services/networking/sunshine.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/sunshine.nix b/nixos/modules/services/networking/sunshine.nix index c115b9cd5cf9..0749eaee95d8 100644 --- a/nixos/modules/services/networking/sunshine.nix +++ b/nixos/modules/services/networking/sunshine.nix @@ -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" ];