Steam: Difference between revisions

Svin (talk | contribs)
Short section in regards to udev rules for additional Gamepads and an example.
Cleanup code by utilizing the appropriate built-in Nix options. This method has been proven to work with the latest version of Gamescope.
Line 39: Line 39:
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.
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">
<syntaxhighlight lang="nix">programs = {
 
programs = {
   gamescope = {
   gamescope = {
     enable = true;
     enable = true;
Line 49: Line 47:
     enable = true;
     enable = true;
     gamescopeSession.enable = true;
     gamescopeSession.enable = true;
    #Gamescope arguments
    gamescopeSession.args = ["--xwayland-count 2" "-e" "--mangoapp" ];
   };
   };
};
};
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>


#Autologin
services.xserver.displayManager.lightdm.enable = true;
services.xserver.enable = true;
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "USERNAME_HERE";</syntaxhighlight>
=== steam-tui ===
=== steam-tui ===
If you want the steam-tui client you'll have to install it, but since it relies on <code>steamcmd</code> being set up, you'll have to set that up, just to generate the right files.
If you want the steam-tui client you'll have to install it, but since it relies on <code>steamcmd</code> being set up, you'll have to set that up, just to generate the right files.