From 2698757095337426d8fd72119bebacce038e91cf Mon Sep 17 00:00:00 2001 From: Marti Serra Date: Sat, 10 Dec 2016 17:50:24 +0100 Subject: [PATCH] steam: added documentation to nixpkgs manual --- doc/package-notes.xml | 137 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/doc/package-notes.xml b/doc/package-notes.xml index f0015a7f9ace..de148ec5739f 100644 --- a/doc/package-notes.xml +++ b/doc/package-notes.xml @@ -382,4 +382,141 @@ it. Place the resulting package.nix file into +
+ +Steam + +
+ +Steam in Nix + + + 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. + + + Nix problems and constraints: + + We don't have /bin/bash and many + scripts point there. Similarly for /usr/bin/python + . + We don't have the dynamic loader in /lib + . + The steam.sh script in $HOME can + not be patched, as it is checked and rewritten by steam. + 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. + This allows us to have binaries in the expected paths without disrupting the system, + and to avoid patching them. + + +
+ +
+ +How to play + + + For 64-bit systems it's important to have + hardware.opengl.driSupport32Bit = true; + in your /etc/nixos/configuration.nix. You'll also need + hardware.pulseaudio.support32Bit = true; + if you are using PulseAudio - this will enable 32bit ALSA apps integration. + To use the Steam controller, you need to add + services.udev.extraRules = '' + SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666" + KERNEL=="uinput", MODE="0660", GROUP="users", OPTIONS+="static_node=uinput" + ''; + to your configuration. + + +
+ +
+ +Troubleshooting + + + + + + Steam fails to start. What do I do? + Try to run + strace steam + to see what is causing steam to fail. + + + + Game X fails to start + 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. + 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: + LD_LIBRARY_PATH=~/.steam/bin32:$LD_LIBRARY_PATH:/nix/store/pfsa... blabla ...curl-7.29.0/lib:. ./Osmos.bin3 + (if you could not patchelf the game, call ld.so directly + with the binary as param). With this technique, I can play many games + directly from steam. Others, like Team Fortress, cannot be patched + so I only managed to run them from the cmd line. + + + + + + + + Using the FOSS Radeon drivers + + The open source radeon drivers need a newer libc++ than is provided + by the default runtime, which leads to a crash on launch. Use + environment.systemPackages = [(pkgs.steam.override { newStdcpp = true; })]; + in your config if you get an error like + +libGL error: unable to load driver: radeonsi_dri.so +libGL error: driver pointer missing +libGL error: failed to load driver: radeonsi +libGL error: unable to load driver: swrast_dri.so +libGL error: failed to load driver: swrast + + Steam ships statically linked with a version of libcrypto that + conflics with the one dynamically loaded by radeonsi_dri.so. + If you get the error + steam.sh: line 713: 7842 Segmentation fault (core dumped) + have a look at this pull request. + + + + + Known issues + + + No java in steam chrootenv. Games affected: Towns: + /home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found + + + + + + +
+ +
+