nixpkgs/doc/packages/steam.section.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
2.5 KiB
Markdown
Raw Normal View History

2020-12-02 20:53:19 +01:00
# Steam {#sec-steam}
## Steam in Nix {#sec-steam-nix}
2022-03-10 20:43:29 +01:00
Steam is distributed as a `.deb` file, for now only as an i686 package (the amd64 package only has documentation). When unpacked, it has a script called `steam` that in Ubuntu (their target distro) would go to `/usr/bin`. When run for the first time, this script copies some files to the user's home, which include another script that is the ultimate responsible for launching the steam binary, which is also in `$HOME`.
2020-12-02 20:53:19 +01:00
Nix problems and constraints:
2022-03-10 20:43:29 +01:00
- We don't have `/bin/bash` and many scripts point there. Same thing for `/usr/bin/python`.
2020-12-02 20:53:19 +01:00
- We don't have the dynamic loader in `/lib`.
2022-03-10 20:43:29 +01:00
- The `steam.sh` script in `$HOME` cannot be patched, as it is checked and rewritten by steam.
2020-12-02 20:53:19 +01:00
- The steam binary cannot be patched, it's also checked.
The current approach to deploy Steam in NixOS is composing a FHS-compatible chroot environment, as documented [here](https://sandervanderburg.blogspot.com/2013/09/composing-fhs-compatible-chroot.html). This allows us to have binaries in the expected paths without disrupting the system, and to avoid patching them to work in a non FHS environment.
2020-12-02 20:53:19 +01:00
## How to play {#sec-steam-play}
2022-03-10 20:43:29 +01:00
Use `programs.steam.enable = true;` if you want to add steam to `systemPackages` and also enable a few workarounds as well as Steam controller support or other Steam supported controllers such as the DualShock 4 or Nintendo Switch Pro Controller.
2020-12-02 20:53:19 +01:00
## Troubleshooting {#sec-steam-troub}
- **Steam fails to start. What do I do?**
2020-12-02 20:53:19 +01:00
Try to run
```ShellSession
strace steam
```
to see what is causing steam to fail.
- **Using the FOSS Radeon or nouveau (nvidia) drivers**
- The `newStdcpp` parameter was removed since NixOS 17.09 and should not be needed anymore.
2022-03-10 20:43:29 +01:00
- Steam ships statically linked with a version of `libcrypto` that conflicts with the one dynamically loaded by radeonsi_dri.so. If you get the error:
2020-12-02 20:53:19 +01:00
```
steam.sh: line 713: 7842 Segmentation fault (core dumped)
```
2020-12-02 20:53:19 +01:00
have a look at [this pull request](https://github.com/NixOS/nixpkgs/pull/20269).
- **Java**
2022-03-10 20:43:29 +01:00
1. There is no java in steam chrootenv by default. If you get a message like:
2020-12-02 20:53:19 +01:00
```
/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found
```
2020-12-02 20:53:19 +01:00
2022-03-10 20:43:29 +01:00
you need to add:
2020-12-02 20:53:19 +01:00
```nix
steam.override { withJava = true; };
```
2020-12-02 20:53:19 +01:00
## steam-run {#sec-steam-run}
2022-03-10 20:43:29 +01:00
The FHS-compatible chroot used for Steam can also be used to run other Linux games that expect a FHS environment. To use it, install the `steam-run` package and run the game with:
2020-12-02 20:53:19 +01:00
```
steam-run ./foo
```