Difference between revisions of "Steam"

From NixOS Wiki
Jump to: navigation, search
(Adds a quick note about steam-run)
Line 4: Line 4:
 
== I want to play ==
 
== I want to play ==
 
For 64-bit systems it's important to have <syntaxhighlight lang="nix" inline>hardware.opengl.driSupport32Bit = true</syntaxhighlight> in your NixOS configuration. You'll also need <syntaxhighlight lang="nix" inline>hardware.pulseaudio.support32Bit = true</syntaxhighlight> if you are using PulseAudio - this will enable 32bit ALSA apps integration.
 
For 64-bit systems it's important to have <syntaxhighlight lang="nix" inline>hardware.opengl.driSupport32Bit = true</syntaxhighlight> in your NixOS configuration. You'll also need <syntaxhighlight lang="nix" inline>hardware.pulseaudio.support32Bit = true</syntaxhighlight> if you are using PulseAudio - this will enable 32bit ALSA apps integration.
 +
 +
For detection of controllers and VR Headsets like HTC Vive and Valve Index, you have to enable udev rules with <syntaxhighlight lang="nix" inline>hardware.steam-hardware.enable = true</syntaxhighlight>.
  
 
In short, add this to your <code>configuration.nix</code>
 
In short, add this to your <code>configuration.nix</code>
Line 14: Line 16:
 
   hardware.opengl.driSupport32Bit = true;
 
   hardware.opengl.driSupport32Bit = true;
 
   hardware.pulseaudio.support32Bit = true;
 
   hardware.pulseaudio.support32Bit = true;
 +
  hardware.steam-hardware.enable = true;
 
}
 
}
 
</syntaxHighlight>
 
</syntaxHighlight>

Revision as of 00:22, 10 July 2019

This page is intended to describe the current state of Steam under NixOS.

I want to play

For 64-bit systems it's important to have hardware.opengl.driSupport32Bit = true in your NixOS configuration. You'll also need hardware.pulseaudio.support32Bit = true if you are using PulseAudio - this will enable 32bit ALSA apps integration.

For detection of controllers and VR Headsets like HTC Vive and Valve Index, you have to enable udev rules with hardware.steam-hardware.enable = true.

In short, add this to your configuration.nix

{
  ...
  users.users.<your-username>.packages = [
    pkgs.steam
  ];
  hardware.opengl.driSupport32Bit = true;
  hardware.pulseaudio.support32Bit = true;
  hardware.steam-hardware.enable = true;
}

Troubleshooting

I was sure you would reach this part.

Steam fails to start. What do I do?

strace is your friend.

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.bin32 (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.

new Libcpp for steam

The open source radeon drivers need a newer libc++ than is provided by the default runtime, which leads to acrash on launch. Use

(steamPackages.override { newLibcpp = true; }).steam-chrootenv

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

Known issues

  1. No java in steam chrootenv. Games affected: Towns:
/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found

HiDPI

If you're blessed with a higher DPI monitor, Steam's UI fonts may be unbearably tiny. You can add a custom skin from https://github.com/MoriTanosuke/HiDPI-Steam-Skin for your user to alleviate this. The skins directory is ~/.local/share/Steam/skins/.

steam-run

steam-run is a helper that can be used to run external programs in the steam FHS environment. This means that some third-party software, mostly games, can be run easily on NixOS using steam-run. Before trying other solutions, try starting your game this way, where start-game.sh is the script used to start the game on Linux.

 $ steam-run ./start-game.sh