Steam: Difference between revisions

imported from old wiki
m Fixed typo in Link
 
(34 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{Expansion|See notes in ->}}
<languages/>
<translate>
<!--T:1-->
[https://store.steampowered.com/ Steam] is a digital distribution platform for video games, offering a vast library for purchase, download, and management. On NixOS, Steam is generally easy to install and use, often working "out-of-the-box". It supports running many Windows games on Linux through its compatibility layer, [[<tvar name=1>#Proton</tvar>|Proton]].<ref>https://store.steampowered.com/</ref>
</translate>


This page is intended to explain how to run [[Steam]], [[Steam]] games as well as proprietary DRM-free games under NixOS.
<translate>
Steam on NixOS is very easy to install and use - it just works. But you may need to be aware of the limitations when trying to run a native Linux install of a game. It's often better to run the emulated Windows version via [https://en.m.wikipedia.org/wiki/Proton_(software) Proton].
== Installation == <!--T:2-->
A dedicated [[Games]] page lists games and reports on their successful execution on NixOS.


== Install ==
==== Shell ==== <!--T:3-->


To install the [[Steam]] package and enable all the system options necessary to allow it to run:
<!--T:4-->
To temporarily use Steam-related tools like <code>steam-run</code> (for FHS environments) or <code>steamcmd</code> (for server management or tools like steam-tui setup) in a shell environment, you can run:
</translate>


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
<syntaxhighlight lang="console">
# Apparently there are amdgpu issues in 6.10? Reference needed.
$ nix-shell -p steam-run # For FHS environment
# So you maybe need to revert on the default lts kernel.
$ nix-shell -p steamcmd  # For steamcmd
# boot.kernelPackages = pkgs.linuxPackages;
</syntaxhighlight>
 
<translate>
<!--T:5-->
This provides the tools in your current shell without adding them to your system configuration. For <code>steamcmd</code> to work correctly for some tasks (like initializing for steam-tui), you might need to run it once to generate necessary files, as shown in the [[<tvar name=1>#steam-tui</tvar>| steam-tui section]].
</translate>
 
<translate>
==== System setup ==== <!--T:6-->
 
<!--T:7-->
To install the <tvar name=steam>[[Special:MyLanguage/Steam|Steam]]</tvar> package and enable all the system options necessary to allow it to run, add the following to your system configuration:
</translate>
 
{{file|/etc/nixos/configuration.nix|nix|
<nowiki>
programs.steam = {
programs.steam = {
   enable = true;
   enable = true;
  remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
  dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
};
</nowiki>}}


{{note|Enabling [[steam]] installs several unfree packages. If you are using <code>allowUnfreePredicate</code> you will need to ensure that your configurations permit all of them.
# Optional: If you encounter amdgpu issues with newer kernels (e.g., 6.10+ reported issues),
<syntaxHighlight lang=nix>
# you might consider using the LTS kernel or a known stable version.
{
# boot.kernelPackages = pkgs.linuxPackages_lts; # Example for LTS
</nowiki>
}}
 
<translate>
<!--T:8-->
[<tvar name=link>https://news.ycombinator.com/item?id=41549030</tvar> Anecdata on kernel 6.10 issues]
</translate>
 
{{note|1=<translate><!--T:61--> Enabling <tvar name=steam>[[Special:MyLanguage/Steam|Steam]]</tvar> installs several [[<tvar name=1>Special:MyLanguage/unfree software</tvar>|unfree packages]]. If you are using <code>allowUnfreePredicate</code> you will need to ensure that your configurations permit all of them.</translate>
 
<syntaxhighlight lang="nix">
   nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
   nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
     "steam"
     "steam"
     "steam-unwrapped"
     "steam-unwrapped"
    "steam-original"
    "steam-run"
   ];
   ];
}
</syntaxhighlight>}}
</syntaxHighlight>
 
<translate>
== Configuration == <!--T:9-->
 
<!--T:10-->
Basic Steam features can be enabled directly within the <tvar name=steam_option>{{nixos:option|programs.steam}}</tvar> attribute set:
</translate>
 
{{file|/etc/nixos/configuration.nix|nix|
<nowiki>
programs.steam = {
  enable = true; # Master switch, already covered in installation
  remotePlay.openFirewall = true;  # Open ports in the firewall for Steam Remote Play
  dedicatedServer.openFirewall = true; # Open ports for Source Dedicated Server hosting
  # Other general flags if available can be set here.
};
# Tip: For improved gaming performance, you can also enable GameMode:
# programs.gamemode.enable = true;
</nowiki>
}}
}}


=== Gamescope Compositor / "Boot to Steam Deck" ===
{{note|<translate><!--T:11--> If you are using a Steam Controller or a Valve Index, Steam hardware support is implicitly enabled by <code>programs.steam.enable {{=}} true;</code> which sets {{nixos:option|hardware.steam-hardware.enable}} to true.</translate>}}
 
<translate>
== Tips and tricks == <!--T:12-->
 
=== Gamescope Compositor / "Boot to Steam Deck" === <!--T:13-->
 
<!--T:14-->
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.
</translate>


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
# Clean Quiet Boot
boot = {
  kernelParams = [
    "quiet"
    "splash"
    "console=/dev/null"
  ];
  plymouth.enable = true;
};


programs = {
programs = {
Line 43: Line 104:
     capSysNice = true;
     capSysNice = true;
   };
   };
   steam = {
   steam.gamescopeSession.enable = true;
};
 
# Gamescope Auto Boot from TTY (example)
services = {
  xserver.enable = false; # Assuming no other Xserver needed
  getty.autologinUser = <"USERNAME_HERE">;
  greetd = {
     enable = true;
     enable = true;
     gamescopeSession.enable = true;
     settings = {
      default_session = {
        command = "${lib.getExe pkgs.gamescope} -W 1920 -H 1080 -f -e --xwayland-count 2 --hdr-enabled --hdr-itm-enabled -- steam -pipewire-dmabuf -gamepadui -steamdeck -steamos3 > /dev/null 2>&1";
        user = <"USERNAME HERE">;
      };
    };
   };
   };
};
};
hardware.xone.enable = true; # support for the xbox controller USB dongle
</syntaxhighlight>
services.getty.autologinUser = "your_user";
 
