From 88285e396fb49e9bce816510329c06a70123702f Mon Sep 17 00:00:00 2001 From: Sean Kovacs Date: Mon, 15 Dec 2025 14:36:26 -0500 Subject: [PATCH] alien: add gamescope --- system/hosts/alien/default.nix | 8 ++++++++ system/hosts/alien/gs.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 system/hosts/alien/gs.sh 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[@]}"