Cleanup gaming configs and fix gamescope

This commit is contained in:
Chris Toph 2025-05-19 16:32:07 -04:00
parent c3d60e2e15
commit 111352d376
3 changed files with 58 additions and 60 deletions

View file

@ -1,5 +1,3 @@
# This module just provides a customized .desktop file with gamescope args dynamically created based on the
# host's monitors configuration
{
pkgs,
config,
@ -7,50 +5,51 @@
...
}:
let
monitor = lib.head (lib.filter (m: m.primary) config.monitors);
steam-session =
let
gamescope = lib.concatStringsSep " " [
(lib.getExe pkgs.gamescope)
"--rt"
"--output-width ${toString monitor.width}"
"--output-height ${toString monitor.height}"
"--framerate-limit ${toString monitor.refreshRate}"
"--prefer-output ${monitor.name}"
"--adaptive-sync"
"--expose-wayland"
"--backend wayland"
"--force-grab-cursor"
"--steam"
# "--hdr-enabled"
];
steam = lib.concatStringsSep " " [
"steam"
#"steam://open/bigpicture"
"-forcedesktopscaling ${toString monitor.scale}"
"-nofriendsui"
"-noschatui"
];
in
pkgs.writeTextDir "share/applications/steam-session.desktop" ''
[Desktop Entry]
Name=Steam Session
Comment=Steam with Gamescope
Exec=${gamescope} -- ${steam}
Icon=steam
Type=Application
Categories=Network;FileTransfer;Game;
MimeType=x-scheme-handler/steam;x-scheme-handler/steamlink;
PrefersNonDefaultGPU = true;
'';
in
#INFO: Gamescope is REALLY broken rn, this wont work
# let
# monitor = lib.head (lib.filter (m: m.primary) config.monitors);
# steam-session =
# let
# gamescope = lib.concatStringsSep " " [
# (lib.getExe pkgs.gamescope)
# "--rt"
# "--output-width ${toString monitor.width}"
# "--output-height ${toString monitor.height}"
# "--framerate-limit ${toString monitor.refreshRate}"
# "--prefer-output ${monitor.name}"
# "--adaptive-sync"
# "--expose-wayland"
# "--backend wayland"
# "--force-grab-cursor"
# "--steam"
# # "--hdr-enabled"
# ];
# steam = lib.concatStringsSep " " [
# "steam"
# #"steam://open/bigpicture"
# "-forcedesktopscaling ${toString monitor.scale}"
# "-nofriendsui"
# "-noschatui"
# ];
# in
# pkgs.writeTextDir "share/applications/steam-session.desktop" ''
# [Desktop Entry]
# Name=Steam Session
# Comment=Steam with Gamescope
# Exec=${gamescope} -- ${steam}
# Icon=steam
# Type=Application
# Categories=Network;FileTransfer;Game;
# MimeType=x-scheme-handler/steam;x-scheme-handler/steamlink;
# PrefersNonDefaultGPU = true;
# '';
# in
{
imports = lib.custom.scanPaths ./.;
home.packages = with pkgs; [
prismlauncher
steam-session
# steam-session
# modrinth-app
(lutris.override {
extraLibraries = pkgs: [
@ -62,3 +61,6 @@ in
})
];
}
# INFO: Example working command for running gamescope
# gamescope --adaptive-sync --backend sdl --expose-wayland --force-grab-cursor --framerate-limit 120 --immediate-flips --output-height 2160 --output-width 3840 --prefer-output DP-3 --rt -- gamemoderun %command%

View file

@ -8,13 +8,6 @@
}:
let
# citron-emu = pkgs.callPackage (lib.custom.relativeToRoot "pkgs/common/citron-emu/package.nix") {
# inherit pkgs;
# };
# borgtui = pkgs.callPackage (lib.custom.relativeToRoot "pkgs/common/borgtui/package.nix") {
# inherit pkgs;
# };
homeDir = hostSpec.home;
borg-wrapper = pkgs.writeScript "borg-wrapper" ''

View file

@ -7,6 +7,13 @@
{
hardware.xone.enable = true; # xbox controller
hardware.opengl = {
enable = true;
driSupport32Bit = true;
};
services.xserver.videoDrivers = [ "amdgpu" ];
programs = {
steam = {
enable = true;
@ -31,30 +38,24 @@
;
inherit (pkgs)
gamemode
gamescope # !!!: DO NOT ADD GAMESCOPE ANYWHERE ELSE IN CONFIG, IT WILL BREAK!
gperftools
keyutils
libkrb5
libpng
libpulseaudio
libvorbis
libkrb5
keyutils
gperftools
gamemode
;
});
};
extraCompatPackages = [ pkgs.unstable.proton-ge-bin ];
gamescopeSession.enable = true;
};
#gamescope launch args set dynamically in home/<user>/common/optional/gaming
gamescope = {
enable = true;
capSysNice = true;
};
# to run steam games in game mode, add the following to the game's properties from within steam
# gamemoderun %command%
gamemode = {
enable = true;
settings = {
#see gamemode man page for settings info
general = {
softrealtime = "auto";
inhibit_screensaver = 1;
@ -73,3 +74,5 @@
};
};
}
# gamescope --adaptive-sync --backend sdl --expose-wayland --force-grab-cursor --framerate-limit 120 --immediate-flips --output-height 2160 --output-width 3840 --prefer-output DP-1 --rt -- gamemoderun %command%