environment = {
<translate>
   systemPackages = pkgs.mangohud;
=== Gamescope HDR === <!--T:62-->
   loginShellInit = ''
 
    [[ "$(tty)" = "/dev/tty1" ]] && ./gs.sh
<!--T:63-->
  '';
In order for HDR to work within gamescope, you need to separately install the <code>gamescope-wsi</code> package alongside enabling the <code>gamescope</code> program.
</translate>
 
<syntaxhighlight lang="nix">
programs.gamescope = {
   enable = true;
   capSysNice = false;
};
};
environment.systemPackages = with pkgs; [
  gamescope-wsi # HDR won't work without this
];
</syntaxhighlight>
<translate>
<!--T:64-->
Additionally, it may be necessary to force HDR in gamescope with the argument <code>--hdr-debug-force-output</code> when configuring your game's launch options in steam (see the example below).
</translate>
<syntaxhighlight lang="bash">
gamescope -W 3840 -H 2160 -r 120 -f --adaptive-sync --hdr-enabled --hdr-debug-force-output --mangoapp -- %command%
</syntaxhighlight>
<translate>
=== steam-tui === <!--T:15-->
<!--T:16-->
If you want the steam-tui client, you'll have to install it. It relies on <code>steamcmd</code> being set up, so you'll need to run <code>steamcmd</code> once to generate the necessary configuration files.
First, ensure <code>steamcmd</code> is available (e.g., via <code>nix-shell -p steamcmd</code> or by adding it to <code>environment.systemPackages</code>), then run:
</translate>
<syntaxhighlight lang="bash">
steamcmd +quit # This initializes steamcmd's directory structure
</syntaxhighlight>
<translate>
<!--T:17-->
Then install and run <code>steam-tui</code>. You may need to log in within <code>steamcmd</code> first if <code>steam-tui</code> has issues:
</translate>
<syntaxhighlight lang="bash">
# (Inside steamcmd prompt, if needed for full login before steam-tui)
# login <username> <password> <steam_2fa_code>
# quit
</syntaxhighlight>
<translate>
<!--T:18-->
After setup, <code>steam-tui</code> (if installed e.g. via <code>home.packages</code> or <code>environment.systemPackages</code>) should start fine.
=== FHS environment only === <!--T:19-->
<!--T:20-->
To run proprietary games or software downloaded from the internet that expect a typical Linux Filesystem Hierarchy Standard (FHS), you can use <code>steam-run</code>. This provides an FHS-like environment without needing to patch the software.
Note that this is not necessary for clients installed from Nixpkgs (like Minigalaxy or Itch), which already use the FHS environment as needed.
There are two options to make <code>steam-run</code> available:
1. Install <code>steam-run</code> system-wide or user-specifically:
</translate>
<syntaxhighlight lang="nix">
# In /etc/nixos/configuration.nix
environment.systemPackages = with pkgs; [
  steam-run
];
</syntaxhighlight>
<translate>
<!--T:21-->
2. If you need more flexibility or want to use an overridden Steam package's FHS environment:
</translate>
<syntaxhighlight lang="nix">
# In /etc/nixos/configuration.nix
environment.systemPackages = with pkgs; [
  (steam.override { /* Your overrides here */ }).run
];
</syntaxhighlight>
</syntaxhighlight>


