Steam: Difference between revisions
imported>Kevincox Removed HiDPI section, steam has had good support for a while now. |
imported>Artturin use steam module and clean up |
||
| Line 1: | Line 1: | ||
{{unfree}} | |||
This page is intended to explain how to run Steam, Steam games as well as proprietary DRM-free games under NixOS. A dedicated [[Games]] page lists games and reports on their successful execution on NixOS. | This page is intended to explain how to run Steam, Steam games as well as proprietary DRM-free games under NixOS. A dedicated [[Games]] page lists games and reports on their successful execution on NixOS. | ||
== Installation == | == Installation == | ||
Several installation options exist. | Several installation options exist. | ||
== | == Normal install == | ||
<syntaxhighlight lang="nix"> | |||
programs.steam.enable = true; | |||
</syntaxhighlight> | |||
</ | |||
=== Native steam client === | === Native steam client === | ||
| Line 33: | Line 17: | ||
Example snippet of <code>configuration.nix</code>: | Example snippet of <code>configuration.nix</code>: | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
nixpkgs.config.packageOverrides = pkgs: { | |||
steam = pkgs.steam.override { | |||
nativeOnly = true; | |||
}; | |||
.. | }; | ||
programs.steam.enable = true; | |||
</syntaxHighlight> | </syntaxHighlight> | ||
| Line 47: | Line 32: | ||
Example snippet of <code>configuration.nix</code>: | Example snippet of <code>configuration.nix</code>: | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
environment.systemPackages = with pkgs; [ | environment.systemPackages = with pkgs; [ | ||
steam-run-native | steam-run-native | ||
]; | ]; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
unfree | |||
Other option, in case you need more flexibility, is to directly reference to the part of steam metapackage instead. In fact, <code>steam-run-native</code> above is just a wrapper linking to <code>steam.run</code>. | Other option, in case you need more flexibility, is to directly reference to the part of steam metapackage instead. In fact, <code>steam-run-native</code> above is just a wrapper linking to <code>steam.run</code>. | ||
Example snippet of <code>configuration.nix</code>: | Example snippet of <code>configuration.nix</code>: | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
environment.systemPackages = with pkgs; [ | environment.systemPackages = with pkgs; [ | ||
(steam.override { nativeOnly = true; }).run | (steam.override { nativeOnly = true; }).run | ||
]; | ]; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
This builds same result as <code>steam-run-native</code> above. | This builds same result as <code>steam-run-native</code> above. | ||
| Line 72: | Line 52: | ||
== Adding missing dependencies == | == Adding missing dependencies == | ||
may also need <code>nativeOnly = true;</code> but i have not tested | |||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
.. | nixpkgs.config.packageOverrides = pkgs: { | ||
steam = pkgs.steam.override { | |||
extraPkgs = pkgs: [ | |||
libgdiplus | |||
]; | |||
}; | |||
}; | |||
</syntaxHighlight> | </syntaxHighlight> | ||
=== Bumblebee and Primus === | === Bumblebee and Primus === | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
environment.systemPackages = with pkgs; [ | environment.systemPackages = with pkgs; [ | ||
(steam.override { withPrimus = true; extraPkgs = pkgs: [ bumblebee glxinfo ]; nativeOnly = true; }).run | (steam.override { withPrimus = true; extraPkgs = pkgs: [ bumblebee glxinfo ]; nativeOnly = true; }).run | ||
]; | ]; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
=== Java === | === Java === | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
programs.java.enable = true; | |||
programs.java.enable = true; | environment.systemPackages = with pkgs; [ | ||
environment.systemPackages = with pkgs; [ | (steam.override { withJava = true; }) | ||
]; | |||
(steam.override { withJava = true; }) | |||
]; | |||
</syntaxHighlight> | </syntaxHighlight> | ||
| Line 108: | Line 81: | ||
== Limit user access == | == Limit user access == | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
users.users.<your-username>.packages = [ | users.users.<your-username>.packages = [ | ||
pkgs.steam | pkgs.steam | ||
]; | ]; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
| Line 146: | Line 116: | ||
If you are using a Steam Controller or a Valve Index, you will want to add <code>hardware.steam-hardware.enable = true;</code> to your configurations. | If you are using a Steam Controller or a Valve Index, you will want to add <code>hardware.steam-hardware.enable = true;</code> to your configurations. | ||
[[Category: | [[Category:Applications]] | ||