Stabilize sunshine

This commit is contained in:
Giulio De Pasquale 2024-10-31 12:48:45 +00:00
parent f7f1da25ed
commit 60eccadaa8

View File

@ -39,11 +39,6 @@ in
hardware = { hardware = {
pulseaudio.enable = true; pulseaudio.enable = true;
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
nvidia = { nvidia = {
modesetting.enable = true; modesetting.enable = true;
@ -54,7 +49,10 @@ in
}; };
}; };
programs.steam.enable = true; programs.steam = {
enable = true;
gamescopeSession.enable = true;
};
security = { security = {
polkit.extraConfig = '' polkit.extraConfig = ''
@ -71,6 +69,12 @@ in
rtkit.enable = true; rtkit.enable = true;
}; };
systemd.user.services.sunshine = {
serviceConfig = {
Restart = pkgs.lib.mkForce "always";
};
};
services = { services = {
sunshine = { sunshine = {
enable = true; enable = true;
@ -98,14 +102,13 @@ in
apps = [ apps = [
{ {
name = "Steam"; 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 = [ prep-cmd = [
{ {
do = "${resolutionScript}/bin/resolution.sh $SUNSHINE_CLIENT_WIDTH $SUNSHINE_CLIENT_HEIGHT $SUNSHINE_CLIENT_FPS"; do = ''${pkgs.bash}/bin/bash -c "${resolutionScript}/bin/resolution.sh ''${SUNSHINE_CLIENT_WIDTH} ''${SUNSHINE_CLIENT_HEIGHT}" ''${SUNSHINE_CLIENT_FPS}"'';
undo = "${pkgs.procps}/bin/pkill -KILL steam"; undo = ''${pkgs.bash}/bin/bash -c "${pkgs.procps}/bin/pkill gamescope; ${pkgs.procps}/bin/pkill sunshine"'';
} }
]; ];
auto-detach = "true";
} }
]; ];
}; };