==== gs.sh ====
<translate>
<syntaxHighlight lang=bash>
=== Proton === <!--T:22-->
#!/usr/bin/env bash
 
set -xeuo pipefail
<!--T:23-->
You should be able to play most Windows games using Proton. If a game has a native Linux version that causes issues on NixOS, you can force the use of Proton by selecting a specific Proton version in the game's compatibility settings in Steam.
 
<!--T:24-->
By default, Steam also looks for custom Proton versions in <code>~/.steam/root/compatibilitytools.d</code>. The environment variable <code>STEAM_EXTRA_COMPAT_TOOLS_PATHS</code> can be set to add other search paths.
 
<!--T:25-->
Declarative install of custom Proton versions (e.g. GE-Proton):
</translate>


gamescopeArgs=(
<syntaxhighlight lang="nix">
    --adaptive-sync # VRR support
programs.steam.extraCompatPackages = with pkgs; [
    --hdr-enabled
  proton-ge-bin
    --mangoapp # performance overlay
];
    --rt
</syntaxhighlight>
    --steam
)
steamArgs=(
    -pipewire-dmabuf
    -tenfoot
)
mangoConfig=(
    cpu_temp
    gpu_temp
    ram
    vram
)
mangoVars=(
    MANGOHUD=1
    MANGOHUD_CONFIG="$(IFS=,; echo "${mangoConfig[*]}")"
)


export "${mangoVars[@]}"
<translate>
exec gamescope "${gamescopeArgs[@]}" -- steam "${steamArgs[@]}"
<!--T:26-->
</syntaxHighlight>
Manual management of multiple Proton versions can be done with ProtonUp-Qt:
</translate>


<syntaxhighlight lang="nix">
environment.systemPackages = with pkgs; [
  protonup-qt
];
</syntaxhighlight>


=== steam-tui ===
<translate>
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.
=== Overriding the Steam package === <!--T:27-->
<syntaxHighlight lang=nix>
nix-shell -p steamcmd --run steamcmd
</syntaxHighlight>
And then log in: <syntaxHighlight>login <username> <password> <steam 2fa password></syntaxHighlight>
After that, steam-tui should start fine.


=== FHS environment only ===
<!--T:28-->
This will only make partial installation - provide the script, which creates the typical environment expected by proprietary games and software on regular Linux, allowing to run such software without patching. Useful if you plan to run games downloaded from the internet.
In some cases, you may need to override the default Steam package to provide missing dependencies or modify its build. Use the <code>programs.steam.package</code> option for this. Steam on NixOS runs many games in an FHS environment, but the Steam client itself or certain tools might need extra libraries.


Note that this is not necessary for clients installed from Nixpkgs (like Minigalaxy or Itch), which already use the FHS environment.
<!--T:29-->
Example: Adding Bumblebee and Primus (for NVIDIA Optimus):
</translate>


There are two options to install the FHS environment. The first is to install <syntaxhighlight lang="nix" inline>steam-run</syntaxhighlight>.
<syntaxhighlight lang="nix">
programs.steam.package = pkgs.steam.override {
  extraPkgs = pkgs': with pkgs'; [ bumblebee primus ];
};


Example snippet of <code>configuration.nix</code>:
# For 32-bit applications with Steam, if using steamFull:
<syntaxHighlight lang=nix>
# programs.steam.package = pkgs.steamFull.override { extraPkgs = pkgs': with pkgs'; [ bumblebee primus ]; };
  environment.systemPackages = with pkgs; [
</syntaxhighlight>
    steam-run
  ];
