diff options
| author | alex <[email protected]> | 2026-10-27 16:24:15 +0100 |
|---|---|---|
| committer | alex <[email protected]> | 2026-10-27 16:24:15 +0100 |
| commit | 5d1646b93d94aaa61ecae92d8002a54ec26aa125 (patch) | |
| tree | 9bb49583566c14d38102be99439daf490a28665b | |
| parent | 488693a78bfc8a2f38645d226edc2d2a088c83ea (diff) | |
| download | nixos-5d1646b93d94aaa61ecae92d8002a54ec26aa125.tar.xz nixos-5d1646b93d94aaa61ecae92d8002a54ec26aa125.zip | |
sunshine things
| -rw-r--r-- | hosts/phosphophyllite/default.nix | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/hosts/phosphophyllite/default.nix b/hosts/phosphophyllite/default.nix index 1d19015..b7acc31 100644 --- a/hosts/phosphophyllite/default.nix +++ b/hosts/phosphophyllite/default.nix @@ -26,15 +26,18 @@ capSysAdmin = true; settings = { sunshine_name = "phosphophyllite"; - output_name = "DP-2"; - capture = "kms"; + output_name = 1; + capture = "wlr"; encoder = "software"; hevc_mode = 1; av1_mode = 1; packetsize = 1200; min_log_level = "debug"; origin_web_ui_allowed = "lan"; - global_prep_cmd = ''[{"do":"${pkgs.sudo}/bin/sudo ${pkgs.systemd}/bin/systemctl stop sunshine-poweroff.timer","undo":"${pkgs.sudo}/bin/sudo ${pkgs.systemd}/bin/systemctl start sunshine-poweroff.timer"}]''; + global_prep_cmd = ''[ + {"do":"/run/wrappers/bin/sudo ${pkgs.systemd}/bin/systemctl stop sunshine-poweroff.timer","undo":"/run/wrappers/bin/sudo ${pkgs.systemd}/bin/systemctl start sunshine-poweroff.timer"}, + {"do":"${pkgs.systemd}/bin/systemctl --user start sunshine-monitor-prep.service","undo":"${pkgs.systemd}/bin/systemctl --user start sunshine-monitor-restore.service"} + ]''; }; }; @@ -54,6 +57,22 @@ } ]; + systemd.user.services.sunshine-monitor-prep = { + description = "Disable vertical monitor for Sunshine sessions"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.bash}/bin/bash -lc '/run/current-system/sw/bin/hyprctl keyword monitor HDMI-A-1,disable || true'"; + }; + }; + + systemd.user.services.sunshine-monitor-restore = { + description = "Restore vertical monitor after Sunshine sessions"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.bash}/bin/bash -lc '/run/current-system/sw/bin/hyprctl keyword monitor HDMI-A-1,1920x1080@60,2560x0,1,transform,3 || true'"; + }; + }; + systemd.timers.sunshine-poweroff = { description = "Shutdown desktop 15 minutes after Sunshine disconnect"; timerConfig = { |
