From 60eccadaa8ff283a1eb67e508d4e671c3cbd2b56 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Thu, 31 Oct 2024 12:48:45 +0000 Subject: [PATCH] Stabilize sunshine --- hosts/architect/sunshine.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/hosts/architect/sunshine.nix b/hosts/architect/sunshine.nix index 38b15c2..6ea5910 100644 --- a/hosts/architect/sunshine.nix +++ b/hosts/architect/sunshine.nix @@ -39,11 +39,6 @@ in hardware = { pulseaudio.enable = true; - opengl = { - enable = true; - driSupport = true; - driSupport32Bit = true; - }; nvidia = { modesetting.enable = true; @@ -54,7 +49,10 @@ in }; }; - programs.steam.enable = true; + programs.steam = { + enable = true; + gamescopeSession.enable = true; + }; security = { polkit.extraConfig = '' @@ -71,6 +69,12 @@ in rtkit.enable = true; }; + systemd.user.services.sunshine = { + serviceConfig = { + Restart = pkgs.lib.mkForce "always"; + }; + }; + services = { sunshine = { enable = true; @@ -98,14 +102,13 @@ in apps = [ { name = "Steam"; - detached = [ "${pkgs.steam}/bin/steam" ]; + cmd = ''${pkgs.bash}/bin/bash -c "${pkgs.gamescope}/bin/gamescope -f --hdr-enabled -e -W ''${SUNSHINE_CLIENT_WIDTH} -H ''${SUNSHINE_CLIENT_HEIGHT} -r ''${SUNSHINE_CLIENT_FPS} -- ${pkgs.steam}/bin/steam"''; prep-cmd = [ { - do = "${resolutionScript}/bin/resolution.sh $SUNSHINE_CLIENT_WIDTH $SUNSHINE_CLIENT_HEIGHT $SUNSHINE_CLIENT_FPS"; - undo = "${pkgs.procps}/bin/pkill -KILL steam"; + do = ''${pkgs.bash}/bin/bash -c "${resolutionScript}/bin/resolution.sh ''${SUNSHINE_CLIENT_WIDTH} ''${SUNSHINE_CLIENT_HEIGHT}" ''${SUNSHINE_CLIENT_FPS}"''; + undo = ''${pkgs.bash}/bin/bash -c "${pkgs.procps}/bin/pkill gamescope; ${pkgs.procps}/bin/pkill sunshine"''; } ]; - auto-detach = "true"; } ]; };