{ config, lib, pkgs, ... }: let loc = config.local; in { environment.systemPackages = with pkgs; lib.lists.flatten [ (asNeeded "protontricks" ["protontricks" "protontricks-launch"]) (writeShellScriptBin "run-steam-gamescope" '' export TTY=/dev/tty4 export XDG_VTNR=4 cd $HOME exec ${pkgs.kbd}/bin/openvt --switch --login --console 4 -f -- steam-gamescope '') (writeShellScriptBin "proton-env" '' export STEAM_COMPAT_LAUNCHER_SERVICE=proton export DXVK_HUD=compiler export DXVK_LOG_LEVEL=none export DXVK_DEBUG=none export VKD3D_HUD=compiler export VKD3D_CONFIG=dxr export VKD3D_DEBUG=none export VKD3D_SHADER_DEBUG=none export mesa_glthread=true xrandr --output ${loc.monitors.monitor1} --primary exec env --unset=SDL_VIDEODRIVER --unset=SDL_VIDEO_DRIVER MANGOHUD=1 gamemoderun "$@" '') ]; programs.steam = { enable = true; gamescopeSession = let width = "2560"; height = "1440"; in { enable = true; args = [ "-W ${width}" "-H ${height}" "-w ${width}" "-h ${height}" "-r 144" "-O ${loc.monitors.monitor1}" "--rt" "-f" "-e" #"-o 10" "--adaptive-sync" #"--force-grab-cursor" "--mangoapp" ]; }; }; }