dot.nix/hosts/global/common/gaming.nix
Chris Toph 894cc4444c Enhances gaming sessions with gamescope commands
- Refactors monitor handling by computing primary monitor parameters
- Introduces new shell scripts for gamescope-run and steam-session integration
- Updates desktop entries to launch Steam and Heroic within gamescope
- Removes deprecated gaming session script from the global gaming configuration
- Simplifies monitor options and adds primary monitor utility in shared libraries
- Adjusts host-specific monitor configurations and README hardware details
2025-06-20 17:41:08 -04:00

89 lines
1.9 KiB
Nix

{
pkgs,
lib,
config,
inputs,
...
}:
{
hardware.graphics = {
enable = true;
enable32Bit = true;
};
# AMDgpu tool
environment.systemPackages = with pkgs; [
lact
gamescope
# gamescope-wsi
];
systemd = {
packages = with pkgs; [ lact ];
services.lactd.wantedBy = [ "multi-user.target" ];
};
programs = {
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
protontricks = {
enable = true;
package = pkgs.protontricks;
};
# PKGs needed for gamescope to work within steam
package = pkgs.steam.override {
extraPkgs =
pkgs:
(builtins.attrValues {
inherit (pkgs.xorg)
libXcursor
libXi
libXinerama
libXScrnSaver
;
inherit (pkgs.stdenv.cc.cc)
lib
;
inherit (pkgs)
gamemode
mangohud
gperftools
keyutils
libkrb5
libpng
libpulseaudio
libvorbis
;
});
};
extraCompatPackages = [ pkgs.unstable.proton-ge-bin ];
gamescopeSession.enable = true;
};
gamemode = {
enable = true;
settings = {
general = {
softrealtime = "auto";
inhibit_screensaver = 1;
renice = 15;
};
gpu = {
apply_gpu_optimisations = "accept-responsibility";
gpu_device = 1; # The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/
amd_performance_level = "high";
};
custom = {
start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'";
end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'";
};
};
};
};
}