From 10b8d4d327d364fd2accaadd2ca5d2451d6a11e5 Mon Sep 17 00:00:00 2001 From: GaspardCulis Date: Sun, 27 Oct 2024 10:24:45 +0100 Subject: [PATCH] feat(Zephyrus): Added new `steam` user for steam specialization --- bin/gs.sh | 27 +++++++++++++++++++++++++++ hosts/Zephyrus/default.nix | 6 +++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100755 bin/gs.sh diff --git a/bin/gs.sh b/bin/gs.sh new file mode 100755 index 0000000..40cd18b --- /dev/null +++ b/bin/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[@]}" diff --git a/hosts/Zephyrus/default.nix b/hosts/Zephyrus/default.nix index 7445626..c77ca8a 100644 --- a/hosts/Zephyrus/default.nix +++ b/hosts/Zephyrus/default.nix @@ -75,6 +75,7 @@ "seat" "audio" "adbusers" + "gamemode" "networkmanager" ]; group = "gaspard"; @@ -94,8 +95,8 @@ }; users.users.steam = { isNormalUser = true; + createHome = true; extraGroups = [ - "wheel" "video" "seat" "audio" @@ -104,7 +105,6 @@ ]; group = "steam"; }; - programs = { gamescope = { enable = true; @@ -122,7 +122,7 @@ services.getty.autologinUser = "steam"; environment = { loginShellInit = '' - [[ "$(tty)" = "/dev/tty1" ]] && ./gs.sh + [[ "$(tty)" = "/dev/tty1" ]] && ${(pkgs.writeShellScript "gs.sh" "${builtins.readFile ../../bin/gs.sh}")} ''; }; };