Game scope

This commit is contained in:
Reid 2026-06-08 20:38:33 -07:00
parent 856e589495
commit 74770fd01d
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
2 changed files with 21 additions and 2 deletions

View file

@ -111,6 +111,7 @@
distractions.discord.enable = true;
distractions.discord.vesktop = true;
distractions.steam.enable = true;
distractions.steam.gamescope = true;
# tools
tools.direnv.enable = true;
tools.easyeffects.enable = true;

View file

@ -6,6 +6,7 @@ let
in {
options.modules.software.distractions.steam = {
enable = mkEnableOption "Enable Steam, the game distribution software";
gamescope = mkEnableOption "Enable gamescope, a mini-compositor tuned for games";
session = mkEnableOption "Enable a Steam Deck-like session powered by gamescope";
};
@ -16,7 +17,7 @@ in {
package = pkgs.steam.override {
# required for programs to run sometimes
# see: https://github.com/NixOS/nixpkgs/issues/162562#issuecomment-1229444338
extraPkgs = (pkgs: with pkgs; [
extraPkgs = (pkgs: (optional cfg.gamescope pkgs.gamescope) ++ (with pkgs; [
libXcursor
libXi
libXinerama
@ -28,7 +29,7 @@ in {
libkrb5
keyutils
gperftools
]);
]));
extraEnv = {
# https://github.com/gloriouseggroll/proton-ge-custom
PROTON_USE_WAYLAND = "1";
@ -45,6 +46,23 @@ in {
dedicatedServer.openFirewall = true;
};
programs.gamescope = {
enable = cfg.gamescope;
args = [
"--expose-wayland"
"--adaptive-sync"
"-f"
"-W 1920"
"-H 1080"
"-w 1920"
"-h 1080"
];
};
# enable windows NT sync primitive driver (semaphores, mutexes, etc.)
# improves performance on wine 11+ and proton 11+
boot.kernelModules = [ "ntsync" ];