</syntaxHighlight>


Another option, in case you need more flexibility, is to directly reference the part of [[steam]] metapackage.
<translate>
<!--T:30-->
Example: Adding Xorg libraries for Gamescope (when used within Steam):
</translate>


Example snippet of <code>configuration.nix</code>:
<syntaxhighlight lang="nix">
<syntaxHighlight lang=nix>
programs.steam.package = pkgs.steam.override {
   environment.systemPackages = with pkgs; [
   extraPkgs = pkgs': with pkgs'; [
     (steam.override { /* Your overrides here */ }).run
     libXcursor
    libXi
    libXinerama
    libXScrnSaver
    libpng
    libpulseaudio
    libvorbis
    stdenv.cc.cc.lib # Provides libstdc++.so.6
    libkrb5
    keyutils
    # Add other libraries as needed
   ];
   ];
</syntaxHighlight>
};
</syntaxhighlight>


Install the game by setting the executable attribute on the installer and then running it via <code>steam-run ./your_installer.sh</code>. After installation, edit the "~/.local/share/applications/your_game.desktop" and replace the exec line from <code>Exec="/home/user/game/start.sh" ""</code> with <code>Exec="steam-run" "/home/user/game/start.sh"</code>.
<translate>
=== Fix missing icons for games in GNOME dock and activities overview === <!--T:56-->


== Adding missing dependencies ==
<!--T:57-->
GNOME uses the window class to determine the icon associated with a window. Steam currently doesn't set the required key for this in its .desktop files<ref>https://github.com/ValveSoftware/steam-for-linux/issues/12207</ref>, but you can fix this manually by editing the <code>StartupWMClass</code> key for each game's .desktop file, found under <code>~/.local/share/applications/</code>.


