diff --git a/instances/odin/configuration.nix b/instances/odin/configuration.nix index 4529655..3db715b 100644 --- a/instances/odin/configuration.nix +++ b/instances/odin/configuration.nix @@ -63,7 +63,6 @@ in }; }; - programs.gamemode = { enable = true; settings = { @@ -74,13 +73,49 @@ in }; }; - programs.steam.gamescopeSession.enable = true; programs.gamescope = { enable = true; capSysNice = true; }; services.getty.autologinUser = "tiziano"; + environment = { + systemPackages = pkgs.mangohud; + loginShellInit = + let + gs = pkgs.writeShellScript "gs" '' + set -xeuo pipefail + + gamescopeArgs=( + --adaptive-sync # VRR support + --hdr-enabled + --mangoapp # performance overlay + --rt + --steam + ) + steamArgs=( + -pipewire-dmabuf + -tenfoot + ) + mangoConfig=( + cpu_temp + gpu_temp + ram + vram + ) + mangoVars=( + MANGOHUD=1 + MANGOHUD_CONFIG="$(IFS=,; echo "''${mangoConfig[*]}")" + ) + + export "''${mangoVars[@]}" + exec gamescope "''${gamescopeArgs[@]}" -- steam "''${steamArgs[@]}" + ''; + in + '' + [[ "''$(tty) " = " /dev/tty1 " ]] && ${gs} + ''; + }; services = { avahi = { @@ -372,3 +407,8 @@ in system.stateVersion = "24.11"; } + + + + +