nixos-conf/services/sunshine.nix

59 lines
1.3 KiB
Nix
Raw Normal View History

2025-01-11 17:47:07 +02:00
{ pkgs, config, ... }:
2025-01-11 17:52:53 +02:00
let
2025-01-11 18:04:00 +02:00
resolution_list = [
2025-01-11 17:56:58 +02:00
"1920x1080"
"2400x1080"
"2160x1440"
"2560x1440"
"3840x2160"
];
2025-01-11 17:52:53 +02:00
in
{
2024-06-06 22:16:29 +03:00
assertions = [
{
assertion = config.services.xserver.enable;
message = "Game streaming does not work without a desktop!";
}
];
services.sunshine = {
enable = true;
autoStart = true;
openFirewall = true;
2025-01-11 17:47:07 +02:00
settings = {
sunshine_name = "Gaming NixOS";
2025-01-11 18:04:00 +02:00
resolutions = ''
[
1920x1080,
2400x1080,
2160x1440,
2560x1440,
3840x2160
]
'';
2025-01-11 18:00:29 +02:00
fps = ''
[30, 60, 90, 120]
'';
2025-01-11 17:47:07 +02:00
address_family = "both";
};
applications = {
2025-01-11 18:04:00 +02:00
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
)
resolution_list;
2025-01-11 17:47:07 +02:00
};
};
}