Steam: Difference between revisions
Cleaned up the page, prepared translation tags |
m formatting and hyperlinking |
||
| (10 intermediate revisions by 6 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.<ref>https://store.steampowered.com/</ref> | [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> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T:2--> | == Installation == <!--T:2--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T:3--> | ==== Shell ==== <!--T:3--> | ||
</translate> | </translate> | ||
| Line 19: | Line 17: | ||
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: | ||
</translate> | </translate> | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="console"> | ||
nix-shell -p steam-run # For FHS environment | $ nix-shell -p steam-run # For FHS environment | ||
nix-shell -p steamcmd # For steamcmd | $ nix-shell -p steamcmd # For steamcmd | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<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 | 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]]. | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T:6--> | ==== System setup ==== <!--T:6--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--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 | To install the [[Steam]] package and enable all the system options necessary to allow it to run, add the following to your system configuration: | ||
</translate> | </translate> | ||
{{file|/etc/nixos/configuration.nix|nix| | |||
<nowiki> | |||
programs.steam = { | programs.steam = { | ||
enable = true; | enable = true; | ||
}; | }; | ||
| Line 48: | Line 44: | ||
# 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_lts; # Example for LTS | ||
</ | </nowiki> | ||
}} | |||
<translate> | <translate> | ||
<!--T:8--> | <!--T:8--> | ||
| Line 54: | Line 52: | ||
</translate> | </translate> | ||
{{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. | {{note|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. | ||
<syntaxhighlight lang="nix"> | <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" | ||
]; | ]; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
<translate> | <translate> | ||
<!--T:9--> | == Configuration == <!--T:9--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T:10--> | <!--T:10--> | ||
Basic Steam features can be enabled directly within the | Basic Steam features can be enabled directly within the {{nixos:option|programs.steam}} attribute set: | ||
</translate> | </translate> | ||
< | {{file|/etc/nixos/configuration.nix|nix| | ||
<nowiki> | |||
programs.steam = { | programs.steam = { | ||
enable = true; # Master switch, already covered in installation | enable = true; # Master switch, already covered in installation | ||
remotePlay.openFirewall = true; # | remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play | ||
dedicatedServer.openFirewall = true; # | dedicatedServer.openFirewall = true; # Open ports for Source Dedicated Server hosting | ||
# 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: | ||
# programs.gamemode.enable = true; | |||
</nowiki> | |||
}} | |||
<translate> | <translate> | ||
<!--T:11--> | <!--T:11--> | ||
If you are using a Steam Controller or a Valve Index, | {{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.}} | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T:12--> | == Tips and tricks == <!--T:12--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
=== Gamescope Compositor / "Boot to Steam Deck" === <!--T:13--> | |||
=== Gamescope Compositor / "Boot to Steam Deck" === | |||
</translate> | </translate> | ||
<translate> | <translate> | ||
| Line 107: | Line 99: | ||
# Clean Quiet Boot | # Clean Quiet Boot | ||
boot.kernelParams = [ "quiet" "splash" "console=/dev/null" ]; | boot.kernelParams = [ "quiet" "splash" "console=/dev/null" ]; | ||
plymouth.enable = true; | boot.plymouth.enable = true; | ||
programs.gamescope = { | programs.gamescope = { | ||
| Line 123: | Line 115: | ||
settings = { | settings = { | ||
default_session = { | default_session = { | ||
command = "${pkgs.gamescope}/bin/gamescope -W 1920 -H 1080 -f -e --xwayland-count 2 --hdr-enabled --hdr-itm-enabled -- steam -pipewire-dmabuf -gamepadui - | command = "${pkgs.gamescope}/bin/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"; | user = "USERNAME_HERE"; | ||
}; | }; | ||
| Line 131: | Line 123: | ||
<translate> | <translate> | ||
< | === Gamescope HDR === | ||
=== steam-tui === | 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.<syntaxhighlight lang="nix"> | ||
programs.gamescope = { | |||
enable = true; | |||
capSysNice = false; | |||
}; | |||
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).<syntaxhighlight lang="bash"> | |||
gamescope -W 3840 -H 2160 -r 120 -f --adaptive-sync --hdr-enabled --hdr-debug-force-output --mangoapp -- %command% | |||
</syntaxhighlight> | |||
=== steam-tui === <!--T:15--> | |||
</translate> | </translate> | ||
<translate> | <translate> | ||
| Line 157: | Line 161: | ||
<translate> | <translate> | ||
<!--T:19--> | === FHS environment only === <!--T:19--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
| Line 184: | Line 187: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T:22--> | === Proton === <!--T:22--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
| Line 214: | Line 216: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T:27--> | === Overriding the Steam package === <!--T:27--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
| Line 235: | Line 236: | ||
<translate> | <translate> | ||
<!--T: | <!--T:30--> | ||
Example: Adding Xorg libraries for Gamescope (when used within Steam): | Example: Adding Xorg libraries for Gamescope (when used within Steam): | ||
</translate> | </translate> | ||
| Line 257: | Line 258: | ||
<translate> | <translate> | ||
<!--T: | === Fix missing icons for games in GNOME dock and activities overview === <!--T:56--> | ||
== Troubleshooting == | </translate> | ||
<translate> | |||
<!--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>. | |||
<!--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). | |||
<!--T:59--> | |||
For games running natively, the value should match the game's main executable. | |||
<!--T:60--> | |||
For example, the modified .desktop file for Valheim looks like this: | |||
</translate> | |||
<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> | |||
<translate> | |||
== Troubleshooting == <!--T:31--> | |||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--T:32--> | ||
For all issues: first run <code>steam -dev -console</code> through the terminal and read the output. | For all issues: first run <code>steam -dev -console</code> through the terminal and read the output. | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
=== Steam fails to start. What do I do? === <!--T:33--> | |||
=== Steam fails to start. What do I do? === | |||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--T:34--> | ||
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? --> | 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? --> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
=== Steam is not updated === <!--T:35--> | |||
=== Steam is not updated === | |||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--T:36--> | ||
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/<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 286: | Line 312: | ||
<translate> | <translate> | ||
=== Game fails to start === <!--T:37--> | |||
=== Game fails to start === | |||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--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 | ||
| Line 300: | Line 325: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T: | <!--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. | 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> | </translate> | ||
<translate> | <translate> | ||
==== 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 <!-- 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/ -->==== | |||
</translate> | </translate> | ||
{{note|This is not recommended because radv drivers tend to perform better and are generally more stable than amdvlk.}} | {{note|This is not recommended because radv drivers tend to perform better and are generally more stable than amdvlk.}} | ||
<translate> | <translate> | ||
<!--T: | <!--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> | </translate> | ||
| Line 324: | Line 348: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T: | <!--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, [[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> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--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 [[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. | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | === SteamVR === <!--T:44--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--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> | <code>sudo setcap CAP_SYS_NICE+ep ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher</code> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
=== Gamescope fails to launch when used within Steam === <!--T:46--> | |||
=== Gamescope fails to launch when used within Steam === | |||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--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. ([https://github.com/NixOS/nixpkgs/issues/214275 #214275]) To resolve this override the steam package to add them: | ||
</translate> | </translate> | ||
| Line 366: | Line 388: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
=== Udev rules for additional Gamepads === <!--T:48--> | |||
=== Udev rules for additional Gamepads === | |||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--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>. | 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>. | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--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: | 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> | </translate> | ||
| Line 383: | Line 404: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<translate> | <translate> | ||
<!--T: | <!--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 [https://search.nixos.org/packages?channel=unstable&show=usbutils&from=0&size=50&sort=relevance&type=packages&query=usbutils usbutils] might be useful | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | === Known issues === <!--T:52--> | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | <!--T:53--> | ||
"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>. | ||
<!--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 [[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. | ||
</translate> | </translate> | ||
<translate> | <translate> | ||
<!--T: | == References == <!--T:54--> | ||
</translate> | </translate> | ||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Gaming]] | [[Category:Gaming]] | ||