Steam: Difference between revisions
m Adjust the position of page translation tags |
Marked this version for translation |
||
| (14 intermediate revisions by 7 users not shown) | |||
| Line 2: | Line 2: | ||
<translate> | <translate> | ||
<!--T:1--> | <!--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, [[#Proton|Proton]].<ref>https://store.steampowered.com/</ref | <tvar name=steam>[https://store.steampowered.com/ Steam]</tvar> 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=proton>[[#Proton|Proton]]</tvar>.<ref>https://store.steampowered.com/</ref> | ||
== Installation == <!--T:2--> | == Installation == <!--T:2--> | ||
==== Shell ==== <!--T:3--> | ==== Shell ==== <!--T:3--> | ||
<!--T:4--> | <!--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: | 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: | ||
| Line 25: | Line 19: | ||
<translate> | <translate> | ||
<!--T:5--> | <!--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 [[#steam-tui| steam-tui section]]. | 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]]. | ||
==== System setup ==== <!--T:6--> | ==== System setup ==== <!--T:6--> | ||
<!--T:7--> | <!--T:7--> | ||
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 <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> | </translate> | ||
{{file| | {{file|3=<nowiki> | ||
<nowiki> | |||
programs.steam = { | programs.steam = { | ||
enable = true; | enable = true; | ||
| Line 46: | Line 34: | ||
# 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. | # boot.kernelPackages = pkgs.linuxPackages; # Example for LTS | ||
</nowiki> | </nowiki>|name=/etc/nixos/configuration.nix|lang=nix}} | ||
}} | |||
<translate> | <translate> | ||
<!--T:8--> | <!--T:8--> | ||
[https://news.ycombinator.com/item?id=41549030 Anecdata on kernel 6.10 issues] | [<tvar name=link>https://news.ycombinator.com/item?id=41549030</tvar> Anecdata on kernel 6.10 issues] | ||
</translate> | </translate> | ||
{{note|<translate>Enabling [[ | {{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"> | <syntaxhighlight lang="nix"> | ||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ | nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ | ||
| Line 61: | Line 49: | ||
"steam-unwrapped" | "steam-unwrapped" | ||
]; | ]; | ||
</syntaxhighlight> | </syntaxhighlight>}} | ||
}} | |||
<translate> | <translate> | ||
== Configuration == <!--T:9--> | == Configuration == <!--T:9--> | ||
<!--T:10--> | <!--T:10--> | ||
Basic Steam features can be enabled directly within the {{nixos:option|programs.steam}} attribute set: | Basic Steam features can be enabled directly within the <tvar name=steam_option>{{nixos:option|programs.steam}}</tvar> attribute set: | ||
</translate> | </translate> | ||
{{file| | {{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 81: | Line 65: | ||
# Other general flags if available can be set here. | # Other general flags if available can be set here. | ||
}; | }; | ||
</nowiki>|name=/etc/nixos/configuration.nix|lang=nix}} | |||
</ | {{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 <tvar name=steam_hardware_option>{{nixos:option|hardware.steam-hardware.enable}}</tvar> to true.</translate>}} | ||
}} | |||
{{note|<translate><!--T:67--> 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></translate>}} | |||
<translate> | <translate> | ||
<!--T: | == Tips and tricks == <!--T:68--> | ||
=== Improving Performance === <!--T:69--> | |||
<!--T:70--> | |||
You can utilize <tvar name=gamemode>[https://github.com/FeralInteractive/gamemode GameMode]</tvar>, 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. | |||
</translate> | </translate> | ||
<syntaxhighlight lang="nixos"> | |||
programs.gamemode.enable = true; | |||
</syntaxhighlight> | |||
<translate> | <translate> | ||
| Line 136: | Line 127: | ||
<translate> | <translate> | ||
=== Gamescope HDR === | === Gamescope HDR === <!--T:62--> | ||
In order for HDR to work within gamescope, you need to separately | <!--T:63--> | ||
In order for HDR to work within gamescope, you might need to separately enable the <code>enableWsi</code> option | |||
</translate> | </translate> | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix">programs.gamescope = { | ||
programs.gamescope = { | |||
enable = true; | enable = true; | ||
enableWsi = true; | |||
capSysNice = false; | capSysNice = false; | ||
}; | };</syntaxhighlight> | ||
</syntaxhighlight> | |||
<translate> | <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). | 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> | </translate> | ||
| Line 173: | Line 162: | ||
<translate> | <translate> | ||
<!--T:17--> | <!--T:17--> | ||
Then install and run | 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> | </translate> | ||
| Line 293: | Line 282: | ||
<!--T:58--> | <!--T:58--> | ||
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 <tvar name=hm>[[Special:MyLanguage/Home Manager|Home Manager]]</tvar> (executed on every rebuild): | ||
</translate> | |||
<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> | |||
<!--T:59--> | <translate><!--T:59--> | ||
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 322: | Line 324: | ||
=== Steam fails to start. What do I do? === <!--T:33--> | === Steam fails to start. What do I do? === <!--T:33--> | ||
<!--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>: | 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> | </translate> | ||
| Line 339: | Line 342: | ||
<!--T:36--> | <!--T:36--> | ||
When you restart | When you restart Steam after an update, it starts the old version. (<tvar name=issue>[https://github.com/NixOS/nixpkgs/issues/181904 #181904]</tvar>) | ||
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 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 set up again by restarting. | ||
| Line 359: | Line 362: | ||
Note: If a game gets stuck on Installing scripts, check for a DXSETUP.EXE process and run it manually, then restart the game launch. | 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/ -->==== <!--T:40--> | ==== Changing the driver on AMD GPUs <tvar name=comment><!-- 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/ --></tvar>==== <!--T:40--> | ||
</translate> | </translate> | ||
{{note|<translate>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> | <translate> | ||
| Line 382: | Line 385: | ||
<translate> | <translate> | ||
<!--T:42--> | <!--T:42--> | ||
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, <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. | ||
<!--T:43--> | <!--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 [[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 <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 === <!--T:44--> | === SteamVR === <!--T:44--> | ||
| Line 396: | Line 399: | ||
<!--T:47--> | <!--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: | Gamescope may fail to start due to missing Xorg libraries. (<tvar name=issue>[https://github.com/NixOS/nixpkgs/issues/214275 #214275]</tvar>) To resolve this override the steam package to add them: | ||
</translate> | </translate> | ||
| Line 435: | Line 438: | ||
<translate> | <translate> | ||
<!--T:51--> | <!--T:51--> | ||
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 <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 | ||
=== Steam controller mouse input issues === <!--T:71--> | |||
<!--T:72--> | |||
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: | |||
</translate> | |||
<syntaxhighlight lang="nix"> | |||
programs.steam = { | |||
extest.enable = true; | |||
}; | |||
</syntaxhighlight> | |||
<translate> | |||
=== Known issues === <!--T:52--> | === Known issues === <!--T:52--> | ||
| Line 443: | Line 459: | ||
<!--T:55--> | <!--T:55--> | ||
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 <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. | ||
== References == <!--T:54--> | == References == <!--T:54--> | ||