Steam: Difference between revisions

hardware.graphics -> hardware.opengl
Add details on booting to gamescope
Line 29: Line 29:
}}
}}


=== Gamescope Compositor / "Boot to Steam Deck" ===
Gamescope can function as a minimal desktop environment, meaning you can launch it from a TTY and have an experience very similar to the Steam Deck hardware console.
<syntaxHighlight lang=nix>
programs = {
  gamescope = {
    enable = true;
    capSysNice = true;
  };
  steam = {
    enable = true;
    gamescopeSession.enable = true;
};
hardware.xone.enable = true; # support for the xbox controller USB dongle
services.getty.autologinUser = "your_user";
environment = {
  systemPackages = pkgs.mangohud;
  loginShellInit = ''
    [[ "$(tty)" = "/dev/tty1" ]] && ./gs.sh
  '';
};
</syntaxHighlight>
==== gs.sh ====
<syntaxHighlight lang=bash>
#!/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[@]}"
</syntaxHighlight>