git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #105728 from Stupremee/steam-common-mark-conversion

Convert steam documentation to common mark

commitb7eef7b55a5ae4e1087eaebc0c8b46537180655a authorRyan Mulligan <ryan@ryantm.com> dateTue 22 Dec 2020, 20:42 (6 years ago) parent2e018bd357f132
3 files changed+70−126
doc/builders/packages/index.xml+1−1 doc/builders/packages/steam.section.md+69 doc/builders/packages/steam.xml−125
doc/builders/packages/index.xml+1−1
@@ -18,7 +18,7 @@
1818 <xi:include href="nginx.section.xml" />
1919 <xi:include href="opengl.section.xml" />
2020 <xi:include href="shell-helpers.section.xml" />
21− <xi:include href="steam.xml" />
21+ <xi:include href="steam.section.xml" />
2222 <xi:include href="cataclysm-dda.section.xml" />
2323 <xi:include href="urxvt.section.xml" />
2424 <xi:include href="weechat.section.xml" />
doc/builders/packages/steam.section.mdnew file+69
@@ -0,0 +1,69 @@
1+# Steam {#sec-steam}
2+
3+## Steam in Nix {#sec-steam-nix}
4+
5+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.
6+
7+Nix problems and constraints:
8+
9+- We don't have `/bin/bash` and many scripts point there. Similarly for `/usr/bin/python`.
10+- We don't have the dynamic loader in `/lib`.
11+- The `steam.sh` script in \$HOME can not be patched, as it is checked and rewritten by steam.
12+- The steam binary cannot be patched, it's also checked.
13+
14+The current approach to deploy Steam in NixOS is composing a FHS-compatible chroot environment, as documented [here](http://sandervanderburg.blogspot.nl/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.
15+
16+## How to play {#sec-steam-play}
17+
18+Use `programs.steam.enable = true;` if you want to add steam to systemPackages and also enable a few workarrounds aswell as Steam controller support or other Steam supported controllers such as the DualShock 4 or Nintendo Switch Pr.
19+
20+## Troubleshooting {#sec-steam-troub}
21+
22+- **Steam fails to start. What do I do?**
23+ Try to run
24+
25+ ```ShellSession
26+ strace steam
27+ ```
28+
29+ to see what is causing steam to fail.
30+
31+- **Using the FOSS Radeon or nouveau (nvidia) drivers**
32+
33+ - The `newStdcpp` parameter was removed since NixOS 17.09 and should not be needed anymore.
34+ - 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
35+ ```
36+ steam.sh: line 713: 7842 Segmentation fault (core dumped)
37+ ```
38+ have a look at [this pull request](https://github.com/NixOS/nixpkgs/pull/20269).
39+
40+- **Java**
41+
42+ 1. There is no java in steam chrootenv by default. If you get a message like
43+
44+ ```
45+ /home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found
46+ ```
47+
48+ You need to add
49+
50+ ```nix
51+ steam.override { withJava = true; };
52+ ```
53+
54+## steam-run {#sec-steam-run}
55+
56+The FHS-compatible chroot used for steam can also be used to run other linux games that expect a FHS environment. To do it, add
57+
58+```nix
59+pkgs.steam.override ({
60+ nativeOnly = true;
61+ newStdcpp = true;
62+ }).run
63+```
64+
65+to your configuration, rebuild, and run the game with
66+
67+```
68+steam-run ./foo
69+```
doc/builders/packages/steam.xmldeleted−125
@@ -1,125 +0,0 @@
1−<section xmlns="http://docbook.org/ns/docbook"
2− xmlns:xlink="http://www.w3.org/1999/xlink"
3− xml:id="sec-steam">
4− <title>Steam</title>
5−
6− <section xml:id="sec-steam-nix">
7− <title>Steam in Nix</title>
8−
9− <para>
10− Steam is distributed as a <filename>.deb</filename> file, for now only as an i686 package (the amd64 package only has documentation). When unpacked, it has a script called <filename>steam</filename> that in Ubuntu (their target distro) would go to <filename>/usr/bin </filename>. 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.
11− </para>
12−
13− <para>
14− Nix problems and constraints:
15− <itemizedlist>
16− <listitem>
17− <para>
18− We don't have <filename>/bin/bash</filename> and many scripts point there. Similarly for <filename>/usr/bin/python</filename> .
19− </para>
20− </listitem>
21− <listitem>
22− <para>
23− We don't have the dynamic loader in <filename>/lib </filename>.
24− </para>
25− </listitem>
26− <listitem>
27− <para>
28− The <filename>steam.sh</filename> script in $HOME can not be patched, as it is checked and rewritten by steam.
29− </para>
30− </listitem>
31− <listitem>
32− <para>
33− The steam binary cannot be patched, it's also checked.
34− </para>
35− </listitem>
36− </itemizedlist>
37− </para>
38−
39− <para>
40− The current approach to deploy Steam in NixOS is composing a FHS-compatible chroot environment, as documented <link xlink:href="http://sandervanderburg.blogspot.nl/2013/09/composing-fhs-compatible-chroot.html">here</link>. 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.
41− </para>
42− </section>
43−
44− <section xml:id="sec-steam-play">
45− <title>How to play</title>
46−
47− <para>
48− Use <programlisting>programs.steam.enable = true;</programlisting> if you want to add steam to systemPackages and also enable a few workarrounds aswell as Steam controller support or other Steam supported controllers such as the DualShock 4 or Nintendo Switch Pr.
49− </para>
50− </section>
51−
52− <section xml:id="sec-steam-troub">
53− <title>Troubleshooting</title>
54−
55− <para>
56− <variablelist>
57− <varlistentry>
58− <term>
59− Steam fails to start. What do I do?
60− </term>
61− <listitem>
62− <para>
63− Try to run
64−<programlisting>strace steam</programlisting>
65− to see what is causing steam to fail.
66− </para>
67− </listitem>
68− </varlistentry>
69− <varlistentry>
70− <term>
71− Using the FOSS Radeon or nouveau (nvidia) drivers
72− </term>
73− <listitem>
74− <itemizedlist>
75− <listitem>
76− <para>
77− The <literal>newStdcpp</literal> parameter was removed since NixOS 17.09 and should not be needed anymore.
78− </para>
79− </listitem>
80− <listitem>
81− <para>
82− 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
83−<programlisting>steam.sh: line 713: 7842 Segmentation fault (core dumped)</programlisting>
84− have a look at <link xlink:href="https://github.com/NixOS/nixpkgs/pull/20269">this pull request</link>.
85− </para>
86− </listitem>
87− </itemizedlist>
88− </listitem>
89− </varlistentry>
90− <varlistentry>
91− <term>
92− Java
93− </term>
94− <listitem>
95− <orderedlist>
96− <listitem>
97− <para>
98− There is no java in steam chrootenv by default. If you get a message like
99−<programlisting>/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found</programlisting>
100− You need to add
101−<programlisting> steam.override { withJava = true; };</programlisting>
102− to your configuration.
103− </para>
104− </listitem>
105− </orderedlist>
106− </listitem>
107− </varlistentry>
108− </variablelist>
109− </para>
110− </section>
111−
112− <section xml:id="sec-steam-run">
113− <title>steam-run</title>
114−
115− <para>
116− The FHS-compatible chroot used for steam can also be used to run other linux games that expect a FHS environment. To do it, add
117−<programlisting>pkgs.(steam.override {
118− nativeOnly = true;
119− newStdcpp = true;
120− }).run</programlisting>
121− to your configuration, rebuild, and run the game with
122−<programlisting>steam-run ./foo</programlisting>
123− </para>
124− </section>
125−</section>