Steam/en: Difference between revisions

FuzzyBot (talk | contribs)
Updating to match new version of source page
FuzzyBot (talk | contribs)
Updating to match new version of source page
 
(2 intermediate revisions by the same user not shown)
Line 17: Line 17:
==== System setup ====
==== System setup ====


To install the [[Steam]] package and enable all the system options necessary to allow it to run, add the following to your system configuration:
To install the [[Special:MyLanguage/Steam|Steam]] package and enable all the system options necessary to allow it to run, add the following to your system configuration:


 
{{file|3=<nowiki>
{{file|/etc/nixos/configuration.nix|nix|
<nowiki>
programs.steam = {
programs.steam = {
   enable = true;
   enable = true;
Line 28: Line 26:
# Optional: If you encounter amdgpu issues with newer kernels (e.g., 6.10+ reported issues),
# Optional: If you encounter amdgpu issues with newer kernels (e.g., 6.10+ reported issues),
# you might consider using the LTS kernel or a known stable version.
# you might consider using the LTS kernel or a known stable version.
# boot.kernelPackages = pkgs.linuxPackages_lts; # Example for LTS
# boot.kernelPackages = pkgs.linuxPackages; # Example for LTS
</nowiki>
</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}}
}}


[https://news.ycombinator.com/item?id=41549030 Anecdata on kernel 6.10 issues]
[https://news.ycombinator.com/item?id=41549030 Anecdata on kernel 6.10 issues]


{{note|1=Enabling [[steam]] installs several [[unfree software|unfree packages]]. If you are using <code>allowUnfreePredicate</code> you will need to ensure that your configurations permit all of them.
{{note|1=Enabling [[Special:MyLanguage/Steam|Steam]] installs several [[Special:MyLanguage/unfree software|unfree packages]]. If you are using <code>allowUnfreePredicate</code> you will need to ensure that your configurations permit all of them.
 
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
   nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
   nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
Line 46: Line 44:
Basic Steam features can be enabled directly within the {{nixos:option|programs.steam}} attribute set:
Basic Steam features can be enabled directly within the {{nixos:option|programs.steam}} attribute set:


{{file|/etc/nixos/configuration.nix|nix|
{{file|3=<nowiki>
<nowiki>
programs.steam = {
programs.steam = {
   enable = true; # Master switch, already covered in installation
   enable = true; # Master switch, already covered in installation
Line 54: Line 51:
   # Other general flags if available can be set here.
   # Other general flags if available can be set here.
};
};
# Tip: For improved gaming performance, you can also enable GameMode:
</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}}
# programs.gamemode.enable = true;
</nowiki>
}}


{{note|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.}}
{{note|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.}}
{{note|If you are using the Steam Controller released in 2026, the Steam client has an additional dependency on hidapi, needed to correctly communicate with the controller. If you are seeing repeated errors about failed firmware updates, this is likely why. You can add the dependency directly to the Steam environment like so: <code>programs.steam.extraPackages {{=}} [pkgs.hidapi];</code>}}


== Tips and tricks ==
== Tips and tricks ==
=== Improving Performance ===
You can utilize [https://github.com/FeralInteractive/gamemode GameMode], a combination of a library and daemon for Linux that allows games to request a set of optimizations to be temporarily applied to the host operating system and/or a game process.
<syntaxhighlight lang="nixos">
programs.gamemode.enable = true;
</syntaxhighlight>


=== Gamescope Compositor / "Boot to Steam Deck" ===
=== Gamescope Compositor / "Boot to Steam Deck" ===
Line 104: Line 108:
=== Gamescope HDR ===
=== Gamescope HDR ===


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.
In order for HDR to work within gamescope, you might need to separately enable the <code>enableWsi</code> option


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">programs.gamescope = {
programs.gamescope = {
   enable = true;
   enable = true;
  enableWsi = true;
   capSysNice = false;
   capSysNice = false;
};
};</syntaxhighlight>
environment.systemPackages = with pkgs; [
  gamescope-wsi # HDR won't work without this
];
</syntaxhighlight>


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).
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).
Line 131: Line 131:
</syntaxhighlight>
</syntaxhighlight>


Then install and run `steam-tui`. You may need to log in within `steamcmd` first if `steam-tui` has issues:
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:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 225: Line 225:
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>.
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>.


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).
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 [[Special:MyLanguage/Home Manager|Home Manager]] (executed on every rebuild):
 
<syntaxhighlight lang="nix">
home.activation.fixSteamIcons = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
  for f in ~/.local/share/applications/*.desktop; do
    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>


For games running natively, the value should match the game's main executable.
For games running natively, the value should match the game's main executable.
Line 262: Line 274:
=== Steam is not updated ===
=== Steam is not updated ===


When you restart [[Steam]] after an update, it starts the old version. ([https://github.com/NixOS/nixpkgs/issues/181904 #181904])
When you restart Steam 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/&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.


Line 295: Line 307:
</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.
In the presence of both drivers, [[Special:MyLanguage/Steam|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.


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.
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 [[Special:MyLanguage/Steam|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.


=== SteamVR ===
=== SteamVR ===
Line 339: Line 351:


To find the vendor and product ID of a device [https://search.nixos.org/packages?channel=unstable&show=usbutils&from=0&size=50&sort=relevance&type=packages&query=usbutils usbutils] might be useful
To find the vendor and product ID of a device [https://search.nixos.org/packages?channel=unstable&show=usbutils&from=0&size=50&sort=relevance&type=packages&query=usbutils usbutils] might be useful
=== Steam controller mouse input issues ===
Mouse input on the controller may fail to take control of the visual cursor. In this instance, the input is still registered, but the cursor does not move. A fix for this is to preload Steam with extest. The Steam package already has an option for it:
<syntaxhighlight lang="nix">
  programs.steam = {
    extest.enable = true;
  };
</syntaxhighlight>


=== Known issues ===
=== Known issues ===
Line 344: Line 366:
"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>.
"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>.


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.
Resetting your password through the [[Special:MyLanguage/Steam|Steam]] app may fail at the CAPTCHA step repeatedly, with [[Special:MyLanguage/Steam|Steam]] itself reporting that the CAPTCHA was not correct, even though the CAPTCHA UI shows success. Resetting password through the [[Special:MyLanguage/Steam|Steam]] website should work around that.


== References ==
== References ==