From b724e83c55f456d045f119c9fcb2ef5b127d5963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vili=20Sinerv=C3=A4?= Date: Sat, 11 Jan 2025 17:56:58 +0200 Subject: [PATCH] WIP Sunshine conf --- services/sunshine.nix | 48 ++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/services/sunshine.nix b/services/sunshine.nix index a4fb443..9673341 100644 --- a/services/sunshine.nix +++ b/services/sunshine.nix @@ -1,18 +1,28 @@ { pkgs, config, ... }: let - generateApps = - resolutions: - map (resolution: { - name = "${resolution} Desktop"; - # prep-cmd = [ - # { - # do = "${pkgs.xrandr}/bin/kscreen-doctor output.DP-4.mode.2560x1440@144"; - # undo = "${pkgs.xrandr}/bin/kscreen-doctor output.DP-4.mode.3440x1440@144"; - # } - # ]; - exclude-global-prep-cmd = "false"; - auto-detach = "true"; - }) resolutions; + resolutions = [ + "1920x1080" + "2400x1080" + "2160x1440" + "2560x1440" + "3840x2160" + ]; + apps = + ( + resolutions: + map (resolution: { + name = "${resolution} Desktop"; + # prep-cmd = [ + # { + # do = "${pkgs.xrandr}/bin/kscreen-doctor output.DP-4.mode.2560x1440@144"; + # undo = "${pkgs.xrandr}/bin/kscreen-doctor output.DP-4.mode.3440x1440@144"; + # } + # ]; + exclude-global-prep-cmd = "false"; + auto-detach = "true"; + }) resolutions + ) + resolutions; in { assertions = [ @@ -28,15 +38,7 @@ in openFirewall = true; settings = { sunshine_name = "Gaming NixOS"; - resolutions = [ - [ - "1920x1080" - "2400x1080" - "2160x1440" - "2560x1440" - "3840x2160" - ] - ]; + resolutions = resolutions; fps = [ 30 60 @@ -46,7 +48,7 @@ in address_family = "both"; }; applications = { - apps = generateApps config.services.sunshine.settings.resolutions; + apps = apps; }; }; }