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..2d9a871 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,26 @@ in { dedicatedServer.openFirewall = true; }; + # TODO: make it so that this wrapper encompasses steam's gamescope + # this would make it so we don't have to put the config each time, like this: + # gamescope --expose-wayland --adaptive-sync -f -W 1920 -H 1080 -w 1920 -h 1080 -- %command% + 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" ];