2025-01-11 17:47:07 +02:00
|
|
|
{ pkgs, config, ... }:
|
2025-01-11 17:52:53 +02:00
|
|
|
let
|
2025-01-11 17:56:58 +02:00
|
|
|
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;
|
2025-01-11 17:52:53 +02:00
|
|
|
in
|
2024-06-06 21:12:13 +03:00
|
|
|
{
|
2024-06-06 22:16:29 +03:00
|
|
|
assertions = [
|
|
|
|
{
|
|
|
|
assertion = config.services.xserver.enable;
|
|
|
|
message = "Game streaming does not work without a desktop!";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2025-01-11 14:27:15 +02:00
|
|
|
services.sunshine = {
|
|
|
|
enable = true;
|
|
|
|
autoStart = true;
|
|
|
|
openFirewall = true;
|
2025-01-11 17:47:07 +02:00
|
|
|
settings = {
|
|
|
|
sunshine_name = "Gaming NixOS";
|
2025-01-11 17:56:58 +02:00
|
|
|
resolutions = resolutions;
|
2025-01-11 17:47:07 +02:00
|
|
|
fps = [
|
|
|
|
30
|
|
|
|
60
|
|
|
|
90
|
|
|
|
120
|
|
|
|
];
|
|
|
|
address_family = "both";
|
|
|
|
};
|
|
|
|
applications = {
|
2025-01-11 17:56:58 +02:00
|
|
|
apps = apps;
|
2025-01-11 17:47:07 +02:00
|
|
|
};
|
2025-01-11 14:27:15 +02:00
|
|
|
};
|
2024-06-06 21:12:13 +03:00
|
|
|
}
|