In some cases, you may need to override [[steam]] to provide missing dependencies.
<!--T:58-->
Use the <code>programs.steam.package</code> for this.
For games running through Proton, the value should be <code>steam_app_<game_id></code> (where <code><game_id></code> matches the value after steam://rungameid/ on the <code>Exec</code> line). To automate this with [[Home Manager]] (executed on every rebuild):
</translate>


=== Bumblebee and Primus ===
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
   programs.steam.package = pkgs.steam.override {
home.activation.fixSteamIcons = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
    withPrimus = true;
   for f in ~/.local/share/applications/*.desktop; do
    extraPackages = [ bumblebee glxinfo ];
    id=$(grep -Eo 'steam://rungameid/[0-9]+' "$f" | sed 's#.*/##') || true
   };
    [ -n "$id" ] || continue
    last=$(tail -n1 "$f" || true)
    want="StartupWMClass=steam_app_$id"
    [ "$last" = "$want" ] || echo "$want" >> "$f"
   done
'';
</syntaxhighlight>
</syntaxhighlight>


=== Java ===
<translate><!--T:59-->
<syntaxHighlight lang=nix>
For games running natively, the value should match the game's main executable.
  programs.java.enable = true;
 
  programs.steam.package = pkgs.steam.override { withJava = true; };
<!--T:60-->
</syntaxHighlight>
For example, the modified .desktop file for Valheim looks like this:
</translate>


== gamescope ==
<syntaxhighlight lang="desktop">
[Desktop Entry]
Name=Valheim
Comment=Play this game on Steam
Exec=steam steam://rungameid/892970
Icon=steam_icon_892970
Terminal=false
Type=Application
Categories=Game;
StartupWMClass=valheim.x86_64
</syntaxhighlight>


To use the [https://github.com/ValveSoftware/gamescope gamescope] compositor, which enables features such as resolution upscaling and stretched aspect ratios (such as 4:3), set
<translate>
== Troubleshooting == <!--T:31-->


<syntaxHighlight lang=nix>
<!--T:32-->
programs.steam.gamescopeSession.enable = true;
For all issues: first run <code>steam -dev -console</code> through the terminal and read the output.
</syntaxHighlight>


in your system configuration.
=== Steam fails to start. What do I do? === <!--T:33-->


== Troubleshooting ==
<!--T:65-->
One common issue preventing steam from being able to start, at least on <code>x86-64</code> platforms, is not having the following options enabled in your <code>/etc/nixos/hardware-configuration.nix</code>:
</translate>


For all issues: first run <code>steam -dev -console</code> through the terminal and read the output.
<syntaxhighlight lang="nix">
{
  hardware.graphics.enable = true;
  hardware.graphics.enable32Bit = true;
}
</syntaxhighlight>


=== Steam fails to start. What do I do? ===
<translate>
Run <code>strace steam -dev -console 2> steam.logs</code> in the terminal. In the case of a missing <code>strace</code> installation, you can temporarily install it using <code>nix-shell -p strace</code> or <code>nix run nixpkgs#strace -- steam -dev -console 2> steam.logs</code>, if [[Flakes]] are enabled. After that, create a bug report. <!-- This is vague. Where should the user create a bug report?  -->
<!--T:34-->
If you have those options set (or 32-bit isn't applicable to your system/platform) and still can't run steam, then run <code>strace steam -dev -console 2> steam.logs</code> in the terminal. If <code>strace</code> is not installed, temporarily install it using <code>nix-shell -p strace</code> or <code>nix run nixpkgs#strace -- steam -dev -console 2> steam.logs</code> (if using Flakes). After that, create a bug report. <!-- This is vague. Where should the user create a bug report?  -->


=== Steam is not updated ===
=== Steam is not updated === <!--T:35-->


When you restart [[Steam]] after an update, it starts the old version. ([https://github.com/NixOS/nixpkgs/issues/181904 #181904])
<!--T:36-->
When you restart <tvar name=steam>[[Special:MyLanguage/Steam|Steam]]</tvar> after an update, it starts the old version. ([https://github.com/NixOS/nixpkgs/issues/181904 #181904])
A workaround is to remove the user files in <code>/home/&lt;USER&gt;/.local/share/Steam/userdata</code>. This can be done with <code>rm -rf /home/&lt;USER&gt;/.local/share/Steam/userdata</code> in the terminal or with your file manager. After that, Steam can be set up again by restarting.


A workaround is to remove the user files in <code>/home/<USER>/.local/share/Steam/userdata</code>. This can be done with <code>rm -rf /home/<USER>/.local/share/Steam/userdata</code> in the terminal or with your file manager. After that, Steam can be setup again by restarting.
=== Game fails to start === <!--T:37-->


=== Game fails to start ===
<!--T:38-->
Games may fail to start because they lack dependencies (this should be added to the script, for now), or because they cannot be patched. The steps to launch a game directly are:
Games may fail to start because they lack dependencies (this should be added to the script, for now), or because they cannot be patched. The steps to launch a game directly are:
* Patch the script/binary if you can
* Patch the script/binary if you can
* Add a file named steam_appid.txt in the binary folder, with the appid as contents (it can be found in the stdout from steam)
* Add a file named steam_appid.txt in the binary folder, with the appid as contents (it can be found in the stdout from steam)
* Using the LD_LIBRARY_PATH from the nix/store steam script, with some additions, launch the game binary
* Using the LD_LIBRARY_PATH from the nix/store steam script, with some additions, launch the game binary
</translate>
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
LD_LIBRARY_PATH=~/.steam/bin32:$LD_LIBRARY_PATH:/nix/store/pfsa... blabla ...curl-7.29.0/lib:. ./Osmos.bin32 (if you could not patchelf the game, call ld.so directly with the binary as parameter)
LD_LIBRARY_PATH=~/.steam/bin32:$LD_LIBRARY_PATH:/nix/store/pfsa... blabla ...curl-7.29.0/lib:. ./Osmos.bin32 (if you could not patchelf the game, call ld.so directly with the binary as parameter)
</syntaxhighlight>
</syntaxhighlight>


Note: If a game gets stuck on Installing scripts, check for a DXSETUP.EXE process and run it manually, then restart the game launch.  
<translate>
<!--T:39-->
Note: If a game gets stuck on Installing scripts, check for a DXSETUP.EXE process and run it manually, then restart the game launch.


==== Changing the driver on AMD GPUs <!-- this is not recommended due radv drivers performing better and generally more stable than amdvlk. My suggestion remove this section. source: https://forums.guru3d.com/threads/the-mesa-radv-amdvlk-thread.449774/ -->====
==== Changing the driver on AMD GPUs <!-- this is not recommended due radv drivers performing better and generally more stable than amdvlk. My suggestion remove this section. source: https://forums.guru3d.com/threads/the-mesa-radv-amdvlk-thread.449774/ -->==== <!--T:40-->
{{note|This is not recommended because radv drivers tend to perform better and are generally more stable than amdvlk.}}
</translate>


{{note|<translate><!--T:66--> This is not recommended because radv drivers tend to perform better and are generally more stable than amdvlk.</translate>}}
<translate>
<!--T:41-->
Sometimes, changing the driver on AMD GPUs helps. To try this, first, install multiple drivers such as radv and amdvlk:
Sometimes, changing the driver on AMD GPUs helps. To try this, first, install multiple drivers such as radv and amdvlk:
</translate>


<syntaxHighlight lang=nix>
<syntaxhighlight lang="nix">
hardware.graphics = { # hardware.opengl in 24.05
hardware.graphics = {
   ## radv: an open-source Vulkan driver from freedesktop
   ## radv: an open-source Vulkan driver from freedesktop
   enable32Bit = true; # driSupport32Bit in 24.05
   enable32Bit = true;


   ## amdvlk: an open-source Vulkan driver from AMD
   ## amdvlk: an open-source Vulkan driver from AMD
Line 190: Line 382:
   extraPackages32 = [ pkgs.driversi686Linux.amdvlk ];
   extraPackages32 = [ pkgs.driversi686Linux.amdvlk ];
};
};
</syntaxHighlight>
</syntaxhighlight>


In the presence of both drivers, [[Steam]] will default to amdvlk. The amdvlk driver can be considered more correct regarding Vulkan specification implementation, but less performant than radv. However, this tradeoff between correctness and performance can sometimes make or break the gaming experience.
<translate>
<!--T:42-->
In the presence of both drivers, <tvar name=steam>[[Special:MyLanguage/Steam|Steam]]</tvar> will default to amdvlk. The amdvlk driver can be considered more correct regarding Vulkan specification implementation, but less performant than radv. However, this tradeoff between correctness and performance can sometimes make or break the gaming experience.


To "reset" your driver to radv when both radv and amdvlk are installed, set either <code>AMD_VULKAN_ICD = "RADV"</code> or <code>VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json"</code> environment variable. For example, if you start [[Steam]] from the shell, you can enable radv for the current session by running <code>AMD_VULKAN_ICD="RADV" steam</code>. If you are unsure which driver you currently use, you can launch a game with [https://github.com/flightlessmango/MangoHud MangoHud] enabled, which has the capability to show what driver is currently in use.
<!--T:43-->
To "reset" your driver to radv when both radv and amdvlk are installed, set either <code>AMD_VULKAN_ICD = "RADV"</code> or <code>VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json"</code> environment variable. For example, if you start <tvar name=steam>[[Special:MyLanguage/Steam|Steam]]</tvar> from the shell, you can enable radv for the current session by running <code>AMD_VULKAN_ICD="RADV" steam</code>. If you are unsure which driver you currently use, you can launch a game with [https://github.com/flightlessmango/MangoHud MangoHud] enabled, which has the capability to show what driver is currently in use.


=== SteamVR ===
=== SteamVR === <!--T:44-->


<!--T:45-->
The setcap issue at SteamVR start can be fixed with:
The setcap issue at SteamVR start can be fixed with:
<code>sudo setcap CAP_SYS_NICE+ep ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher</code>
=== Gamescope fails to launch when used within Steam === <!--T:46-->


<code>sudo setcap CAP_SYS_NICE+ep ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher</code>
<!--T:47-->
Gamescope may fail to start due to missing Xorg libraries. ([https://github.com/NixOS/nixpkgs/issues/214275 #214275]) To resolve this override the steam package to add them:
</translate>


=== Gamescope fails to launch when used within Steam ===
<syntaxhighlight lang="nix">
Gamescope may fail to start due to missing Xorg libraries. ([https://github.com/NixOS/nixpkgs/issues/214275 #214275]) To resolve this override the steam package to add them:<syntaxhighlight lang="nix">
programs.steam.package = pkgs.steam.override {
programs.steam.package = pkgs.steam.override {
   extraPkgs = pkgs:
   extraPkgs = pkgs': with pkgs'; [
    with pkgs; [
    libXcursor
      xorg.libXcursor
    libXi
      xorg.libXi
    libXinerama
      xorg.libXinerama
    libXScrnSaver
      xorg.libXScrnSaver
    libpng
      libpng
    libpulseaudio
      libpulseaudio
    libvorbis
      libvorbis
    stdenv.cc.cc.lib # Provides libstdc++.so.6
      stdenv.cc.cc.lib
    libkrb5
      libkrb5
    keyutils
      keyutils
     # Add other libraries as needed
     ];
  ];
};
};
</syntaxhighlight>
</syntaxhighlight>


=== Known issues ===
<translate>
"Project Zomboid" may report "couldn't determine 32/64 bit of java". This is not related to java at all, it carries its own outdated java binary that refuses to start if path contains non-Latin characters. Check for errors by directly starting local java binary within <code>steam-run bash</code>.
=== Udev rules for additional Gamepads === <!--T:48-->
 
Resetting your password through the [[Steam]] app may fail at the CAPTCHA step repeatedly, with [[Steam]] itself reporting that the CAPTCHA was not correct, even though the CAPTCHA UI shows success. Resetting password through the [[Steam]] website should work around that.
 
== Steam hardware ==
If you are using a Steam Controller or a Valve Index, you will want to add <code>hardware.steam-hardware.enable = true;</code> to your configuration.
 
Note that this is already enabled with <code>programs.steam.enable = true;</code>.
 
 
 
== Proton ==


=== NixOS 21.11 ===
<!--T:49-->
In specific scenarios gamepads, might require some additional configuration in order to function properly in the form of udev rules. This can be achieved with <code>services.udev.extraRules</code>.


From NixOS 21.11 onwards, you should be able to play most games with Proton. If there is a Linux native version you have to activate a custom compatibility layer to use the emulated Windows version. Native Linux versions may not even start due to the way NixOS work.
<!--T:50-->
The following example is for the 8bitdo Ultimate Bluetooth controller, different controllers will require knowledge of the vendor and product ID for the device:
</translate>


=== Custom Proton versions ===
By default, [[Steam]] looks for custom Proton versions such as GE-Proton in <code>~/.steam/root/compatibilitytools.d</code>. Additionally the environment variable <code>STEAM_EXTRA_COMPAT_TOOLS_PATHS</code> can be set to change or add to the paths which [[steam]] searches for custom Proton versions.
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
programs.steam.extraCompatPackages = with pkgs; [ proton-ge-bin ];
  services.udev.extraRules = ''
    SUBSYSTEM=="input", ATTRS{idVendor}=="2dc8", ATTRS{idProduct}=="3106", MODE="0660", GROUP="input"
  '';
</syntaxhighlight>
</syntaxhighlight>


=== Install Proton versions by GUI ===
<translate>
The main disadvantage of using the proton-ge-bin package is: its only one version. For using steam it may be better not to use the declaritive approach and manually install several versions of proton via protonup-qt GUI (like GloriousEggroll version GE_Proton).
<!--T:51-->
<syntaxHighlight lang=nix>
To find the vendor and product ID of a device <tvar name=usbutils>[https://search.nixos.org/packages?channel=unstable&show=usbutils&from=0&size=50&sort=relevance&type=packages&query=usbutils usbutils]</tvar> might be useful
  environment.systemPackages = with pkgs; [
 
    protonup-qt
=== Known issues === <!--T:52-->
  ];
</syntaxHighlight>


== GameMode ==
<!--T:53-->
Consider activating [[GameMode]].
"Project Zomboid" may report "couldn't determine 32/64 bit of java". This is not related to java at all, it carries its own outdated java binary that refuses to start if path contains non-Latin characters. Check for errors by directly starting local java binary within <code>steam-run bash</code>.


== See also ==
<!--T:55-->
[[Explaining the current Steam Package build]]
Resetting your password through the <tvar name=steam>[[Special:MyLanguage/Steam|Steam]]</tvar> app may fail at the CAPTCHA step repeatedly, with <tvar name=steam>[[Special:MyLanguage/Steam|Steam]]</tvar> itself reporting that the CAPTCHA was not correct, even though the CAPTCHA UI shows success. Resetting password through the <tvar name=steam>[[Special:MyLanguage/Steam|Steam]]</tvar> website should work around that.


[[VR]]
== References == <!--T:54-->
</translate>


[[Category:Applications]]
[[Category:Applications]]
[[Category:Gaming]]
[[Category:Gaming]]