diff --git a/machines/AMD-Workstation/default.nix b/machines/AMD-Workstation/default.nix index e0cb60f..a5f5694 100644 --- a/machines/AMD-Workstation/default.nix +++ b/machines/AMD-Workstation/default.nix @@ -16,7 +16,7 @@ customProfiles.hoyo customProfiles.minecraft customProfiles.nicotine - # customProfiles.sunshine + customProfiles.sunshine customProfiles.wine-games customProfiles.ollama diff --git a/profiles/applications/games/sunshine.nix b/profiles/applications/games/sunshine.nix new file mode 100644 index 0000000..71d5b42 --- /dev/null +++ b/profiles/applications/games/sunshine.nix @@ -0,0 +1,16 @@ +{ ... }: { + services.sunshine = { + enable = true; + autoStart = true; + capSysAdmin = true; + openFirewall = true; + }; + + # boot.kernelModules = [ "uinput" ]; + + # services.udev.extraRules = '' + # KERNEL=="uinput", GROUP="input", MODE="0660" OPTIONS+="static_node=uinput" + # ''; + + persist.state.homeDirectories = [ ".config/sunshine" ]; +} diff --git a/profiles/applications/sunshine.nix b/profiles/applications/sunshine.nix deleted file mode 100644 index b13003a..0000000 --- a/profiles/applications/sunshine.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, pkgs, ... }: { - boot.kernelModules = [ "uinput" ]; - - services.udev.extraRules = '' - KERNEL=="uinput", GROUP="input", MODE="0660" OPTIONS+="static_node=uinput" - ''; - - environment.systemPackages = [ pkgs.sunshine ]; - - security.wrappers.sunshine = { - owner = "root"; - group = "root"; - capabilities = "cap_sys_admin+p"; - source = "${pkgs.sunshine}/bin/sunshine"; - }; - - systemd.user.services.sunshine = { - description = "sunshine"; - wantedBy = [ "graphical-session.target" ]; - serviceConfig = { - ExecStart = "${config.security.wrapperDir}/sunshine"; - }; - }; - - networking.firewall = { - allowedTCPPorts = [ 47984 47989 47990 48010 ]; - allowedUDPPorts = [ 47998 47999 48000 48002 48010 ]; - }; - - persist.state.homeDirectories = [ ".config/sunshine" ]; -}