diff --git a/system/hosts/alien/default.nix b/system/hosts/alien/default.nix index 74bcbd8..b8d3d2a 100644 --- a/system/hosts/alien/default.nix +++ b/system/hosts/alien/default.nix @@ -47,6 +47,14 @@ }; defaultSession = "niri"; }; + + environment = { + systemPackages = [ pkgs.mangohud ]; + loginShellInit = '' + [[ "$(tty)" = "/dev/tty1" ]] && ./gs.sh + ''; + }; + security.sudo.wheelNeedsPassword = true; hardware.nvidia = { diff --git a/system/hosts/alien/gs.sh b/system/hosts/alien/gs.sh new file mode 100644 index 0000000..40cd18b --- /dev/null +++ b/system/hosts/alien/gs.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +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[@]}"