From 89296ce75bc39f63de4ba9d4cab633b0ce0da079 Mon Sep 17 00:00:00 2001 From: Chris Toph Date: Mon, 30 Jun 2025 22:23:06 -0400 Subject: [PATCH] Refactor gaming wrappers & desktop entries - Convert wrappers for steam, heroic, and lutris to use defaults - Update desktop entries with enhanced action options - Introduce new launcher config in gojo for The Alters with proper environment --- home/global/common/gaming/gamescope.nix | 30 +++++++------- home/hosts/gojo/config/play.nix | 52 +++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 home/hosts/gojo/config/play.nix diff --git a/home/global/common/gaming/gamescope.nix b/home/global/common/gaming/gamescope.nix index 99f5ce7..8c3749c 100644 --- a/home/global/common/gaming/gamescope.nix +++ b/home/global/common/gaming/gamescope.nix @@ -25,7 +25,7 @@ }; wrappers = { - steam = { + steam = lib.mkDefault { enable = true; command = "${lib.getExe osConfig.programs.steam.package} -bigpicture -tenfoot"; extraOptions = { @@ -37,7 +37,7 @@ }; }; - heroic = { + heroic = lib.mkDefault { enable = true; package = pkgs.heroic; # No special package configured by play.nix extraOptions = { @@ -45,7 +45,7 @@ }; }; - lutris = { + lutris = lib.mkDefault { enable = true; package = osConfig.play.lutris.package; extraOptions = { @@ -58,9 +58,10 @@ }; }; - # Override default desktop entries to use gamescope wrappers xdg.desktopEntries = { - steam = { + + ## Steam and Games ## + steam = lib.mkDefault { name = "Steam"; comment = "Steam Big Picture in Gamescope Session"; exec = "${lib.getExe config.play.wrappers.steam.wrappedPackage}"; @@ -80,14 +81,19 @@ Keywords = "gaming;"; }; actions = { - bigpicture = { + client = { name = "Steam Client (No Gamescope)"; - exec = "${lib.getExe (config.play.steam.package or pkgs.steam)}"; + exec = "${lib.getExe osConfig.programs.steam.package}"; + }; + steamdeck = { + name = "Steam Deck (Gamescope)"; + exec = "${lib.getExe config.play.wrappers.steam.wrappedPackage} -steamdeck"; }; }; }; - "com.heroicgameslauncher.hgl" = { + ## Other Launchers ## + "com.heroicgameslauncher.hgl" = lib.mkDefault { name = "Heroic Games Launcher"; comment = "Heroic in Gamescope Session"; exec = "${lib.getExe config.play.wrappers.heroic.wrappedPackage}"; @@ -103,10 +109,10 @@ }; }; - "net.lutris.Lutris" = { + "net.lutris.Lutris" = lib.mkDefault { name = "Lutris"; comment = "Video Game Preservation Platform"; - exec = "${lib.getExe (config.play.lutris.package or pkgs.lutris)} %U"; + exec = "${lib.getExe osConfig.play.lutris.package} %U"; icon = "net.lutris.Lutris"; type = "Application"; terminal = false; @@ -126,9 +132,7 @@ broken-exposed = { name = "Lutris (Gamescope BROKEN; Exposed Wayland)"; - exec = ''${lib.getExe config.play.gamescoperun.package} -x "--force-windows-fullscreen --expose-wayland" ${ - lib.getExe (config.play.lutris.package or pkgs.lutris) - }''; + exec = ''${lib.getExe config.play.gamescoperun.package} -x "--force-windows-fullscreen --expose-wayland" ${lib.getExe osConfig.play.lutris.package}''; }; }; }; diff --git a/home/hosts/gojo/config/play.nix b/home/hosts/gojo/config/play.nix new file mode 100644 index 0000000..18006a0 --- /dev/null +++ b/home/hosts/gojo/config/play.nix @@ -0,0 +1,52 @@ +{ + config, + osConfig, + lib, + pkgs, + inputs, + ... +}: +{ + + play = { + wrappers = { + alters = { + enable = true; + command = "${lib.getExe osConfig.programs.steam.package} steam://rungameid/1601570 -windowed -tenfoot"; + extraOptions = { + "steam" = true; + "disable-layers" = true; + }; + environment = { + __GL_SHADER_DISK_CACHE_SKIP_CLEANUP = 1; + PROTON_USE_SDL = 1; + STEAM_FORCE_DESKTOPUI_SCALING = 1; + STEAM_GAMEPADUI = 1; + WAYLANDDRV_RAWINPUT = 1; + }; + }; + }; + + # Override default desktop entries to use gamescoperun wrappers/launchers + home.activation.removeExistingDesktopFiles = lib.hm.dag.entryBefore [ "writeBoundary" ] '' + rm -f "${config.home.homeDirectory}/.local/share/applications/The Alters.desktop" + ''; + + xdg.desktopEntries = { + "The Alters" = { + name = "The Alters"; + comment = "A game about life, choices, and the people we meet"; + exec = "${lib.getExe config.play.wrappers.alters.wrappedPackage}"; + icon = "steam_icon_1601570"; + type = "Application"; + terminal = false; + categories = [ "Game" ]; + actions = { + regular = { + name = "The Alters (No Gamescope)"; + exec = "${lib.getExe osConfig.programs.steam.package} steam://rungameid/1601570 -windowed -nochatui -nofriendsui -silent"; + }; + }; + }; + }; +}