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
This commit is contained in:
Chris Toph 2025-06-30 22:23:06 -04:00
parent 3b6d75d41c
commit 89296ce75b
2 changed files with 69 additions and 13 deletions

View file

@ -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}'';
};
};
};

View file

@ -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";
};
};
};
};
}