From 74770fd01db40528d17f877a4b37e7ddbd0bcf13 Mon Sep 17 00:00:00 2001 From: reidlab Date: Mon, 8 Jun 2026 20:38:33 -0700 Subject: [PATCH] Game scope --- hosts/flubber-machine/default.nix | 1 + modules/software/distractions/steam.nix | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/hosts/flubber-machine/default.nix b/hosts/flubber-machine/default.nix index 08532f4..b7d5e61 100755 --- a/hosts/flubber-machine/default.nix +++ b/hosts/flubber-machine/default.nix @@ -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; diff --git a/modules/software/distractions/steam.nix b/modules/software/distractions/steam.nix index bd127c6..1c4d58d 100644 --- a/modules/software/distractions/steam.nix +++ b/modules/software/distractions/steam.nix @@ -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" ];