Browse Source

Merge branch 'nixos-19.09' into nixos-flake

genode
Emery Hemingway 1 year ago
parent
commit
cc2b10a7ed
100 changed files with 1055 additions and 1266 deletions
  1. 1
    1
      .github/CONTRIBUTING.md
  2. 1
    1
      .github/PULL_REQUEST_TEMPLATE.md
  3. 4
    4
      doc/builders/fetchers.xml
  4. 12
    0
      doc/builders/images.xml
  5. 0
    0
      doc/builders/images/appimagetools.xml
  6. 0
    0
      doc/builders/images/dockertools.xml
  7. 0
    0
      doc/builders/images/ocitools.xml
  8. 0
    0
      doc/builders/images/snap/example-firefox.nix
  9. 0
    0
      doc/builders/images/snap/example-hello.nix
  10. 0
    0
      doc/builders/images/snaptools.xml
  11. 12
    0
      doc/builders/special.xml
  12. 0
    0
      doc/builders/special/fhs-environments.xml
  13. 0
    0
      doc/builders/special/mkshell.xml
  14. 3
    3
      doc/builders/trivial-builders.xml
  15. 6
    7
      doc/configuration.xml
  16. 0
    0
      doc/contributing-to-documentation.xml
  17. 4
    4
      doc/cross-compilation.xml
  18. 1
    1
      doc/doc-support/parameters.xml
  19. 0
    9
      doc/functions.xml
  20. 1
    1
      doc/languages-frameworks/android.section.md
  21. 1
    1
      doc/languages-frameworks/emscripten.section.md
  22. 2
    21
      doc/languages-frameworks/gnome.xml
  23. 1
    1
      doc/languages-frameworks/haskell.section.md
  24. 1
    1
      doc/languages-frameworks/idris.section.md
  25. 3
    3
      doc/languages-frameworks/index.xml
  26. 11
    1
      doc/languages-frameworks/ios.section.md
  27. 2
    2
      doc/languages-frameworks/node.section.md
  28. 3
    2
      doc/languages-frameworks/python.section.md
  29. 2
    2
      doc/languages-frameworks/r.section.md
  30. 2
    6
      doc/languages-frameworks/rust.section.md
  31. 1
    1
      doc/languages-frameworks/vim.section.md
  32. 32
    16
      doc/manual.xml
  33. 3
    3
      doc/overrides.xml
  34. 0
    422
      doc/package-notes.xml
  35. 0
    357
      doc/package-specific-user-notes.xml
  36. 44
    0
      doc/packages/citrix.xml
  37. 24
    0
      doc/packages/dlib.xml
  38. 72
    0
      doc/packages/eclipse.xml
  39. 17
    0
      doc/packages/elm.xml
  40. 131
    0
      doc/packages/emacs.xml
  41. 57
    0
      doc/packages/ibus.xml
  42. 23
    0
      doc/packages/index.xml
  43. 14
    0
      doc/packages/kakoune.xml
  44. 85
    0
      doc/packages/linux.xml
  45. 13
    0
      doc/packages/locales.xml
  46. 25
    0
      doc/packages/nginx.xml
  47. 9
    0
      doc/packages/opengl.xml
  48. 25
    0
      doc/packages/shell-helpers.xml
  49. 131
    0
      doc/packages/steam.xml
  50. 13
    0
      doc/packages/unfree.xml
  51. 85
    0
      doc/packages/weechat.xml
  52. 34
    0
      doc/packages/xorg.xml
  53. 1
    1
      doc/platform-notes.xml
  54. 1
    1
      doc/reviewing-contributions.xml
  55. 3
    3
      doc/stdenv.xml
  56. 2
    2
      doc/submitting-changes.xml
  57. 2
    1
      lib/default.nix
  58. 17
    0
      lib/strings.nix
  59. 2
    2
      lib/systems/examples.nix
  60. 3
    0
      lib/systems/parse.nix
  61. 1
    1
      maintainers/scripts/update.nix
  62. 12
    9
      nixos/doc/manual/development/releases.xml
  63. 7
    7
      nixos/doc/manual/installation/installing.xml
  64. 2
    2
      nixos/doc/manual/installation/upgrading.xml
  65. 8
    51
      nixos/doc/manual/man-nixos-rebuild.xml
  66. 2
    27
      nixos/doc/manual/man-nixos-version.xml
  67. 0
    1
      nixos/doc/manual/release-notes/release-notes.xml
  68. 1
    1
      nixos/doc/manual/release-notes/rl-1909.xml
  69. 3
    3
      nixos/lib/make-iso9660-image.nix
  70. 1
    1
      nixos/maintainers/scripts/ec2/create-amis.sh
  71. 1
    5
      nixos/modules/config/i18n.nix
  72. 5
    3
      nixos/modules/config/pulseaudio.nix
  73. 1
    1
      nixos/modules/config/qt5.nix
  74. 0
    2
      nixos/modules/config/shells-environment.nix
  75. 1
    1
      nixos/modules/config/sysctl.nix
  76. 10
    73
      nixos/modules/config/system-environment.nix
  77. 0
    3
      nixos/modules/config/system-path.nix
  78. 1
    1
      nixos/modules/config/terminfo.nix
  79. 1
    1
      nixos/modules/config/unix-odbc-drivers.nix
  80. 8
    19
      nixos/modules/config/xdg/icons.nix
  81. 1
    1
      nixos/modules/hardware/opengl.nix
  82. 3
    0
      nixos/modules/installer/cd-dvd/installation-cd-graphical-base.nix
  83. 8
    2
      nixos/modules/installer/cd-dvd/installation-cd-graphical-kde.nix
  84. 5
    20
      nixos/modules/installer/cd-dvd/iso-image.nix
  85. 1
    1
      nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix
  86. 3
    20
      nixos/modules/installer/cd-dvd/sd-image.nix
  87. 4
    4
      nixos/modules/installer/tools/nix-fallback-paths.nix
  88. 1
    1
      nixos/modules/installer/tools/nixos-option.sh
  89. 8
    70
      nixos/modules/installer/tools/nixos-rebuild.sh
  90. 0
    5
      nixos/modules/installer/tools/nixos-version.sh
  91. 0
    2
      nixos/modules/installer/tools/tools.nix
  92. 2
    2
      nixos/modules/misc/ids.nix
  93. 1
    4
      nixos/modules/misc/locate.nix
  94. 1
    7
      nixos/modules/misc/version.nix
  95. 6
    10
      nixos/modules/module-list.nix
  96. 0
    1
      nixos/modules/profiles/graphical.nix
  97. 0
    21
      nixos/modules/profiles/hardened.nix
  98. 2
    2
      nixos/modules/profiles/qemu-guest.nix
  99. 2
    1
      nixos/modules/programs/adb.nix
  100. 0
    0
      nixos/modules/programs/environment.nix

+ 1
- 1
.github/CONTRIBUTING.md View File

@@ -51,4 +51,4 @@ For package version upgrades and such a one-line commit message is usually suffi
51 51
 
52 52
 ## Reviewing contributions
53 53
 
54
-See the nixpkgs manual for more details on how to [Review contributions](https://nixos.org/nixpkgs/manual/#sec-reviewing-contributions).
54
+See the nixpkgs manual for more details on how to [Review contributions](https://nixos.org/nixpkgs/manual/#chap-reviewing-contributions).

+ 1
- 1
.github/PULL_REQUEST_TEMPLATE.md View File

@@ -1,4 +1,4 @@
1
-<!-- Nixpkgs has a lot of new incoming Pull Requests, but not enough people to review this constant stream. Even if you aren't a committer, we would appreciate reviews of other PRs, especially simple ones like package updates. Just testing the relevant package/service and leaving a comment saying what you tested, how you tested it and whether it worked would be great. List of open PRs: <https://github.com/NixOS/nixpkgs/pulls>, for more about reviewing contributions: <https://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download/1/nixpkgs/manual.html#sec-reviewing-contributions>. Reviewing isn't mandatory, but it would help out a lot and reduce the average time-to-merge for all of us. Thanks a lot if you do! -->
1
+<!-- Nixpkgs has a lot of new incoming Pull Requests, but not enough people to review this constant stream. Even if you aren't a committer, we would appreciate reviews of other PRs, especially simple ones like package updates. Just testing the relevant package/service and leaving a comment saying what you tested, how you tested it and whether it worked would be great. List of open PRs: <https://github.com/NixOS/nixpkgs/pulls>, for more about reviewing contributions: <https://hydra.nixos.org/job/nixpkgs/trunk/manual/latest/download/1/nixpkgs/manual.html#chap-reviewing-contributions>. Reviewing isn't mandatory, but it would help out a lot and reduce the average time-to-merge for all of us. Thanks a lot if you do! -->
2 2
 ###### Motivation for this change
3 3
 
4 4
 

doc/functions/fetchers.xml → doc/builders/fetchers.xml View File

@@ -1,8 +1,8 @@
1
-<section xmlns="http://docbook.org/ns/docbook"
1
+<chapter xmlns="http://docbook.org/ns/docbook"
2 2
          xmlns:xlink="http://www.w3.org/1999/xlink"
3 3
          xmlns:xi="http://www.w3.org/2001/XInclude"
4
-         xml:id="sec-pkgs-fetchers">
5
- <title>Fetcher functions</title>
4
+         xml:id="chap-pkgs-fetchers">
5
+ <title>Fetchers</title>
6 6
 
7 7
  <para>
8 8
   When using Nix, you will frequently need to download source code and other files from the internet. Nixpkgs comes with a few helper functions that allow you to fetch fixed-output derivations in a structured way.
@@ -145,4 +145,4 @@ stdenv.mkDerivation {
145 145
    </listitem>
146 146
   </varlistentry>
147 147
  </variablelist>
148
-</section>
148
+</chapter>

+ 12
- 0
doc/builders/images.xml View File

@@ -0,0 +1,12 @@
1
+<chapter xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xi="http://www.w3.org/2001/XInclude"
3
+         xml:id="chap-images">
4
+ <title>Images</title>
5
+ <para>
6
+  This chapter describes tools for creating various types of images.
7
+ </para>
8
+ <xi:include href="images/appimagetools.xml" />
9
+ <xi:include href="images/dockertools.xml" />
10
+ <xi:include href="images/ocitools.xml" />
11
+ <xi:include href="images/snaptools.xml" />
12
+</chapter>

doc/functions/appimagetools.xml → doc/builders/images/appimagetools.xml View File


doc/functions/dockertools.xml → doc/builders/images/dockertools.xml View File


doc/functions/ocitools.xml → doc/builders/images/ocitools.xml View File


doc/functions/snap/example-firefox.nix → doc/builders/images/snap/example-firefox.nix View File


doc/functions/snap/example-hello.nix → doc/builders/images/snap/example-hello.nix View File


doc/functions/snaptools.xml → doc/builders/images/snaptools.xml View File


+ 12
- 0
doc/builders/special.xml View File

@@ -0,0 +1,12 @@
1
+<chapter xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xi="http://www.w3.org/2001/XInclude"
3
+         xml:id="chap-special">
4
+ <title>Special builders</title>
5
+ <para>
6
+  This chapter describes several special builders.
7
+ </para>
8
+ <xi:include href="special/fhs-environments.xml" />
9
+ <xi:include href="special/mkshell.xml" />
10
+</chapter>
11
+
12
+

doc/functions/fhs-environments.xml → doc/builders/special/fhs-environments.xml View File


doc/functions/shell.xml → doc/builders/special/mkshell.xml View File


doc/functions/trivial-builders.xml → doc/builders/trivial-builders.xml View File

@@ -1,7 +1,7 @@
1
-<section xmlns="http://docbook.org/ns/docbook"
1
+<chapter xmlns="http://docbook.org/ns/docbook"
2 2
          xmlns:xlink="http://www.w3.org/1999/xlink"
3 3
          xmlns:xi="http://www.w3.org/2001/XInclude"
4
-         xml:id="sec-trivial-builders">
4
+         xml:id="chap-trivial-builders">
5 5
  <title>Trivial builders</title>
6 6
 
7 7
  <para>
@@ -76,4 +76,4 @@
76 76
    </listitem>
77 77
   </varlistentry>
78 78
  </variablelist>
79
-</section>
79
+</chapter>

+ 6
- 7
doc/configuration.xml View File

@@ -45,7 +45,7 @@
45 45
   However, this does not allow unfree software for individual users. Their configurations are managed separately.
46 46
  </para>
47 47
  <para>
48
-  A user's nixpkgs configuration is stored in a user-specific configuration file located at <filename>~/.config/nixpkgs/config.nix</filename>. For example:
48
+  A user's of nixpkgs configuration is stored in a user-specific configuration file located at <filename>~/.config/nixpkgs/config.nix</filename>. For example:
49 49
 <programlisting>
50 50
 {
51 51
   allowUnfree = true;
@@ -141,11 +141,10 @@
141 141
      For a more useful example, try the following. This configuration only allows unfree packages named flash player and visual studio code:
142 142
 <programlisting>
143 143
 {
144
-  allowUnfreePredicate = (pkg: builtins.elem
145
-    (builtins.parseDrvName pkg.name).name [
146
-      "flashplayer"
147
-      "vscode"
148
-    ]);
144
+  allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
145
+    "flashplayer"
146
+    "vscode"
147
+  ];
149 148
 }
150 149
 </programlisting>
151 150
     </para>
@@ -217,7 +216,7 @@
217 216
      The following configuration example only allows insecure packages with very short names:
218 217
 <programlisting>
219 218
 {
220
-  allowInsecurePredicate = (pkg: (builtins.stringLength (builtins.parseDrvName pkg.name).name) &lt;= 5);
219
+  allowInsecurePredicate = pkg: builtins.stringLength (lib.getName pkg) &lt;= 5;
221 220
 }
222 221
 </programlisting>
223 222
     </para>

doc/contributing.xml → doc/contributing-to-documentation.xml View File


+ 4
- 4
doc/cross-compilation.xml View File

@@ -271,14 +271,14 @@
271 271
   <para>
272 272
    Nixpkgs can be instantiated with <varname>localSystem</varname> alone, in which case there is no cross-compiling and everything is built by and for that system, or also with <varname>crossSystem</varname>, in which case packages run on the latter, but all building happens on the former. Both parameters take the same schema as the 3 (build, host, and target) platforms defined in the previous section. As mentioned above, <literal>lib.systems.examples</literal> has some platforms which are used as arguments for these parameters in practice. You can use them programmatically, or on the command line:
273 273
 <programlisting>
274
-nix-build '&lt;nixpkgs&gt;' --arg crossSystem '(import &lt;nixpkgs/lib&gt;).systems.examples.fooBarBaz' -A whatever</programlisting>
274
+nix-build &lt;nixpkgs&gt; --arg crossSystem '(import &lt;nixpkgs/lib&gt;).systems.examples.fooBarBaz' -A whatever</programlisting>
275 275
   </para>
276 276
 
277 277
   <note>
278 278
    <para>
279 279
     Eventually we would like to make these platform examples an unnecessary convenience so that
280 280
 <programlisting>
281
-nix-build '&lt;nixpkgs&gt;' --arg crossSystem '{ config = "&lt;arch&gt;-&lt;os&gt;-&lt;vendor&gt;-&lt;abi&gt;"; }' -A whatever</programlisting>
281
+nix-build &lt;nixpkgs&gt; --arg crossSystem '{ config = "&lt;arch&gt;-&lt;os&gt;-&lt;vendor&gt;-&lt;abi&gt;"; }' -A whatever</programlisting>
282 282
     works in the vast majority of cases. The problem today is dependencies on other sorts of configuration which aren't given proper defaults. We rely on the examples to crudely to set those configuration parameters in some vaguely sane manner on the users behalf. Issue <link xlink:href="https://github.com/NixOS/nixpkgs/issues/34274">#34274</link> tracks this inconvenience along with its root cause in crufty configuration options.
283 283
    </para>
284 284
   </note>
@@ -348,12 +348,12 @@ nix-build '&lt;nixpkgs&gt;' --arg crossSystem '{ config = "&lt;arch&gt;-&lt;os&g
348 348
       </para>
349 349
      </listitem>
350 350
     </orderedlist>
351
-    In each stage, <varname>pkgsBuildHost</varname> refers the the previous stage, <varname>pkgsBuildBuild</varname> refers to the one before that, and <varname>pkgsHostTarget</varname> refers to the current one, and <varname>pkgsTargetTarget</varname> refers to the next one. When there is no previous or next stage, they instead refer to the current stage. Note how all the invariants regarding the mapping between dependency and depending packages' build host and target platforms are preserved. <varname>pkgsBuildTarget</varname> and <varname>pkgsHostHost</varname> are more complex in that the stage fitting the requirements isn't always a fixed chain of "prevs" and "nexts" away (modulo the "saturating" self-references at the ends). We just special case each instead. All the primary edges are implemented is in <filename>pkgs/stdenv/booter.nix</filename>, and secondarily aliases in <filename>pkgs/top-level/stage.nix</filename>.
351
+    In each stage, <varname>pkgsBuildHost</varname> refers to the previous stage, <varname>pkgsBuildBuild</varname> refers to the one before that, and <varname>pkgsHostTarget</varname> refers to the current one, and <varname>pkgsTargetTarget</varname> refers to the next one. When there is no previous or next stage, they instead refer to the current stage. Note how all the invariants regarding the mapping between dependency and depending packages' build host and target platforms are preserved. <varname>pkgsBuildTarget</varname> and <varname>pkgsHostHost</varname> are more complex in that the stage fitting the requirements isn't always a fixed chain of "prevs" and "nexts" away (modulo the "saturating" self-references at the ends). We just special case each instead. All the primary edges are implemented is in <filename>pkgs/stdenv/booter.nix</filename>, and secondarily aliases in <filename>pkgs/top-level/stage.nix</filename>.
352 352
    </para>
353 353
 
354 354
    <note>
355 355
     <para>
356
-     Note the native stages are bootstrapped in legacy ways that predate the current cross implementation. This is why the the bootstrapping stages leading up to the final stages are ignored inthe previous paragraph.
356
+     Note the native stages are bootstrapped in legacy ways that predate the current cross implementation. This is why the bootstrapping stages leading up to the final stages are ignored inthe previous paragraph.
357 357
     </para>
358 358
    </note>
359 359
 

+ 1
- 1
doc/doc-support/parameters.xml View File

@@ -8,7 +8,7 @@
8 8
  <xsl:param name="html.script" select="'./highlightjs/highlight.pack.js ./highlightjs/loader.js'" />
9 9
  <xsl:param name="xref.with.number.and.title" select="1" />
10 10
  <xsl:param name="use.id.as.filename" select="1" />
11
- <xsl:param name="toc.section.depth" select="3" />
11
+ <xsl:param name="toc.section.depth" select="0" />
12 12
  <xsl:param name="admon.style" select="''" />
13 13
  <xsl:param name="callout.graphics.extension" select="'.svg'" />
14 14
 </xsl:stylesheet>

+ 0
- 9
doc/functions.xml View File

@@ -7,17 +7,8 @@
7 7
   The nixpkgs repository has several utility functions to manipulate Nix expressions.
8 8
  </para>
9 9
  <xi:include href="functions/library.xml" />
10
- <xi:include href="functions/overrides.xml" />
11 10
  <xi:include href="functions/generators.xml" />
12 11
  <xi:include href="functions/debug.xml" />
13
- <xi:include href="functions/fetchers.xml" />
14
- <xi:include href="functions/trivial-builders.xml" />
15
- <xi:include href="functions/fhs-environments.xml" />
16
- <xi:include href="functions/shell.xml" />
17
- <xi:include href="functions/dockertools.xml" />
18
- <xi:include href="functions/snaptools.xml" />
19
- <xi:include href="functions/appimagetools.xml" />
20 12
  <xi:include href="functions/prefer-remote-fetch.xml" />
21 13
  <xi:include href="functions/nix-gitignore.xml" />
22
- <xi:include href="functions/ocitools.xml" />
23 14
 </chapter>

+ 1
- 1
doc/languages-frameworks/android.section.md View File

@@ -95,7 +95,7 @@ $ nix-build
95 95
 
96 96
 The Android SDK gets deployed with all desired plugin versions.
97 97
 
98
-We can also deploy subsets of the Android SDK. For example, to only the the
98
+We can also deploy subsets of the Android SDK. For example, to only the
99 99
 `platform-tools` package, you can evaluate the following expression:
100 100
 
101 101
 ```nix

+ 1
- 1
doc/languages-frameworks/emscripten.section.md View File

@@ -1,4 +1,4 @@
1
-# User's Guide to Emscripten in Nixpkgs
1
+# Emscripten
2 2
 
3 3
 [Emscripten](https://github.com/kripken/emscripten): An LLVM-to-JavaScript Compiler
4 4
 

+ 2
- 21
doc/languages-frameworks/gnome.xml View File

@@ -32,11 +32,7 @@
32 32
    <title>Icons</title>
33 33
 
34 34
    <para>
35
-    When an application uses icons, an icon theme should be available in <envar>XDG_DATA_DIRS</envar> during runtime. The package for the default, icon-less <link xlink:href="https://www.freedesktop.org/wiki/Software/icon-theme/">hicolor-icon-theme</link> (should be propagated by every icon theme) contains <link linkend="ssec-gnome-hooks-hicolor-icon-theme">a setup hook</link> that will pick up icon themes from <literal>buildInputs</literal> and pass it to our wrapper. Unfortunately, relying on that would mean every user has to download the theme included in the package expression no matter their preference. For that reason, we leave the installation of icon theme on the user. If you use one of the desktop environments, you probably already have an icon theme installed.
36
-   </para>
37
-
38
-   <para>
39
-    To avoid costly file system access when locating icons, GTK, <link xlink:href="https://woboq.com/blog/qicon-reads-gtk-icon-cache-in-qt57.html">as well as Qt</link>, can rely on <filename>icon-theme.cache</filename> files from the themes’ top-level directories. These files are generated using <command>gtk-update-icon-cache</command>, which is expected to be run whenever an icon is added or removed to an icon theme (typically an application icon into <literal>hicolor</literal> theme) and some programs do indeed run this after icon installation. However, since packages are installed into their own prefix by Nix, this would lead to conflicts. For that reason, <package>gtk3</package> provides a <link xlink:href="#ssec-gnome-hooks-gtk-drop-icon-theme-cache">setup hook</link> that will clean the file from installation. Since most applications only ship their own icon that will be loaded on start-up, it should not affect them too much. On the other hand, icon themes are much larger and more widely used so we need to cache them. Because we recommend installing icon themes globally, we will generate the cache files from all packages in a profile using a NixOS module. You can enable the cache generation using <option>gtk.iconCache.enable</option> option if your desktop environment does not already do that.
35
+    When an application uses icons, an icon theme should be available in <envar>XDG_DATA_DIRS</envar>. The package for the default, icon-less <link xlink:href="https://www.freedesktop.org/wiki/Software/icon-theme/">hicolor-icon-theme</link> contains <link linkend="ssec-gnome-hooks-hicolor-icon-theme">a setup hook</link> that will pick up icon themes from <literal>buildInputs</literal> and pass it to our wrapper. Unfortunately, relying on that would mean every user has to download the theme included in the package expression no matter their preference. For that reason, we leave the installation of icon theme on the user. If you use one of the desktop environments, you probably already have an icon theme installed.
40 36
    </para>
41 37
   </section>
42 38
 
@@ -95,11 +91,6 @@ preFixup = ''
95 91
       <package>glib</package> setup hook will populate <envar>GSETTINGS_SCHEMAS_PATH</envar> and then <package>wrapGAppsHook</package> will prepend it to <envar>XDG_DATA_DIRS</envar>.
96 92
      </para>
97 93
     </listitem>
98
-    <listitem xml:id="ssec-gnome-hooks-gtk-drop-icon-theme-cache">
99
-     <para>
100
-      One of <package>gtk3</package>’s setup hooks will remove <filename>icon-theme.cache</filename> files from package’s icon theme directories to avoid conflicts. Icon theme packages should prevent this with <code>dontDropIconThemeCache = true;</code>.
101
-     </para>
102
-    </listitem>
103 94
     <listitem xml:id="ssec-gnome-hooks-dconf">
104 95
      <para>
105 96
       <package>gnome3.dconf.lib</package> is a dependency of <package>wrapGAppsHook</package>, which then also adds it to the <envar>GIO_EXTRA_MODULES</envar> variable.
@@ -219,7 +210,7 @@ mkDerivation {
219 210
   dontWrapGApps = true;
220 211
 
221 212
   # Arguments to be passed to `makeWrapper`, only used by qt5’s mkDerivation
222
-  qtWrapperArgs = [
213
+  qtWrapperArgs [
223 214
     "\${gappsWrapperArgs[@]}"
224 215
   ];
225 216
 }
@@ -267,16 +258,6 @@ mkDerivation {
267 258
      </para>
268 259
     </listitem>
269 260
    </varlistentry>
270
-   <varlistentry xml:id="ssec-gnome-common-issues-weird-location">
271
-    <term>
272
-     I need to wrap a binary outside <filename>bin</filename> and <filename>libexec</filename> directories.
273
-    </term>
274
-    <listitem>
275
-     <para>
276
-      You can manually trigger the wrapping with <function>wrapGApp</function> in <literal>preFixup</literal> phase. It takes a path to a program as a first argument; the remaining arguments are passed directly to <function xlink:href="#fun-wrapProgram">wrapProgram</function> function.
277
-     </para>
278
-    </listitem>
279
-   </varlistentry>
280 261
   </variablelist>
281 262
  </section>
282 263
 </section>

+ 1
- 1
doc/languages-frameworks/haskell.section.md View File

@@ -3,7 +3,7 @@ title: User's Guide for Haskell in Nixpkgs
3 3
 author: Peter Simons
4 4
 date: 2015-06-01
5 5
 ---
6
-# User's Guide to the Haskell Infrastructure
6
+# Haskell
7 7
 
8 8
 
9 9
 ## How to install Haskell packages

+ 1
- 1
doc/languages-frameworks/idris.section.md View File

@@ -1,4 +1,4 @@
1
-# Idris packages
1
+# Idris
2 2
 
3 3
 ## Installing Idris
4 4
 

+ 3
- 3
doc/languages-frameworks/index.xml View File

@@ -1,7 +1,7 @@
1 1
 <chapter xmlns="http://docbook.org/ns/docbook"
2 2
          xmlns:xi="http://www.w3.org/2001/XInclude"
3 3
          xml:id="chap-language-support">
4
- <title>Support for specific programming languages and frameworks</title>
4
+ <title>Languages and frameworks</title>
5 5
  <para>
6 6
   The <link linkend="chap-stdenv">standard build environment</link> makes it easy to build typical Autotools-based packages with very little code. Any other kind of package can be accomodated by overriding the appropriate phases of <literal>stdenv</literal>. However, there are specialised functions in Nixpkgs to easily build packages for other programming languages, such as Perl or Haskell. These are described in this chapter.
7 7
  </para>
@@ -9,6 +9,8 @@
9 9
  <xi:include href="beam.xml" />
10 10
  <xi:include href="bower.xml" />
11 11
  <xi:include href="coq.xml" />
12
+ <xi:include href="crystal.section.xml" />
13
+ <xi:include href="emscripten.section.xml" />
12 14
  <xi:include href="gnome.xml" />
13 15
  <xi:include href="go.xml" />
14 16
  <xi:include href="haskell.section.xml" />
@@ -27,6 +29,4 @@
27 29
  <xi:include href="texlive.xml" />
28 30
  <xi:include href="titanium.section.xml" />
29 31
  <xi:include href="vim.section.xml" />
30
- <xi:include href="emscripten.section.xml" />
31
- <xi:include href="crystal.section.xml" />
32 32
 </chapter>

+ 11
- 1
doc/languages-frameworks/ios.section.md View File

@@ -1,7 +1,7 @@
1 1
 ---
2 2
 title: iOS
3 3
 author: Sander van der Burg
4
-date: 2018-11-18
4
+date: 2019-11-10
5 5
 ---
6 6
 # iOS
7 7
 
@@ -217,3 +217,13 @@ xcode.simulateApp {
217 217
 
218 218
 By providing the result of an `xcode.buildApp {}` function and configuring the
219 219
 app bundle id, the app gets deployed automatically and started.
220
+
221
+Troubleshooting
222
+---------------
223
+In some rare cases, it may happen that after a failure, changes are not picked
224
+up. Most likely, this is caused by a derived data cache that Xcode maintains.
225
+To wipe it you can run:
226
+
227
+```bash
228
+$ rm -rf ~/Library/Developer/Xcode/DerivedData
229
+```

+ 2
- 2
doc/languages-frameworks/node.section.md View File

@@ -1,5 +1,5 @@
1
-Node.js packages
2
-================
1
+Node.js
2
+=======
3 3
 The `pkgs/development/node-packages` folder contains a generated collection of
4 4
 [NPM packages](https://npmjs.com/) that can be installed with the Nix package
5 5
 manager.

+ 3
- 2
doc/languages-frameworks/python.section.md View File

@@ -850,8 +850,9 @@ Note: There is a boolean value `lib.inNixShell` set to `true` if nix-shell is in
850 850
 Packages inside nixpkgs are written by hand. However many tools exist in
851 851
 community to help save time. No tool is preferred at the moment.
852 852
 
853
-- [pypi2nix](https://github.com/nix-community/pypi2nix): Generate Nix expressions for your Python project. Note that [sharing derivations from pypi2nix with nixpkgs is possible but not encouraged](https://github.com/nix-community/pypi2nix/issues/222#issuecomment-443497376).
854
-- [python2nix](https://github.com/proger/python2nix) by Vladimir Kirillov.
853
+- [python2nix](https://github.com/proger/python2nix) by Vladimir Kirillov
854
+- [pypi2nix](https://github.com/garbas/pypi2nix) by Rok Garbas
855
+- [pypi2nix](https://github.com/offlinehacker/pypi2nix) by Jaka Hudoklin
855 856
 
856 857
 ### Deterministic builds
857 858
 

+ 2
- 2
doc/languages-frameworks/r.section.md View File

@@ -1,5 +1,5 @@
1
-R packages
2
-==========
1
+R
2
+=
3 3
 
4 4
 ## Installation
5 5
 

+ 2
- 6
doc/languages-frameworks/rust.section.md View File

@@ -4,7 +4,7 @@ author: Matthias Beyer
4 4
 date: 2017-03-05
5 5
 ---
6 6
 
7
-# User's Guide to the Rust Infrastructure
7
+# Rust
8 8
 
9 9
 To install the rust compiler and cargo put
10 10
 
@@ -43,7 +43,6 @@ rustPlatform.buildRustPackage rec {
43 43
   };
44 44
 
45 45
   cargoSha256 = "0q68qyl2h6i0qsz82z840myxlnjay8p1w5z7hfyr8fqp7wgwa9cx";
46
-  verifyCargoDeps = true;
47 46
 
48 47
   meta = with stdenv.lib; {
49 48
     description = "A fast line-oriented regex search tool, similar to ag and ack";
@@ -65,9 +64,6 @@ When the `Cargo.lock`, provided by upstream, is not in sync with the
65 64
 added in `cargoPatches` will also be prepended to the patches in `patches` at
66 65
 build-time.
67 66
 
68
-When `verifyCargoDeps` is set to `true`, the build will also verify that the
69
-`cargoSha256` is not out of date by comparing the `Cargo.lock` file in both the `cargoDeps` and `src`. Note that this option changes the value of `cargoSha256` since it also copies the `Cargo.lock` in it. To avoid breaking backward-compatibility this option is not enabled by default but hopefully will be in the future.
70
-
71 67
 ## Compiling Rust crates using Nix instead of Cargo
72 68
 
73 69
 ### Simple operation
@@ -192,7 +188,7 @@ argument and returns a set that contains all attribute that should be
192 188
 overwritten.
193 189
 
194 190
 For more complicated cases, such as when parts of the crate's
195
-derivation depend on the the crate's version, the `attrs` argument of
191
+derivation depend on the crate's version, the `attrs` argument of
196 192
 the override above can be read, as in the following example, which
197 193
 patches the derivation:
198 194
 

+ 1
- 1
doc/languages-frameworks/vim.section.md View File

@@ -3,7 +3,7 @@ title: User's Guide for Vim in Nixpkgs
3 3
 author: Marc Weber
4 4
 date: 2016-06-25
5 5
 ---
6
-# User's Guide to Vim Plugins/Addons/Bundles/Scripts in Nixpkgs
6
+# Vim
7 7
 
8 8
 Both Neovim and Vim can be configured to include your favorite plugins
9 9
 and additional libraries.

+ 32
- 16
doc/manual.xml View File

@@ -6,20 +6,36 @@
6 6
   </subtitle>
7 7
  </info>
8 8
  <xi:include href="introduction.chapter.xml" />
9
- <xi:include href="quick-start.xml" />
10
- <xi:include href="package-specific-user-notes.xml" />
11
- <xi:include href="stdenv.xml" />
12
- <xi:include href="multiple-output.xml" />
13
- <xi:include href="cross-compilation.xml" />
14
- <xi:include href="configuration.xml" />
15
- <xi:include href="functions.xml" />
16
- <xi:include href="meta.xml" />
17
- <xi:include href="languages-frameworks/index.xml" />
18
- <xi:include href="platform-notes.xml" />
19
- <xi:include href="package-notes.xml" />
20
- <xi:include href="overlays.xml" />
21
- <xi:include href="coding-conventions.xml" />
22
- <xi:include href="submitting-changes.xml" />
23
- <xi:include href="reviewing-contributions.xml" />
24
- <xi:include href="contributing.xml" />
9
+ <part>
10
+  <title>Using Nixpkgs</title>
11
+  <xi:include href="configuration.xml" />
12
+  <xi:include href="overlays.xml" />
13
+  <xi:include href="overrides.xml" />
14
+  <xi:include href="functions.xml" />
15
+ </part>
16
+ <part>
17
+  <title>Standard environment</title>
18
+  <xi:include href="stdenv.xml" />
19
+  <xi:include href="meta.xml" />
20
+  <xi:include href="multiple-output.xml" />
21
+  <xi:include href="cross-compilation.xml" />
22
+  <xi:include href="platform-notes.xml" />
23
+ </part>
24
+ <part>
25
+  <title>Builders</title>
26
+  <xi:include href="builders/fetchers.xml" />
27
+  <xi:include href="builders/trivial-builders.xml" />
28
+  <xi:include href="builders/special.xml" />
29
+  <xi:include href="builders/images.xml" />
30
+  <xi:include href="languages-frameworks/index.xml" />
31
+  <xi:include href="packages/index.xml" />
32
+ </part>
33
+ <part>
34
+  <title>Contributing to Nixpkgs</title>
35
+  <xi:include href="quick-start.xml" />
36
+  <xi:include href="coding-conventions.xml" />
37
+  <xi:include href="submitting-changes.xml" />
38
+  <xi:include href="reviewing-contributions.xml" />
39
+  <xi:include href="contributing-to-documentation.xml" />
40
+ </part>
25 41
 </book>

doc/functions/overrides.xml → doc/overrides.xml View File

@@ -1,7 +1,7 @@
1
-<section xmlns="http://docbook.org/ns/docbook"
1
+<chapter xmlns="http://docbook.org/ns/docbook"
2 2
          xmlns:xlink="http://www.w3.org/1999/xlink"
3 3
          xmlns:xi="http://www.w3.org/2001/XInclude"
4
-         xml:id="sec-overrides">
4
+         xml:id="chap-overrides">
5 5
  <title>Overriding</title>
6 6
 
7 7
  <para>
@@ -148,4 +148,4 @@ c = lib.makeOverridable f { a = 1; b = 2; };
148 148
    The variable <varname>c</varname> however also has some additional functions, like <link linkend="sec-pkg-override">c.override</link> which can be used to override the default arguments. In this example the value of <varname>(c.override { a = 4; }).result</varname> is 6.
149 149
   </para>
150 150
  </section>
151
-</section>
151
+</chapter>

+ 0
- 422
doc/package-notes.xml View File

@@ -1,422 +0,0 @@
1
-<chapter xmlns="http://docbook.org/ns/docbook"
2
-         xmlns:xlink="http://www.w3.org/1999/xlink"
3
-         xml:id="chap-package-notes">
4
- <title>Package Notes</title>
5
- <para>
6
-  This chapter contains information about how to use and maintain the Nix expressions for a number of specific packages, such as the Linux kernel or X.org.
7
- </para>
8
-<!--============================================================-->
9
- <section xml:id="sec-linux-kernel">
10
-  <title>Linux kernel</title>
11
-
12
-  <para>
13
-   The Nix expressions to build the Linux kernel are in <link
14
-xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel"><filename>pkgs/os-specific/linux/kernel</filename></link>.
15
-  </para>
16
-
17
-  <para>
18
-   The function that builds the kernel has an argument <varname>kernelPatches</varname> which should be a list of <literal>{name, patch, extraConfig}</literal> attribute sets, where <varname>name</varname> is the name of the patch (which is included in the kernel’s <varname>meta.description</varname> attribute), <varname>patch</varname> is the patch itself (possibly compressed), and <varname>extraConfig</varname> (optional) is a string specifying extra options to be concatenated to the kernel configuration file (<filename>.config</filename>).
19
-  </para>
20
-
21
-  <para>
22
-   The kernel derivation exports an attribute <varname>features</varname> specifying whether optional functionality is or isn’t enabled. This is used in NixOS to implement kernel-specific behaviour. For instance, if the kernel has the <varname>iwlwifi</varname> feature (i.e. has built-in support for Intel wireless chipsets), then NixOS doesn’t have to build the external <varname>iwlwifi</varname> package:
23
-<programlisting>
24
-modulesTree = [kernel]
25
-  ++ pkgs.lib.optional (!kernel.features ? iwlwifi) kernelPackages.iwlwifi
26
-  ++ ...;
27
-</programlisting>
28
-  </para>
29
-
30
-  <para>
31
-   How to add a new (major) version of the Linux kernel to Nixpkgs:
32
-   <orderedlist>
33
-    <listitem>
34
-     <para>
35
-      Copy the old Nix expression (e.g. <filename>linux-2.6.21.nix</filename>) to the new one (e.g. <filename>linux-2.6.22.nix</filename>) and update it.
36
-     </para>
37
-    </listitem>
38
-    <listitem>
39
-     <para>
40
-      Add the new kernel to <filename>all-packages.nix</filename> (e.g., create an attribute <varname>kernel_2_6_22</varname>).
41
-     </para>
42
-    </listitem>
43
-    <listitem>
44
-     <para>
45
-      Now we’re going to update the kernel configuration. First unpack the kernel. Then for each supported platform (<literal>i686</literal>, <literal>x86_64</literal>, <literal>uml</literal>) do the following:
46
-      <orderedlist>
47
-       <listitem>
48
-        <para>
49
-         Make an copy from the old config (e.g. <filename>config-2.6.21-i686-smp</filename>) to the new one (e.g. <filename>config-2.6.22-i686-smp</filename>).
50
-        </para>
51
-       </listitem>
52
-       <listitem>
53
-        <para>
54
-         Copy the config file for this platform (e.g. <filename>config-2.6.22-i686-smp</filename>) to <filename>.config</filename> in the kernel source tree.
55
-        </para>
56
-       </listitem>
57
-       <listitem>
58
-        <para>
59
-         Run <literal>make oldconfig ARCH=<replaceable>{i386,x86_64,um}</replaceable></literal> and answer all questions. (For the uml configuration, also add <literal>SHELL=bash</literal>.) Make sure to keep the configuration consistent between platforms (i.e. don’t enable some feature on <literal>i686</literal> and disable it on <literal>x86_64</literal>).
60
-        </para>
61
-       </listitem>
62
-       <listitem>
63
-        <para>
64
-         If needed you can also run <literal>make menuconfig</literal>:
65
-<screen>
66
-<prompt>$ </prompt>nix-env -i ncurses
67
-<prompt>$ </prompt>export NIX_CFLAGS_LINK=-lncurses
68
-<prompt>$ </prompt>make menuconfig ARCH=<replaceable>arch</replaceable></screen>
69
-        </para>
70
-       </listitem>
71
-       <listitem>
72
-        <para>
73
-         Copy <filename>.config</filename> over the new config file (e.g. <filename>config-2.6.22-i686-smp</filename>).
74
-        </para>
75
-       </listitem>
76
-      </orderedlist>
77
-     </para>
78
-    </listitem>
79
-    <listitem>
80
-     <para>
81
-      Test building the kernel: <literal>nix-build -A kernel_2_6_22</literal>. If it compiles, ship it! For extra credit, try booting NixOS with it.
82
-     </para>
83
-    </listitem>
84
-    <listitem>
85
-     <para>
86
-      It may be that the new kernel requires updating the external kernel modules and kernel-dependent packages listed in the <varname>linuxPackagesFor</varname> function in <filename>all-packages.nix</filename> (such as the NVIDIA drivers, AUFS, etc.). If the updated packages aren’t backwards compatible with older kernels, you may need to keep the older versions around.
87
-     </para>
88
-    </listitem>
89
-   </orderedlist>
90
-  </para>
91
- </section>
92
-<!--============================================================-->
93
- <section xml:id="sec-xorg">
94
-  <title>X.org</title>
95
-
96
-  <para>
97
-   The Nix expressions for the X.org packages reside in <filename>pkgs/servers/x11/xorg/default.nix</filename>. This file is automatically generated from lists of tarballs in an X.org release. As such it should not be modified directly; rather, you should modify the lists, the generator script or the file <filename>pkgs/servers/x11/xorg/overrides.nix</filename>, in which you can override or add to the derivations produced by the generator.
98
-  </para>
99
-
100
-  <para>
101
-   The generator is invoked as follows:
102
-<screen>
103
-<prompt>$ </prompt>cd pkgs/servers/x11/xorg
104
-<prompt>$ </prompt>cat tarballs-7.5.list extra.list old.list \
105
-  | perl ./generate-expr-from-tarballs.pl
106
-</screen>
107
-   For each of the tarballs in the <filename>.list</filename> files, the script downloads it, unpacks it, and searches its <filename>configure.ac</filename> and <filename>*.pc.in</filename> files for dependencies. This information is used to generate <filename>default.nix</filename>. The generator caches downloaded tarballs between runs. Pay close attention to the <literal>NOT FOUND: <replaceable>name</replaceable></literal> messages at the end of the run, since they may indicate missing dependencies. (Some might be optional dependencies, however.)
108
-  </para>
109
-
110
-  <para>
111
-   A file like <filename>tarballs-7.5.list</filename> contains all tarballs in a X.org release. It can be generated like this:
112
-<screen>
113
-<prompt>$ </prompt>export i="mirror://xorg/X11R7.4/src/everything/"
114
-<prompt>$ </prompt>cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
115
-  | perl -e 'while (&lt;>) { if (/(href|HREF)="([^"]*.bz2)"/) { print "$ENV{'i'}$2\n"; }; }' \
116
-  | sort > tarballs-7.4.list
117
-</screen>
118
-   <filename>extra.list</filename> contains libraries that aren’t part of X.org proper, but are closely related to it, such as <literal>libxcb</literal>. <filename>old.list</filename> contains some packages that were removed from X.org, but are still needed by some people or by other packages (such as <varname>imake</varname>).
119
-  </para>
120
-
121
-  <para>
122
-   If the expression for a package requires derivation attributes that the generator cannot figure out automatically (say, <varname>patches</varname> or a <varname>postInstall</varname> hook), you should modify <filename>pkgs/servers/x11/xorg/overrides.nix</filename>.
123
-  </para>
124
- </section>
125
-<!--============================================================-->
126
-<!--
127
-<section xml:id="sec-package-notes-gnome">
128
-  <title>Gnome</title>
129
-  <para>* Expression is auto-generated</para>
130
-  <para>* How to update</para>
131
-</section>
132
--->
133
-<!--============================================================-->
134
-<!--
135
-<section xml:id="sec-package-notes-gcc">
136
-  <title>GCC</title>
137
-  <para>…</para>
138
-</section>
139
--->
140
-<!--============================================================-->
141
- <section xml:id="sec-eclipse">
142
-  <title>Eclipse</title>
143
-
144
-  <para>
145
-   The Nix expressions related to the Eclipse platform and IDE are in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/eclipse"><filename>pkgs/applications/editors/eclipse</filename></link>.
146
-  </para>
147
-
148
-  <para>
149
-   Nixpkgs provides a number of packages that will install Eclipse in its various forms. These range from the bare-bones Eclipse Platform to the more fully featured Eclipse SDK or Scala-IDE packages and multiple version are often available. It is possible to list available Eclipse packages by issuing the command:
150
-<screen>
151
-<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses --description
152
-</screen>
153
-   Once an Eclipse variant is installed it can be run using the <command>eclipse</command> command, as expected. From within Eclipse it is then possible to install plugins in the usual manner by either manually specifying an Eclipse update site or by installing the Marketplace Client plugin and using it to discover and install other plugins. This installation method provides an Eclipse installation that closely resemble a manually installed Eclipse.
154
-  </para>
155
-
156
-  <para>
157
-   If you prefer to install plugins in a more declarative manner then Nixpkgs also offer a number of Eclipse plugins that can be installed in an <emphasis>Eclipse environment</emphasis>. This type of environment is created using the function <varname>eclipseWithPlugins</varname> found inside the <varname>nixpkgs.eclipses</varname> attribute set. This function takes as argument <literal>{ eclipse, plugins ? [], jvmArgs ? [] }</literal> where <varname>eclipse</varname> is a one of the Eclipse packages described above, <varname>plugins</varname> is a list of plugin derivations, and <varname>jvmArgs</varname> is a list of arguments given to the JVM running the Eclipse. For example, say you wish to install the latest Eclipse Platform with the popular Eclipse Color Theme plugin and also allow Eclipse to use more RAM. You could then add
158
-<screen>
159
-packageOverrides = pkgs: {
160
-  myEclipse = with pkgs.eclipses; eclipseWithPlugins {
161
-    eclipse = eclipse-platform;
162
-    jvmArgs = [ "-Xmx2048m" ];
163
-    plugins = [ plugins.color-theme ];
164
-  };
165
-}
166
-</screen>
167
-   to your Nixpkgs configuration (<filename>~/.config/nixpkgs/config.nix</filename>) and install it by running <command>nix-env -f '&lt;nixpkgs&gt;' -iA myEclipse</command> and afterward run Eclipse as usual. It is possible to find out which plugins are available for installation using <varname>eclipseWithPlugins</varname> by running
168
-<screen>
169
-<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses.plugins --description
170
-</screen>
171
-  </para>
172
-
173
-  <para>
174
-   If there is a need to install plugins that are not available in Nixpkgs then it may be possible to define these plugins outside Nixpkgs using the <varname>buildEclipseUpdateSite</varname> and <varname>buildEclipsePlugin</varname> functions found in the <varname>nixpkgs.eclipses.plugins</varname> attribute set. Use the <varname>buildEclipseUpdateSite</varname> function to install a plugin distributed as an Eclipse update site. This function takes <literal>{ name, src }</literal> as argument where <literal>src</literal> indicates the Eclipse update site archive. All Eclipse features and plugins within the downloaded update site will be installed. When an update site archive is not available then the <varname>buildEclipsePlugin</varname> function can be used to install a plugin that consists of a pair of feature and plugin JARs. This function takes an argument <literal>{ name, srcFeature, srcPlugin }</literal> where <literal>srcFeature</literal> and <literal>srcPlugin</literal> are the feature and plugin JARs, respectively.
175
-  </para>
176
-
177
-  <para>
178
-   Expanding the previous example with two plugins using the above functions we have
179
-<screen>
180
-packageOverrides = pkgs: {
181
-  myEclipse = with pkgs.eclipses; eclipseWithPlugins {
182
-    eclipse = eclipse-platform;
183
-    jvmArgs = [ "-Xmx2048m" ];
184
-    plugins = [
185
-      plugins.color-theme
186
-      (plugins.buildEclipsePlugin {
187
-        name = "myplugin1-1.0";
188
-        srcFeature = fetchurl {
189
-          url = "http://…/features/myplugin1.jar";
190
-          sha256 = "123…";
191
-        };
192
-        srcPlugin = fetchurl {
193
-          url = "http://…/plugins/myplugin1.jar";
194
-          sha256 = "123…";
195
-        };
196
-      });
197
-      (plugins.buildEclipseUpdateSite {
198
-        name = "myplugin2-1.0";
199
-        src = fetchurl {
200
-          stripRoot = false;
201
-          url = "http://…/myplugin2.zip";
202
-          sha256 = "123…";
203
-        };
204
-      });
205
-    ];
206
-  };
207
-}
208
-</screen>
209
-  </para>
210
- </section>
211
- <section xml:id="sec-elm">
212
-  <title>Elm</title>
213
-
214
-  <para>
215
-   To start a development environment do <command>nix-shell -p elmPackages.elm elmPackages.elm-format</command>
216
-  </para>
217
-
218
-  <para>
219
-   To update Elm compiler, see <filename>nixpkgs/pkgs/development/compilers/elm/README.md</filename>.
220
-  </para>
221
-
222
-  <para>
223
-   To package Elm applications, <link xlink:href="https://github.com/hercules-ci/elm2nix#elm2nix">read about elm2nix</link>.
224
-  </para>
225
- </section>
226
- <section xml:id="sec-kakoune">
227
-  <title>Kakoune</title>
228
-
229
-  <para>
230
-   Kakoune can be built to autoload plugins:
231
-<programlisting>(kakoune.override {
232
-  configure = {
233
-    plugins = with pkgs.kakounePlugins; [ parinfer-rust ];
234
-  };
235
-})</programlisting>
236
-  </para>
237
- </section>
238
- <section xml:id="sec-shell-helpers">
239
-  <title>Interactive shell helpers</title>
240
-
241
-  <para>
242
-   Some packages provide the shell integration to be more useful. But unlike other systems, nix doesn't have a standard share directory location. This is why a bunch <command>PACKAGE-share</command> scripts are shipped that print the location of the corresponding shared folder. Current list of such packages is as following:
243
-   <itemizedlist>
244
-    <listitem>
245
-     <para>
246
-      <literal>autojump</literal>: <command>autojump-share</command>
247
-     </para>
248
-    </listitem>
249
-    <listitem>
250
-     <para>
251
-      <literal>fzf</literal>: <command>fzf-share</command>
252
-     </para>
253
-    </listitem>
254
-   </itemizedlist>
255
-   E.g. <literal>autojump</literal> can then used in the .bashrc like this:
256
-<screen>
257
-  source "$(autojump-share)/autojump.bash"
258
-</screen>
259
-  </para>
260
- </section>
261
- <section xml:id="sec-weechat">
262
-  <title>Weechat</title>
263
-
264
-  <para>
265
-   Weechat can be configured to include your choice of plugins, reducing its closure size from the default configuration which includes all available plugins. To make use of this functionality, install an expression that overrides its configuration such as
266
-<programlisting>weechat.override {configure = {availablePlugins, ...}: {
267
-    plugins = with availablePlugins; [ python perl ];
268
-  }
269
-}</programlisting>
270
-   If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal> attribute, <literal>availablePlugins</literal> will be used automatically.
271
-  </para>
272
-
273
-  <para>
274
-   The plugins currently available are <literal>python</literal>, <literal>perl</literal>, <literal>ruby</literal>, <literal>guile</literal>, <literal>tcl</literal> and <literal>lua</literal>.
275
-  </para>
276
-
277
-  <para>
278
-   The python and perl plugins allows the addition of extra libraries. For instance, the <literal>inotify.py</literal> script in weechat-scripts requires D-Bus or libnotify, and the <literal>fish.py</literal> script requires pycrypto. To use these scripts, use the plugin's <literal>withPackages</literal> attribute:
279
-<programlisting>weechat.override { configure = {availablePlugins, ...}: {
280
-    plugins = with availablePlugins; [
281
-            (python.withPackages (ps: with ps; [ pycrypto python-dbus ]))
282
-        ];
283
-    };
284
-}
285
-</programlisting>
286
-  </para>
287
-
288
-  <para>
289
-   In order to also keep all default plugins installed, it is possible to use the following method:
290
-<programlisting>weechat.override { configure = { availablePlugins, ... }: {
291
-  plugins = builtins.attrValues (availablePlugins // {
292
-    python = availablePlugins.python.withPackages (ps: with ps; [ pycrypto python-dbus ]);
293
-  });
294
-}; }
295
-</programlisting>
296
-  </para>
297
-
298
-  <para>
299
-   WeeChat allows to set defaults on startup using the <literal>--run-command</literal>. The <literal>configure</literal> method can be used to pass commands to the program:
300
-<programlisting>weechat.override {
301
-  configure = { availablePlugins, ... }: {
302
-    init = ''
303
-      /set foo bar
304
-      /server add freenode chat.freenode.org
305
-    '';
306
-  };
307
-}</programlisting>
308
-   Further values can be added to the list of commands when running <literal>weechat --run-command "your-commands"</literal>.
309
-  </para>
310
-
311
-  <para>
312
-   Additionally it's possible to specify scripts to be loaded when starting <literal>weechat</literal>. These will be loaded before the commands from <literal>init</literal>:
313
-<programlisting>weechat.override {
314
-  configure = { availablePlugins, ... }: {
315
-    scripts = with pkgs.weechatScripts; [
316
-      weechat-xmpp weechat-matrix-bridge wee-slack
317
-    ];
318
-    init = ''
319
-      /set plugins.var.python.jabber.key "val"
320
-    '':
321
-  };
322
-}</programlisting>
323
-  </para>
324
-
325
-  <para>
326
-   In <literal>nixpkgs</literal> there's a subpackage which contains derivations for WeeChat scripts. Such derivations expect a <literal>passthru.scripts</literal> attribute which contains a list of all scripts inside the store path. Furthermore all scripts have to live in <literal>$out/share</literal>. An exemplary derivation looks like this:
327
-<programlisting>{ stdenv, fetchurl }:
328
-
329
-stdenv.mkDerivation {
330
-  name = "exemplary-weechat-script";
331
-  src = fetchurl {
332
-    url = "https://scripts.tld/your-scripts.tar.gz";
333
-    sha256 = "...";
334
-  };
335
-  passthru.scripts = [ "foo.py" "bar.lua" ];
336
-  installPhase = ''
337
-    mkdir $out/share
338
-    cp foo.py $out/share
339
-    cp bar.lua $out/share
340
-  '';
341
-}</programlisting>
342
-  </para>
343
- </section>
344
- <section xml:id="sec-ibus-typing-booster">
345
-  <title>ibus-engines.typing-booster</title>
346
-
347
-  <para>
348
-   This package is an ibus-based completion method to speed up typing.
349
-  </para>
350
-
351
-  <section xml:id="sec-ibus-typing-booster-activate">
352
-   <title>Activating the engine</title>
353
-
354
-   <para>
355
-    IBus needs to be configured accordingly to activate <literal>typing-booster</literal>. The configuration depends on the desktop manager in use. For detailed instructions, please refer to the <link xlink:href="https://mike-fabian.github.io/ibus-typing-booster/documentation.html">upstream docs</link>.
356
-   </para>
357
-
358
-   <para>
359
-    On NixOS you need to explicitly enable <literal>ibus</literal> with given engines before customizing your desktop to use <literal>typing-booster</literal>. This can be achieved using the <literal>ibus</literal> module:
360
-<programlisting>{ pkgs, ... }: {
361
-  i18n.inputMethod = {
362
-    enabled = "ibus";
363
-    ibus.engines = with pkgs.ibus-engines; [ typing-booster ];
364
-  };
365
-}</programlisting>
366
-   </para>
367
-  </section>
368
-
369
-  <section xml:id="sec-ibus-typing-booster-customize-hunspell">
370
-   <title>Using custom hunspell dictionaries</title>
371
-
372
-   <para>
373
-    The IBus engine is based on <literal>hunspell</literal> to support completion in many languages. By default the dictionaries <literal>de-de</literal>, <literal>en-us</literal>, <literal>fr-moderne</literal> <literal>es-es</literal>, <literal>it-it</literal>, <literal>sv-se</literal> and <literal>sv-fi</literal> are in use. To add another dictionary, the package can be overridden like this:
374
-<programlisting>ibus-engines.typing-booster.override {
375
-  langs = [ "de-at" "en-gb" ];
376
-}</programlisting>
377
-   </para>
378
-
379
-   <para>
380
-    <emphasis>Note: each language passed to <literal>langs</literal> must be an attribute name in <literal>pkgs.hunspellDicts</literal>.</emphasis>
381
-   </para>
382
-  </section>
383
-
384
-  <section xml:id="sec-ibus-typing-booster-emoji-picker">
385
-   <title>Built-in emoji picker</title>
386
-
387
-   <para>
388
-    The <literal>ibus-engines.typing-booster</literal> package contains a program named <literal>emoji-picker</literal>. To display all emojis correctly, a special font such as <literal>noto-fonts-emoji</literal> is needed:
389
-   </para>
390
-
391
-   <para>
392
-    On NixOS it can be installed using the following expression:
393
-<programlisting>{ pkgs, ... }: {
394
-  fonts.fonts = with pkgs; [ noto-fonts-emoji ];
395
-}</programlisting>
396
-   </para>
397
-  </section>
398
- </section>
399
- <section xml:id="sec-nginx">
400
-  <title>Nginx</title>
401
-
402
-  <para>
403
-   <link xlink:href="https://nginx.org/">Nginx</link> is a reverse proxy and lightweight webserver.
404
-  </para>
405
-
406
-  <section xml:id="sec-nginx-etag">
407
-   <title>ETags on static files served from the Nix store</title>
408
-
409
-   <para>
410
-    HTTP has a couple different mechanisms for caching to prevent clients from having to download the same content repeatedly if a resource has not changed since the last time it was requested. When nginx is used as a server for static files, it implements the caching mechanism based on the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"><literal>Last-Modified</literal></link> response header automatically; unfortunately, it works by using filesystem timestamps to determine the value of the <literal>Last-Modified</literal> header. This doesn't give the desired behavior when the file is in the Nix store, because all file timestamps are set to 0 (for reasons related to build reproducibility).
411
-   </para>
412
-
413
-   <para>
414
-    Fortunately, HTTP supports an alternative (and more effective) caching mechanism: the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"><literal>ETag</literal></link> response header. The value of the <literal>ETag</literal> header specifies some identifier for the particular content that the server is sending (e.g. a hash). When a client makes a second request for the same resource, it sends that value back in an <literal>If-None-Match</literal> header. If the ETag value is unchanged, then the server does not need to resend the content.
415
-   </para>
416
-
417
-   <para>
418
-    As of NixOS 19.09, the nginx package in Nixpkgs is patched such that when nginx serves a file out of <filename>/nix/store</filename>, the hash in the store path is used as the <literal>ETag</literal> header in the HTTP response, thus providing proper caching functionality. This happens automatically; you do not need to do modify any configuration to get this behavior.
419
-   </para>
420
-  </section>
421
- </section>
422
-</chapter>

+ 0
- 357
doc/package-specific-user-notes.xml View File

@@ -1,357 +0,0 @@
1
-<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="package-specific-user-notes">
2
- <title>Package-specific usage notes</title>
3
- <para>
4
-  These chapters includes some notes that apply to specific packages and should answer some of the frequently asked questions related to Nixpkgs use. Some useful information related to package use can be found in <link linkend="chap-package-notes">package-specific development notes</link>.
5
- </para>
6
- <section xml:id="opengl">
7
-  <title>OpenGL</title>
8
-
9
-  <para>
10
-   Packages that use OpenGL have NixOS desktop as their primary target. The current solution for loading the GPU-specific drivers is based on <literal>libglvnd</literal> and looks for the driver implementation in <literal>LD_LIBRARY_PATH</literal>. If you are using a non-NixOS GNU/Linux/X11 desktop with free software video drivers, consider launching OpenGL-dependent programs from Nixpkgs with Nixpkgs versions of <literal>libglvnd</literal> and <literal>mesa_drivers</literal> in <literal>LD_LIBRARY_PATH</literal>. For proprietary video drivers you might have luck with also adding the corresponding video driver package.
11
-  </para>
12
- </section>
13
- <section xml:id="locales">
14
-  <title>Locales</title>
15
-
16
-  <para>
17
-   To allow simultaneous use of packages linked against different versions of <literal>glibc</literal> with different locale archive formats Nixpkgs patches <literal>glibc</literal> to rely on <literal>LOCALE_ARCHIVE</literal> environment variable.
18
-  </para>
19
-
20
-  <para>
21
-   On non-NixOS distributions this variable is obviously not set. This can cause regressions in language support or even crashes in some Nixpkgs-provided programs. The simplest way to mitigate this problem is exporting the <literal>LOCALE_ARCHIVE</literal> variable pointing to <literal>${glibcLocales}/lib/locale/locale-archive</literal>. The drawback (and the reason this is not the default) is the relatively large (a hundred MiB) size of the full set of locales. It is possible to build a custom set of locales by overriding parameters <literal>allLocales</literal> and <literal>locales</literal> of the package.
22
-  </para>
23
- </section>
24
- <section xml:id="sec-emacs">
25
-  <title>Emacs</title>
26
-
27
-  <section xml:id="sec-emacs-config">
28
-   <title>Configuring Emacs</title>
29
-
30
-   <para>
31
-    The Emacs package comes with some extra helpers to make it easier to configure. <varname>emacsWithPackages</varname> allows you to manage packages from ELPA. This means that you will not have to install that packages from within Emacs. For instance, if you wanted to use <literal>company</literal>, <literal>counsel</literal>, <literal>flycheck</literal>, <literal>ivy</literal>, <literal>magit</literal>, <literal>projectile</literal>, and <literal>use-package</literal> you could use this as a <filename>~/.config/nixpkgs/config.nix</filename> override:
32
-   </para>
33
-
34
-<screen>
35
-{
36
-  packageOverrides = pkgs: with pkgs; {
37
-    myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
38
-      company
39
-      counsel
40
-      flycheck
41
-      ivy
42
-      magit
43
-      projectile
44
-      use-package
45
-    ]));
46
-  }
47
-}
48
-</screen>
49
-
50
-   <para>
51
-    You can install it like any other packages via <command>nix-env -iA myEmacs</command>. However, this will only install those packages. It will not <literal>configure</literal> them for us. To do this, we need to provide a configuration file. Luckily, it is possible to do this from within Nix! By modifying the above example, we can make Emacs load a custom config file. The key is to create a package that provide a <filename>default.el</filename> file in <filename>/share/emacs/site-start/</filename>. Emacs knows to load this file automatically when it starts.
52
-   </para>
53
-
54
-<screen>
55
-{
56
-  packageOverrides = pkgs: with pkgs; rec {
57
-    myEmacsConfig = writeText "default.el" ''
58
-;; initialize package
59
-
60
-(require 'package)
61
-(package-initialize 'noactivate)
62
-(eval-when-compile
63
-  (require 'use-package))
64
-
65
-;; load some packages
66
-
67
-(use-package company
68
-  :bind ("&lt;C-tab&gt;" . company-complete)
69
-  :diminish company-mode
70
-  :commands (company-mode global-company-mode)
71
-  :defer 1
72
-  :config
73
-  (global-company-mode))
74
-
75
-(use-package counsel
76
-  :commands (counsel-descbinds)
77
-  :bind (([remap execute-extended-command] . counsel-M-x)
78
-         ("C-x C-f" . counsel-find-file)
79
-         ("C-c g" . counsel-git)
80
-         ("C-c j" . counsel-git-grep)
81
-         ("C-c k" . counsel-ag)
82
-         ("C-x l" . counsel-locate)
83
-         ("M-y" . counsel-yank-pop)))
84
-
85
-(use-package flycheck
86
-  :defer 2
87
-  :config (global-flycheck-mode))
88
-
89
-(use-package ivy
90
-  :defer 1
91
-  :bind (("C-c C-r" . ivy-resume)
92
-         ("C-x C-b" . ivy-switch-buffer)
93
-         :map ivy-minibuffer-map
94
-         ("C-j" . ivy-call))
95
-  :diminish ivy-mode
96
-  :commands ivy-mode
97
-  :config
98
-  (ivy-mode 1))
99
-
100
-(use-package magit
101
-  :defer
102
-  :if (executable-find "git")
103
-  :bind (("C-x g" . magit-status)
104
-         ("C-x G" . magit-dispatch-popup))
105
-  :init
106
-  (setq magit-completing-read-function 'ivy-completing-read))
107
-
108
-(use-package projectile
109
-  :commands projectile-mode
110
-  :bind-keymap ("C-c p" . projectile-command-map)
111
-  :defer 5
112
-  :config
113
-  (projectile-global-mode))
114
-    '';
115
-    myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
116
-      (runCommand "default.el" {} ''
117
-mkdir -p $out/share/emacs/site-lisp
118
-cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
119
-'')
120
-      company
121
-      counsel
122
-      flycheck
123
-      ivy
124
-      magit
125
-      projectile
126
-      use-package
127
-    ]));
128
-  };
129
-}
130
-</screen>
131
-
132
-   <para>
133
-    This provides a fairly full Emacs start file. It will load in addition to the user's presonal config. You can always disable it by passing <command>-q</command> to the Emacs command.
134
-   </para>
135
-
136
-   <para>
137
-    Sometimes <varname>emacsWithPackages</varname> is not enough, as this package set has some priorities imposed on packages (with the lowest priority assigned to Melpa Unstable, and the highest for packages manually defined in <filename>pkgs/top-level/emacs-packages.nix</filename>). But you can't control this priorities when some package is installed as a dependency. You can override it on per-package-basis, providing all the required dependencies manually - but it's tedious and there is always a possibility that an unwanted dependency will sneak in through some other package. To completely override such a package you can use <varname>overrideScope'</varname>.
138
-   </para>
139
-
140
-<screen>
141
-overrides = self: super: rec {
142
-  haskell-mode = self.melpaPackages.haskell-mode;
143
-  ...
144
-};
145
-((emacsPackagesGen emacs).overrideScope' overrides).emacsWithPackages (p: with p; [
146
-  # here both these package will use haskell-mode of our own choice
147
-  ghc-mod
148
-  dante
149
-])
150
-</screen>
151
-  </section>
152
- </section>
153
- <section xml:id="dlib">
154
-  <title>DLib</title>
155
-
156
-  <para>
157
-   <link xlink:href="http://dlib.net/">DLib</link> is a modern, C++-based toolkit which provides several machine learning algorithms.
158
-  </para>
159
-
160
-  <section xml:id="compiling-without-avx-support">
161
-   <title>Compiling without AVX support</title>
162
-
163
-   <para>
164
-    Especially older CPUs don't support <link xlink:href="https://en.wikipedia.org/wiki/Advanced_Vector_Extensions">AVX</link> (<abbrev>Advanced Vector Extensions</abbrev>) instructions that are used by DLib to optimize their algorithms.
165
-   </para>
166
-
167
-   <para>
168
-    On the affected hardware errors like <literal>Illegal instruction</literal> will occur. In those cases AVX support needs to be disabled:
169
-<programlisting>self: super: {
170
-  dlib = super.dlib.override { avxSupport = false; };
171
-}</programlisting>
172
-   </para>
173
-  </section>
174
- </section>
175
- <section xml:id="unfree-software">
176
-  <title>Unfree software</title>
177
-
178
-  <para>
179
-   All users of Nixpkgs are free software users, and many users (and developers) of Nixpkgs want to limit and tightly control their exposure to unfree software. At the same time, many users need (or want) to run some specific pieces of proprietary software. Nixpkgs includes some expressions for unfree software packages. By default unfree software cannot be installed and doesn’t show up in searches. To allow installing unfree software in a single Nix invocation one can export <literal>NIXPKGS_ALLOW_UNFREE=1</literal>. For a persistent solution, users can set <literal>allowUnfree</literal> in the Nixpkgs configuration.
180
-  </para>
181
-
182
-  <para>
183
-   Fine-grained control is possible by defining <literal>allowUnfreePredicate</literal> function in config; it takes the <literal>mkDerivation</literal> parameter attrset and returns <literal>true</literal> for unfree packages that should be allowed.
184
-  </para>
185
- </section>
186
- <section xml:id="sec-steam">
187
-  <title>Steam</title>
188
-
189
-  <section xml:id="sec-steam-nix">
190
-   <title>Steam in Nix</title>
191
-
192
-   <para>
193
-    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.
194
-   </para>
195
-
196
-   <para>
197
-    Nix problems and constraints:
198
-    <itemizedlist>
199
-     <listitem>
200
-      <para>
201
-       We don't have <filename>/bin/bash</filename> and many scripts point there. Similarly for <filename>/usr/bin/python</filename> .
202
-      </para>
203
-     </listitem>
204
-     <listitem>
205
-      <para>
206
-       We don't have the dynamic loader in <filename>/lib </filename>.
207
-      </para>
208
-     </listitem>
209
-     <listitem>
210
-      <para>
211
-       The <filename>steam.sh</filename> script in $HOME can not be patched, as it is checked and rewritten by steam.
212
-      </para>
213
-     </listitem>
214
-     <listitem>
215
-      <para>
216
-       The steam binary cannot be patched, it's also checked.
217
-      </para>
218
-     </listitem>
219
-    </itemizedlist>
220
-   </para>
221
-
222
-   <para>
223
-    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.
224
-   </para>
225
-  </section>
226
-
227
-  <section xml:id="sec-steam-play">
228
-   <title>How to play</title>
229
-
230
-   <para>
231
-    For 64-bit systems it's important to have
232
-<programlisting>hardware.opengl.driSupport32Bit = true;</programlisting>
233
-    in your <filename>/etc/nixos/configuration.nix</filename>. You'll also need
234
-<programlisting>hardware.pulseaudio.support32Bit = true;</programlisting>
235
-    if you are using PulseAudio - this will enable 32bit ALSA apps integration. To use the Steam controller or other Steam supported controllers such as the DualShock 4 or Nintendo Switch Pro, you need to add
236
-<programlisting>hardware.steam-hardware.enable = true;</programlisting>
237
-    to your configuration.
238
-   </para>
239
-  </section>
240
-
241
-  <section xml:id="sec-steam-troub">
242
-   <title>Troubleshooting</title>
243
-
244
-   <para>
245
-    <variablelist>
246
-     <varlistentry>
247
-      <term>
248
-       Steam fails to start. What do I do?
249
-      </term>
250
-      <listitem>
251
-       <para>
252
-        Try to run
253
-<programlisting>strace steam</programlisting>
254
-        to see what is causing steam to fail.
255
-       </para>
256
-      </listitem>
257
-     </varlistentry>
258
-     <varlistentry>
259
-      <term>
260
-       Using the FOSS Radeon or nouveau (nvidia) drivers
261
-      </term>
262
-      <listitem>
263
-       <itemizedlist>
264
-        <listitem>
265
-         <para>
266
-          The <literal>newStdcpp</literal> parameter was removed since NixOS 17.09 and should not be needed anymore.
267
-         </para>
268
-        </listitem>
269
-        <listitem>
270
-         <para>
271
-          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
272
-<programlisting>steam.sh: line 713: 7842 Segmentation fault (core dumped)</programlisting>
273
-          have a look at <link xlink:href="https://github.com/NixOS/nixpkgs/pull/20269">this pull request</link>.
274
-         </para>
275
-        </listitem>
276
-       </itemizedlist>
277
-      </listitem>
278
-     </varlistentry>
279
-     <varlistentry>
280
-      <term>
281
-       Java
282
-      </term>
283
-      <listitem>
284
-       <orderedlist>
285
-        <listitem>
286
-         <para>
287
-          There is no java in steam chrootenv by default. If you get a message like
288
-<programlisting>/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found</programlisting>
289
-          You need to add
290
-<programlisting> steam.override { withJava = true; };</programlisting>
291
-          to your configuration.
292
-         </para>
293
-        </listitem>
294
-       </orderedlist>
295
-      </listitem>
296
-     </varlistentry>
297
-    </variablelist>
298
-   </para>
299
-  </section>
300
-
301
-  <section xml:id="sec-steam-run">
302
-   <title>steam-run</title>
303
-
304
-   <para>
305
-    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
306
-<programlisting>pkgs.(steam.override {
307
-          nativeOnly = true;
308
-          newStdcpp = true;
309
-        }).run</programlisting>
310
-    to your configuration, rebuild, and run the game with
311
-<programlisting>steam-run ./foo</programlisting>
312
-   </para>
313
-  </section>
314
- </section>
315
- <section xml:id="sec-citrix">
316
-  <title>Citrix Receiver &amp; Citrix Workspace App</title>
317
-
318
-  <para>
319
-   <note>
320
-    <para>
321
-     Please note that the <literal>citrix_receiver</literal> package has been deprecated since its development was <link xlink:href="https://docs.citrix.com/en-us/citrix-workspace-app.html">discontinued by upstream</link> and has been replaced by <link xlink:href="https://www.citrix.com/products/workspace-app/">the citrix workspace app</link>.
322
-    </para>
323
-   </note>
324
-   <link xlink:href="https://www.citrix.com/products/receiver/">Citrix Receiver</link> and <link xlink:href="https://www.citrix.com/products/workspace-app/">Citrix Workspace App</link> are a remote desktop viewers which provide access to <link xlink:href="https://www.citrix.com/products/xenapp-xendesktop/">XenDesktop</link> installations.
325
-  </para>
326
-
327
-  <section xml:id="sec-citrix-base">
328
-   <title>Basic usage</title>
329
-
330
-   <para>
331
-    The tarball archive needs to be downloaded manually as the license agreements of the vendor for <link xlink:href="https://www.citrix.com/downloads/citrix-receiver/">Citrix Receiver</link> or <link xlink:href="https://www.citrix.de/downloads/workspace-app/linux/workspace-app-for-linux-latest.html">Citrix Workspace</link> need to be accepted first. Then run <command>nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz</command>. With the archive available in the store the package can be built and installed with Nix.
332
-   </para>
333
-
334
-   <warning>
335
-    <title>Caution with <command>nix-shell</command> installs</title>
336
-    <para>
337
-     It's recommended to install <literal>Citrix Receiver</literal> and/or <literal>Citrix Workspace</literal> using <literal>nix-env -i</literal> or globally to ensure that the <literal>.desktop</literal> files are installed properly into <literal>$XDG_CONFIG_DIRS</literal>. Otherwise it won't be possible to open <literal>.ica</literal> files automatically from the browser to start a Citrix connection.
338
-    </para>
339
-   </warning>
340
-  </section>
341
-
342
-  <section xml:id="sec-citrix-custom-certs">
343
-   <title>Custom certificates</title>
344
-
345
-   <para>
346
-    The <literal>Citrix Workspace App</literal> in <literal>nixpkgs</literal> trust several certificates <link xlink:href="https://curl.haxx.se/docs/caextract.html">from the Mozilla database</link> by default. However several companies using Citrix might require their own corporate certificate. On distros with imperative packaging these certs can be stored easily in <link xlink:href="https://developer-docs.citrix.com/projects/receiver-for-linux-command-reference/en/13.7/"><literal>$ICAROOT</literal></link>, however this directory is a store path in <literal>nixpkgs</literal>. In order to work around this issue the package provides a simple mechanism to add custom certificates without rebuilding the entire package using <literal>symlinkJoin</literal>:
347
-<programlisting>
348
-<![CDATA[with import <nixpkgs> { config.allowUnfree = true; };
349
-let extraCerts = [ ./custom-cert-1.pem ./custom-cert-2.pem /* ... */ ]; in
350
-citrix_workspace.override {
351
-  inherit extraCerts;
352
-}]]>
353
-</programlisting>
354
-   </para>
355
-  </section>
356
- </section>
357
-</chapter>

+ 44
- 0
doc/packages/citrix.xml View File

@@ -0,0 +1,44 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-citrix">
4
+  <title>Citrix Workspace</title>
5
+
6
+  <para>
7
+   <note>
8
+    <para>
9
+     Please note that the <literal>citrix_receiver</literal> package has been deprecated since its development was <link xlink:href="https://docs.citrix.com/en-us/citrix-workspace-app.html">discontinued by upstream</link> and has been replaced by <link xlink:href="https://www.citrix.com/products/workspace-app/">the citrix workspace app</link>.
10
+    </para>
11
+   </note>
12
+   <link xlink:href="https://www.citrix.com/products/receiver/">Citrix Receiver</link> and <link xlink:href="https://www.citrix.com/products/workspace-app/">Citrix Workspace App</link> are a remote desktop viewers which provide access to <link xlink:href="https://www.citrix.com/products/xenapp-xendesktop/">XenDesktop</link> installations.
13
+  </para>
14
+
15
+  <section xml:id="sec-citrix-base">
16
+   <title>Basic usage</title>
17
+
18
+   <para>
19
+    The tarball archive needs to be downloaded manually as the license agreements of the vendor for <link xlink:href="https://www.citrix.com/downloads/citrix-receiver/">Citrix Receiver</link> or <link xlink:href="https://www.citrix.de/downloads/workspace-app/linux/workspace-app-for-linux-latest.html">Citrix Workspace</link> need to be accepted first. Then run <command>nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz</command>. With the archive available in the store the package can be built and installed with Nix.
20
+   </para>
21
+
22
+   <warning>
23
+    <title>Caution with <command>nix-shell</command> installs</title>
24
+    <para>
25
+     It's recommended to install <literal>Citrix Receiver</literal> and/or <literal>Citrix Workspace</literal> using <literal>nix-env -i</literal> or globally to ensure that the <literal>.desktop</literal> files are installed properly into <literal>$XDG_CONFIG_DIRS</literal>. Otherwise it won't be possible to open <literal>.ica</literal> files automatically from the browser to start a Citrix connection.
26
+    </para>
27
+   </warning>
28
+  </section>
29
+
30
+  <section xml:id="sec-citrix-custom-certs">
31
+   <title>Custom certificates</title>
32
+
33
+   <para>
34
+    The <literal>Citrix Workspace App</literal> in <literal>nixpkgs</literal> trust several certificates <link xlink:href="https://curl.haxx.se/docs/caextract.html">from the Mozilla database</link> by default. However several companies using Citrix might require their own corporate certificate. On distros with imperative packaging these certs can be stored easily in <link xlink:href="https://developer-docs.citrix.com/projects/receiver-for-linux-command-reference/en/13.7/"><literal>$ICAROOT</literal></link>, however this directory is a store path in <literal>nixpkgs</literal>. In order to work around this issue the package provides a simple mechanism to add custom certificates without rebuilding the entire package using <literal>symlinkJoin</literal>:
35
+<programlisting>
36
+<![CDATA[with import <nixpkgs> { config.allowUnfree = true; };
37
+let extraCerts = [ ./custom-cert-1.pem ./custom-cert-2.pem /* ... */ ]; in
38
+citrix_workspace.override {
39
+  inherit extraCerts;
40
+}]]>
41
+</programlisting>
42
+   </para>
43
+  </section>
44
+</section>

+ 24
- 0
doc/packages/dlib.xml View File

@@ -0,0 +1,24 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="dlib">
4
+  <title>DLib</title>
5
+
6
+  <para>
7
+   <link xlink:href="http://dlib.net/">DLib</link> is a modern, C++-based toolkit which provides several machine learning algorithms.
8
+  </para>
9
+
10
+  <section xml:id="compiling-without-avx-support">
11
+   <title>Compiling without AVX support</title>
12
+
13
+   <para>
14
+    Especially older CPUs don't support <link xlink:href="https://en.wikipedia.org/wiki/Advanced_Vector_Extensions">AVX</link> (<abbrev>Advanced Vector Extensions</abbrev>) instructions that are used by DLib to optimize their algorithms.
15
+   </para>
16
+
17
+   <para>
18
+    On the affected hardware errors like <literal>Illegal instruction</literal> will occur. In those cases AVX support needs to be disabled:
19
+<programlisting>self: super: {
20
+  dlib = super.dlib.override { avxSupport = false; };
21
+}</programlisting>
22
+   </para>
23
+  </section>
24
+</section>

+ 72
- 0
doc/packages/eclipse.xml View File

@@ -0,0 +1,72 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-eclipse">
4
+  <title>Eclipse</title>
5
+
6
+  <para>
7
+   The Nix expressions related to the Eclipse platform and IDE are in <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/eclipse"><filename>pkgs/applications/editors/eclipse</filename></link>.
8
+  </para>
9
+
10
+  <para>
11
+   Nixpkgs provides a number of packages that will install Eclipse in its various forms. These range from the bare-bones Eclipse Platform to the more fully featured Eclipse SDK or Scala-IDE packages and multiple version are often available. It is possible to list available Eclipse packages by issuing the command:
12
+<screen>
13
+<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses --description
14
+</screen>
15
+   Once an Eclipse variant is installed it can be run using the <command>eclipse</command> command, as expected. From within Eclipse it is then possible to install plugins in the usual manner by either manually specifying an Eclipse update site or by installing the Marketplace Client plugin and using it to discover and install other plugins. This installation method provides an Eclipse installation that closely resemble a manually installed Eclipse.
16
+  </para>
17
+
18
+  <para>
19
+   If you prefer to install plugins in a more declarative manner then Nixpkgs also offer a number of Eclipse plugins that can be installed in an <emphasis>Eclipse environment</emphasis>. This type of environment is created using the function <varname>eclipseWithPlugins</varname> found inside the <varname>nixpkgs.eclipses</varname> attribute set. This function takes as argument <literal>{ eclipse, plugins ? [], jvmArgs ? [] }</literal> where <varname>eclipse</varname> is a one of the Eclipse packages described above, <varname>plugins</varname> is a list of plugin derivations, and <varname>jvmArgs</varname> is a list of arguments given to the JVM running the Eclipse. For example, say you wish to install the latest Eclipse Platform with the popular Eclipse Color Theme plugin and also allow Eclipse to use more RAM. You could then add
20
+<screen>
21
+packageOverrides = pkgs: {
22
+  myEclipse = with pkgs.eclipses; eclipseWithPlugins {
23
+    eclipse = eclipse-platform;
24
+    jvmArgs = [ "-Xmx2048m" ];
25
+    plugins = [ plugins.color-theme ];
26
+  };
27
+}
28
+</screen>
29
+   to your Nixpkgs configuration (<filename>~/.config/nixpkgs/config.nix</filename>) and install it by running <command>nix-env -f '&lt;nixpkgs&gt;' -iA myEclipse</command> and afterward run Eclipse as usual. It is possible to find out which plugins are available for installation using <varname>eclipseWithPlugins</varname> by running
30
+<screen>
31
+<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses.plugins --description
32
+</screen>
33
+  </para>
34
+
35
+  <para>
36
+   If there is a need to install plugins that are not available in Nixpkgs then it may be possible to define these plugins outside Nixpkgs using the <varname>buildEclipseUpdateSite</varname> and <varname>buildEclipsePlugin</varname> functions found in the <varname>nixpkgs.eclipses.plugins</varname> attribute set. Use the <varname>buildEclipseUpdateSite</varname> function to install a plugin distributed as an Eclipse update site. This function takes <literal>{ name, src }</literal> as argument where <literal>src</literal> indicates the Eclipse update site archive. All Eclipse features and plugins within the downloaded update site will be installed. When an update site archive is not available then the <varname>buildEclipsePlugin</varname> function can be used to install a plugin that consists of a pair of feature and plugin JARs. This function takes an argument <literal>{ name, srcFeature, srcPlugin }</literal> where <literal>srcFeature</literal> and <literal>srcPlugin</literal> are the feature and plugin JARs, respectively.
37
+  </para>
38
+
39
+  <para>
40
+   Expanding the previous example with two plugins using the above functions we have
41
+<screen>
42
+packageOverrides = pkgs: {
43
+  myEclipse = with pkgs.eclipses; eclipseWithPlugins {
44
+    eclipse = eclipse-platform;
45
+    jvmArgs = [ "-Xmx2048m" ];
46
+    plugins = [
47
+      plugins.color-theme
48
+      (plugins.buildEclipsePlugin {
49
+        name = "myplugin1-1.0";
50
+        srcFeature = fetchurl {
51
+          url = "http://…/features/myplugin1.jar";
52
+          sha256 = "123…";
53
+        };
54
+        srcPlugin = fetchurl {
55
+          url = "http://…/plugins/myplugin1.jar";
56
+          sha256 = "123…";
57
+        };
58
+      });
59
+      (plugins.buildEclipseUpdateSite {
60
+        name = "myplugin2-1.0";
61
+        src = fetchurl {
62
+          stripRoot = false;
63
+          url = "http://…/myplugin2.zip";
64
+          sha256 = "123…";
65
+        };
66
+      });
67
+    ];
68
+  };
69
+}
70
+</screen>
71
+  </para>
72
+</section>

+ 17
- 0
doc/packages/elm.xml View File

@@ -0,0 +1,17 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-elm">
4
+ <title>Elm</title>
5
+
6
+ <para>
7
+ To start a development environment do <command>nix-shell -p elmPackages.elm elmPackages.elm-format</command>
8
+ </para>
9
+
10
+ <para>
11
+ To update Elm compiler, see <filename>nixpkgs/pkgs/development/compilers/elm/README.md</filename>.
12
+ </para>
13
+
14
+ <para>
15
+ To package Elm applications, <link xlink:href="https://github.com/hercules-ci/elm2nix#elm2nix">read about elm2nix</link>.
16
+ </para>
17
+</section>

+ 131
- 0
doc/packages/emacs.xml View File

@@ -0,0 +1,131 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-emacs">
4
+  <title>Emacs</title>
5
+
6
+  <section xml:id="sec-emacs-config">
7
+   <title>Configuring Emacs</title>
8
+
9
+   <para>
10
+    The Emacs package comes with some extra helpers to make it easier to configure. <varname>emacsWithPackages</varname> allows you to manage packages from ELPA. This means that you will not have to install that packages from within Emacs. For instance, if you wanted to use <literal>company</literal>, <literal>counsel</literal>, <literal>flycheck</literal>, <literal>ivy</literal>, <literal>magit</literal>, <literal>projectile</literal>, and <literal>use-package</literal> you could use this as a <filename>~/.config/nixpkgs/config.nix</filename> override:
11
+   </para>
12
+
13
+<screen>
14
+{
15
+  packageOverrides = pkgs: with pkgs; {
16
+    myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
17
+      company
18
+      counsel
19
+      flycheck
20
+      ivy
21
+      magit
22
+      projectile
23
+      use-package
24
+    ]));
25
+  }
26
+}
27
+</screen>
28
+
29
+   <para>
30
+    You can install it like any other packages via <command>nix-env -iA myEmacs</command>. However, this will only install those packages. It will not <literal>configure</literal> them for us. To do this, we need to provide a configuration file. Luckily, it is possible to do this from within Nix! By modifying the above example, we can make Emacs load a custom config file. The key is to create a package that provide a <filename>default.el</filename> file in <filename>/share/emacs/site-start/</filename>. Emacs knows to load this file automatically when it starts.
31
+   </para>
32
+
33
+<screen>
34
+{
35
+  packageOverrides = pkgs: with pkgs; rec {
36
+    myEmacsConfig = writeText "default.el" ''
37
+;; initialize package
38
+
39
+(require 'package)
40
+(package-initialize 'noactivate)
41
+(eval-when-compile
42
+  (require 'use-package))
43
+
44
+;; load some packages
45
+
46
+(use-package company
47
+  :bind ("&lt;C-tab&gt;" . company-complete)
48
+  :diminish company-mode
49
+  :commands (company-mode global-company-mode)
50
+  :defer 1
51
+  :config
52
+  (global-company-mode))
53
+
54
+(use-package counsel
55
+  :commands (counsel-descbinds)
56
+  :bind (([remap execute-extended-command] . counsel-M-x)
57
+         ("C-x C-f" . counsel-find-file)
58
+         ("C-c g" . counsel-git)
59
+         ("C-c j" . counsel-git-grep)
60
+         ("C-c k" . counsel-ag)
61
+         ("C-x l" . counsel-locate)
62
+         ("M-y" . counsel-yank-pop)))
63
+
64
+(use-package flycheck
65
+  :defer 2
66
+  :config (global-flycheck-mode))
67
+
68
+(use-package ivy
69
+  :defer 1
70
+  :bind (("C-c C-r" . ivy-resume)
71
+         ("C-x C-b" . ivy-switch-buffer)
72
+         :map ivy-minibuffer-map
73
+         ("C-j" . ivy-call))
74
+  :diminish ivy-mode
75
+  :commands ivy-mode
76
+  :config
77
+  (ivy-mode 1))
78
+
79
+(use-package magit
80
+  :defer
81
+  :if (executable-find "git")
82
+  :bind (("C-x g" . magit-status)
83
+         ("C-x G" . magit-dispatch-popup))
84
+  :init
85
+  (setq magit-completing-read-function 'ivy-completing-read))
86
+
87
+(use-package projectile
88
+  :commands projectile-mode
89
+  :bind-keymap ("C-c p" . projectile-command-map)
90
+  :defer 5
91
+  :config
92
+  (projectile-global-mode))
93
+    '';
94
+    myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
95
+      (runCommand "default.el" {} ''
96
+mkdir -p $out/share/emacs/site-lisp
97
+cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
98
+'')
99
+      company
100
+      counsel
101
+      flycheck
102
+      ivy
103
+      magit
104
+      projectile
105
+      use-package
106
+    ]));
107
+  };
108
+}
109
+</screen>
110
+
111
+   <para>
112
+    This provides a fairly full Emacs start file. It will load in addition to the user's presonal config. You can always disable it by passing <command>-q</command> to the Emacs command.
113
+   </para>
114
+
115
+   <para>
116
+    Sometimes <varname>emacsWithPackages</varname> is not enough, as this package set has some priorities imposed on packages (with the lowest priority assigned to Melpa Unstable, and the highest for packages manually defined in <filename>pkgs/top-level/emacs-packages.nix</filename>). But you can't control this priorities when some package is installed as a dependency. You can override it on per-package-basis, providing all the required dependencies manually - but it's tedious and there is always a possibility that an unwanted dependency will sneak in through some other package. To completely override such a package you can use <varname>overrideScope'</varname>.
117
+   </para>
118
+
119
+<screen>
120
+overrides = self: super: rec {
121
+  haskell-mode = self.melpaPackages.haskell-mode;
122
+  ...
123
+};
124
+((emacsPackagesGen emacs).overrideScope' overrides).emacsWithPackages (p: with p; [
125
+  # here both these package will use haskell-mode of our own choice
126
+  ghc-mod
127
+  dante
128
+])
129
+</screen>
130
+  </section>
131
+</section>

+ 57
- 0
doc/packages/ibus.xml View File

@@ -0,0 +1,57 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-ibus-typing-booster">
4
+  <title>ibus-engines.typing-booster</title>
5
+
6
+  <para>
7
+   This package is an ibus-based completion method to speed up typing.
8
+  </para>
9
+
10
+  <section xml:id="sec-ibus-typing-booster-activate">
11
+   <title>Activating the engine</title>
12
+
13
+   <para>
14
+    IBus needs to be configured accordingly to activate <literal>typing-booster</literal>. The configuration depends on the desktop manager in use. For detailed instructions, please refer to the <link xlink:href="https://mike-fabian.github.io/ibus-typing-booster/documentation.html">upstream docs</link>.
15
+   </para>
16
+
17
+   <para>
18
+    On NixOS you need to explicitly enable <literal>ibus</literal> with given engines before customizing your desktop to use <literal>typing-booster</literal>. This can be achieved using the <literal>ibus</literal> module:
19
+<programlisting>{ pkgs, ... }: {
20
+  i18n.inputMethod = {
21
+    enabled = "ibus";
22
+    ibus.engines = with pkgs.ibus-engines; [ typing-booster ];
23
+  };
24
+}</programlisting>
25
+   </para>
26
+  </section>
27
+
28
+  <section xml:id="sec-ibus-typing-booster-customize-hunspell">
29
+   <title>Using custom hunspell dictionaries</title>
30
+
31
+   <para>
32
+    The IBus engine is based on <literal>hunspell</literal> to support completion in many languages. By default the dictionaries <literal>de-de</literal>, <literal>en-us</literal>, <literal>fr-moderne</literal> <literal>es-es</literal>, <literal>it-it</literal>, <literal>sv-se</literal> and <literal>sv-fi</literal> are in use. To add another dictionary, the package can be overridden like this:
33
+<programlisting>ibus-engines.typing-booster.override {
34
+  langs = [ "de-at" "en-gb" ];
35
+}</programlisting>
36
+   </para>
37
+
38
+   <para>
39
+    <emphasis>Note: each language passed to <literal>langs</literal> must be an attribute name in <literal>pkgs.hunspellDicts</literal>.</emphasis>
40
+   </para>
41
+  </section>
42
+
43
+  <section xml:id="sec-ibus-typing-booster-emoji-picker">
44
+   <title>Built-in emoji picker</title>
45
+
46
+   <para>
47
+    The <literal>ibus-engines.typing-booster</literal> package contains a program named <literal>emoji-picker</literal>. To display all emojis correctly, a special font such as <literal>noto-fonts-emoji</literal> is needed:
48
+   </para>
49
+
50
+   <para>
51
+    On NixOS it can be installed using the following expression:
52
+<programlisting>{ pkgs, ... }: {
53
+  fonts.fonts = with pkgs; [ noto-fonts-emoji ];
54
+}</programlisting>
55
+   </para>
56
+  </section>
57
+ </section>

+ 23
- 0
doc/packages/index.xml View File

@@ -0,0 +1,23 @@
1
+<chapter xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xi="http://www.w3.org/2001/XInclude"
3
+         xml:id="chap-packages">
4
+ <title>Packages</title>
5
+ <para>
6
+  This chapter contains information about how to use and maintain the Nix expressions for a number of specific packages, such as the Linux kernel or X.org.
7
+ </para>
8
+ <xi:include href="citrix.xml" />
9
+ <xi:include href="dlib.xml" />
10
+ <xi:include href="eclipse.xml" />
11
+ <xi:include href="elm.xml" />
12
+ <xi:include href="emacs.xml" />
13
+ <xi:include href="ibus.xml" />
14
+ <xi:include href="kakoune.xml" />
15
+ <xi:include href="linux.xml" />
16
+ <xi:include href="locales.xml" />
17
+ <xi:include href="nginx.xml" />
18
+ <xi:include href="opengl.xml" />
19
+ <xi:include href="shell-helpers.xml" />
20
+ <xi:include href="steam.xml" />
21
+ <xi:include href="weechat.xml" />
22
+ <xi:include href="xorg.xml" />
23
+</chapter>

+ 14
- 0
doc/packages/kakoune.xml View File

@@ -0,0 +1,14 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-kakoune">
4
+  <title>Kakoune</title>
5
+
6
+  <para>
7
+   Kakoune can be built to autoload plugins:
8
+<programlisting>(kakoune.override {
9
+  configure = {
10
+    plugins = with pkgs.kakounePlugins; [ parinfer-rust ];
11
+  };
12
+})</programlisting>
13
+  </para>
14
+</section>

+ 85
- 0
doc/packages/linux.xml View File

@@ -0,0 +1,85 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-linux-kernel">
4
+  <title>Linux kernel</title>
5
+
6
+  <para>
7
+   The Nix expressions to build the Linux kernel are in <link
8
+xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel"><filename>pkgs/os-specific/linux/kernel</filename></link>.
9
+  </para>
10
+
11
+  <para>
12
+   The function that builds the kernel has an argument <varname>kernelPatches</varname> which should be a list of <literal>{name, patch, extraConfig}</literal> attribute sets, where <varname>name</varname> is the name of the patch (which is included in the kernel’s <varname>meta.description</varname> attribute), <varname>patch</varname> is the patch itself (possibly compressed), and <varname>extraConfig</varname> (optional) is a string specifying extra options to be concatenated to the kernel configuration file (<filename>.config</filename>).
13
+  </para>
14
+
15
+  <para>
16
+   The kernel derivation exports an attribute <varname>features</varname> specifying whether optional functionality is or isn’t enabled. This is used in NixOS to implement kernel-specific behaviour. For instance, if the kernel has the <varname>iwlwifi</varname> feature (i.e. has built-in support for Intel wireless chipsets), then NixOS doesn’t have to build the external <varname>iwlwifi</varname> package:
17
+<programlisting>
18
+modulesTree = [kernel]
19
+  ++ pkgs.lib.optional (!kernel.features ? iwlwifi) kernelPackages.iwlwifi
20
+  ++ ...;
21
+</programlisting>
22
+  </para>
23
+
24
+  <para>
25
+   How to add a new (major) version of the Linux kernel to Nixpkgs:
26
+   <orderedlist>
27
+    <listitem>
28
+     <para>
29
+      Copy the old Nix expression (e.g. <filename>linux-2.6.21.nix</filename>) to the new one (e.g. <filename>linux-2.6.22.nix</filename>) and update it.
30
+     </para>
31
+    </listitem>
32
+    <listitem>
33
+     <para>
34
+      Add the new kernel to <filename>all-packages.nix</filename> (e.g., create an attribute <varname>kernel_2_6_22</varname>).
35
+     </para>
36
+    </listitem>
37
+    <listitem>
38
+     <para>
39
+      Now we’re going to update the kernel configuration. First unpack the kernel. Then for each supported platform (<literal>i686</literal>, <literal>x86_64</literal>, <literal>uml</literal>) do the following:
40
+      <orderedlist>
41
+       <listitem>
42
+        <para>
43
+         Make an copy from the old config (e.g. <filename>config-2.6.21-i686-smp</filename>) to the new one (e.g. <filename>config-2.6.22-i686-smp</filename>).
44
+        </para>
45
+       </listitem>
46
+       <listitem>
47
+        <para>
48
+         Copy the config file for this platform (e.g. <filename>config-2.6.22-i686-smp</filename>) to <filename>.config</filename> in the kernel source tree.
49
+        </para>
50
+       </listitem>
51
+       <listitem>
52
+        <para>
53
+         Run <literal>make oldconfig ARCH=<replaceable>{i386,x86_64,um}</replaceable></literal> and answer all questions. (For the uml configuration, also add <literal>SHELL=bash</literal>.) Make sure to keep the configuration consistent between platforms (i.e. don’t enable some feature on <literal>i686</literal> and disable it on <literal>x86_64</literal>).
54
+        </para>
55
+       </listitem>
56
+       <listitem>
57
+        <para>
58
+         If needed you can also run <literal>make menuconfig</literal>:
59
+<screen>
60
+<prompt>$ </prompt>nix-env -i ncurses
61
+<prompt>$ </prompt>export NIX_CFLAGS_LINK=-lncurses
62
+<prompt>$ </prompt>make menuconfig ARCH=<replaceable>arch</replaceable></screen>
63
+        </para>
64
+       </listitem>
65
+       <listitem>
66
+        <para>
67
+         Copy <filename>.config</filename> over the new config file (e.g. <filename>config-2.6.22-i686-smp</filename>).
68
+        </para>
69
+       </listitem>
70
+      </orderedlist>
71
+     </para>
72
+    </listitem>
73
+    <listitem>
74
+     <para>
75
+      Test building the kernel: <literal>nix-build -A kernel_2_6_22</literal>. If it compiles, ship it! For extra credit, try booting NixOS with it.
76
+     </para>
77
+    </listitem>
78
+    <listitem>
79
+     <para>
80
+      It may be that the new kernel requires updating the external kernel modules and kernel-dependent packages listed in the <varname>linuxPackagesFor</varname> function in <filename>all-packages.nix</filename> (such as the NVIDIA drivers, AUFS, etc.). If the updated packages aren’t backwards compatible with older kernels, you may need to keep the older versions around.
81
+     </para>
82
+    </listitem>
83
+   </orderedlist>
84
+  </para>
85
+ </section>

+ 13
- 0
doc/packages/locales.xml View File

@@ -0,0 +1,13 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="locales">
4
+ <title>Locales</title>
5
+
6
+ <para>
7
+  To allow simultaneous use of packages linked against different versions of <literal>glibc</literal> with different locale archive formats Nixpkgs patches <literal>glibc</literal> to rely on <literal>LOCALE_ARCHIVE</literal> environment variable.
8
+ </para>
9
+
10
+ <para>
11
+  On non-NixOS distributions this variable is obviously not set. This can cause regressions in language support or even crashes in some Nixpkgs-provided programs. The simplest way to mitigate this problem is exporting the <literal>LOCALE_ARCHIVE</literal> variable pointing to <literal>${glibcLocales}/lib/locale/locale-archive</literal>. The drawback (and the reason this is not the default) is the relatively large (a hundred MiB) size of the full set of locales. It is possible to build a custom set of locales by overriding parameters <literal>allLocales</literal> and <literal>locales</literal> of the package.
12
+ </para>
13
+</section>

+ 25
- 0
doc/packages/nginx.xml View File

@@ -0,0 +1,25 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-nginx">
4
+  <title>Nginx</title>
5
+
6
+  <para>
7
+   <link xlink:href="https://nginx.org/">Nginx</link> is a reverse proxy and lightweight webserver.
8
+  </para>
9
+
10
+  <section xml:id="sec-nginx-etag">
11
+   <title>ETags on static files served from the Nix store</title>
12
+
13
+   <para>
14
+    HTTP has a couple different mechanisms for caching to prevent clients from having to download the same content repeatedly if a resource has not changed since the last time it was requested. When nginx is used as a server for static files, it implements the caching mechanism based on the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"><literal>Last-Modified</literal></link> response header automatically; unfortunately, it works by using filesystem timestamps to determine the value of the <literal>Last-Modified</literal> header. This doesn't give the desired behavior when the file is in the Nix store, because all file timestamps are set to 0 (for reasons related to build reproducibility).
15
+   </para>
16
+
17
+   <para>
18
+    Fortunately, HTTP supports an alternative (and more effective) caching mechanism: the <link xlink:href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"><literal>ETag</literal></link> response header. The value of the <literal>ETag</literal> header specifies some identifier for the particular content that the server is sending (e.g. a hash). When a client makes a second request for the same resource, it sends that value back in an <literal>If-None-Match</literal> header. If the ETag value is unchanged, then the server does not need to resend the content.
19
+   </para>
20
+
21
+   <para>
22
+    As of NixOS 19.09, the nginx package in Nixpkgs is patched such that when nginx serves a file out of <filename>/nix/store</filename>, the hash in the store path is used as the <literal>ETag</literal> header in the HTTP response, thus providing proper caching functionality. This happens automatically; you do not need to do modify any configuration to get this behavior.
23
+   </para>
24
+  </section>
25
+</section>

+ 9
- 0
doc/packages/opengl.xml View File

@@ -0,0 +1,9 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-opengl">
4
+ <title>OpenGL</title>
5
+
6
+ <para>
7
+ Packages that use OpenGL have NixOS desktop as their primary target. The current solution for loading the GPU-specific drivers is based on <literal>libglvnd</literal> and looks for the driver implementation in <literal>LD_LIBRARY_PATH</literal>. If you are using a non-NixOS GNU/Linux/X11 desktop with free software video drivers, consider launching OpenGL-dependent programs from Nixpkgs with Nixpkgs versions of <literal>libglvnd</literal> and <literal>mesa_drivers</literal> in <literal>LD_LIBRARY_PATH</literal>. For proprietary video drivers you might have luck with also adding the corresponding video driver package.
8
+ </para>
9
+</section>

+ 25
- 0
doc/packages/shell-helpers.xml View File

@@ -0,0 +1,25 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-shell-helpers">
4
+  <title>Interactive shell helpers</title>
5
+
6
+  <para>
7
+   Some packages provide the shell integration to be more useful. But unlike other systems, nix doesn't have a standard share directory location. This is why a bunch <command>PACKAGE-share</command> scripts are shipped that print the location of the corresponding shared folder. Current list of such packages is as following:
8
+   <itemizedlist>
9
+    <listitem>
10
+     <para>
11
+      <literal>autojump</literal>: <command>autojump-share</command>
12
+     </para>
13
+    </listitem>
14
+    <listitem>
15
+     <para>
16
+      <literal>fzf</literal>: <command>fzf-share</command>
17
+     </para>
18
+    </listitem>
19
+   </itemizedlist>
20
+   E.g. <literal>autojump</literal> can then used in the .bashrc like this:
21
+<screen>
22
+  source "$(autojump-share)/autojump.bash"
23
+</screen>
24
+  </para>
25
+</section>

+ 131
- 0
doc/packages/steam.xml View File

@@ -0,0 +1,131 @@
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
+    For 64-bit systems it's important to have
49
+<programlisting>hardware.opengl.driSupport32Bit = true;</programlisting>
50
+    in your <filename>/etc/nixos/configuration.nix</filename>. You'll also need
51
+<programlisting>hardware.pulseaudio.support32Bit = true;</programlisting>
52
+    if you are using PulseAudio - this will enable 32bit ALSA apps integration. To use the Steam controller or other Steam supported controllers such as the DualShock 4 or Nintendo Switch Pro, you need to add
53
+<programlisting>hardware.steam-hardware.enable = true;</programlisting>
54
+    to your configuration.
55
+   </para>
56
+  </section>
57
+
58
+  <section xml:id="sec-steam-troub">
59
+   <title>Troubleshooting</title>
60
+
61
+   <para>
62
+    <variablelist>
63
+     <varlistentry>
64
+      <term>
65
+       Steam fails to start. What do I do?
66
+      </term>
67
+      <listitem>
68
+       <para>
69
+        Try to run
70
+<programlisting>strace steam</programlisting>
71
+        to see what is causing steam to fail.
72
+       </para>
73
+      </listitem>
74
+     </varlistentry>
75
+     <varlistentry>
76
+      <term>
77
+       Using the FOSS Radeon or nouveau (nvidia) drivers
78
+      </term>
79
+      <listitem>
80
+       <itemizedlist>
81
+        <listitem>
82
+         <para>
83
+          The <literal>newStdcpp</literal> parameter was removed since NixOS 17.09 and should not be needed anymore.
84
+         </para>
85
+        </listitem>
86
+        <listitem>
87
+         <para>
88
+          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
89
+<programlisting>steam.sh: line 713: 7842 Segmentation fault (core dumped)</programlisting>
90
+          have a look at <link xlink:href="https://github.com/NixOS/nixpkgs/pull/20269">this pull request</link>.
91
+         </para>
92
+        </listitem>
93
+       </itemizedlist>
94
+      </listitem>
95
+     </varlistentry>
96
+     <varlistentry>
97
+      <term>
98
+       Java
99
+      </term>
100
+      <listitem>
101
+       <orderedlist>
102
+        <listitem>
103
+         <para>
104
+          There is no java in steam chrootenv by default. If you get a message like
105
+<programlisting>/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found</programlisting>
106
+          You need to add
107
+<programlisting> steam.override { withJava = true; };</programlisting>
108
+          to your configuration.
109
+         </para>
110
+        </listitem>
111
+       </orderedlist>
112
+      </listitem>
113
+     </varlistentry>
114
+    </variablelist>
115
+   </para>
116
+  </section>
117
+
118
+  <section xml:id="sec-steam-run">
119
+   <title>steam-run</title>
120
+
121
+   <para>
122
+    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
123
+<programlisting>pkgs.(steam.override {
124
+          nativeOnly = true;
125
+          newStdcpp = true;
126
+        }).run</programlisting>
127
+    to your configuration, rebuild, and run the game with
128
+<programlisting>steam-run ./foo</programlisting>
129
+   </para>
130
+  </section>
131
+</section>

+ 13
- 0
doc/packages/unfree.xml View File

@@ -0,0 +1,13 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="unfree-software">
4
+ <title>Unfree software</title>
5
+
6
+ <para>
7
+  All users of Nixpkgs are free software users, and many users (and developers) of Nixpkgs want to limit and tightly control their exposure to unfree software. At the same time, many users need (or want) to run some specific pieces of proprietary software. Nixpkgs includes some expressions for unfree software packages. By default unfree software cannot be installed and doesn’t show up in searches. To allow installing unfree software in a single Nix invocation one can export <literal>NIXPKGS_ALLOW_UNFREE=1</literal>. For a persistent solution, users can set <literal>allowUnfree</literal> in the Nixpkgs configuration.
8
+ </para>
9
+
10
+ <para>
11
+  Fine-grained control is possible by defining <literal>allowUnfreePredicate</literal> function in config; it takes the <literal>mkDerivation</literal> parameter attrset and returns <literal>true</literal> for unfree packages that should be allowed.
12
+ </para>
13
+</section>

+ 85
- 0
doc/packages/weechat.xml View File

@@ -0,0 +1,85 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-weechat">
4
+  <title>Weechat</title>
5
+
6
+  <para>
7
+   Weechat can be configured to include your choice of plugins, reducing its closure size from the default configuration which includes all available plugins. To make use of this functionality, install an expression that overrides its configuration such as
8
+<programlisting>weechat.override {configure = {availablePlugins, ...}: {
9
+    plugins = with availablePlugins; [ python perl ];
10
+  }
11
+}</programlisting>
12
+   If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal> attribute, <literal>availablePlugins</literal> will be used automatically.
13
+  </para>
14
+
15
+  <para>
16
+   The plugins currently available are <literal>python</literal>, <literal>perl</literal>, <literal>ruby</literal>, <literal>guile</literal>, <literal>tcl</literal> and <literal>lua</literal>.
17
+  </para>
18
+
19
+  <para>
20
+   The python and perl plugins allows the addition of extra libraries. For instance, the <literal>inotify.py</literal> script in weechat-scripts requires D-Bus or libnotify, and the <literal>fish.py</literal> script requires pycrypto. To use these scripts, use the plugin's <literal>withPackages</literal> attribute:
21
+<programlisting>weechat.override { configure = {availablePlugins, ...}: {
22
+    plugins = with availablePlugins; [
23
+            (python.withPackages (ps: with ps; [ pycrypto python-dbus ]))
24
+        ];
25
+    };
26
+}
27
+</programlisting>
28
+  </para>
29
+
30
+  <para>
31
+   In order to also keep all default plugins installed, it is possible to use the following method:
32
+<programlisting>weechat.override { configure = { availablePlugins, ... }: {
33
+  plugins = builtins.attrValues (availablePlugins // {
34
+    python = availablePlugins.python.withPackages (ps: with ps; [ pycrypto python-dbus ]);
35
+  });
36
+}; }
37
+</programlisting>
38
+  </para>
39
+
40
+  <para>
41
+   WeeChat allows to set defaults on startup using the <literal>--run-command</literal>. The <literal>configure</literal> method can be used to pass commands to the program:
42
+<programlisting>weechat.override {
43
+  configure = { availablePlugins, ... }: {
44
+    init = ''
45
+      /set foo bar
46
+      /server add freenode chat.freenode.org
47
+    '';
48
+  };
49
+}</programlisting>
50
+   Further values can be added to the list of commands when running <literal>weechat --run-command "your-commands"</literal>.
51
+  </para>
52
+
53
+  <para>
54
+   Additionally it's possible to specify scripts to be loaded when starting <literal>weechat</literal>. These will be loaded before the commands from <literal>init</literal>:
55
+<programlisting>weechat.override {
56
+  configure = { availablePlugins, ... }: {
57
+    scripts = with pkgs.weechatScripts; [
58
+      weechat-xmpp weechat-matrix-bridge wee-slack
59
+    ];
60
+    init = ''
61
+      /set plugins.var.python.jabber.key "val"
62
+    '':
63
+  };
64
+}</programlisting>
65
+  </para>
66
+
67
+  <para>
68
+   In <literal>nixpkgs</literal> there's a subpackage which contains derivations for WeeChat scripts. Such derivations expect a <literal>passthru.scripts</literal> attribute which contains a list of all scripts inside the store path. Furthermore all scripts have to live in <literal>$out/share</literal>. An exemplary derivation looks like this:
69
+<programlisting>{ stdenv, fetchurl }:
70
+
71
+stdenv.mkDerivation {
72
+  name = "exemplary-weechat-script";
73
+  src = fetchurl {
74
+    url = "https://scripts.tld/your-scripts.tar.gz";
75
+    sha256 = "...";
76
+  };
77
+  passthru.scripts = [ "foo.py" "bar.lua" ];
78
+  installPhase = ''
79
+    mkdir $out/share
80
+    cp foo.py $out/share
81
+    cp bar.lua $out/share
82
+  '';
83
+}</programlisting>
84
+  </para>
85
+</section>

+ 34
- 0
doc/packages/xorg.xml View File

@@ -0,0 +1,34 @@
1
+<section xmlns="http://docbook.org/ns/docbook"
2
+         xmlns:xlink="http://www.w3.org/1999/xlink"
3
+         xml:id="sec-xorg">
4
+  <title>X.org</title>
5
+
6
+  <para>
7
+   The Nix expressions for the X.org packages reside in <filename>pkgs/servers/x11/xorg/default.nix</filename>. This file is automatically generated from lists of tarballs in an X.org release. As such it should not be modified directly; rather, you should modify the lists, the generator script or the file <filename>pkgs/servers/x11/xorg/overrides.nix</filename>, in which you can override or add to the derivations produced by the generator.
8
+  </para>
9
+
10
+  <para>
11
+   The generator is invoked as follows:
12
+<screen>
13
+<prompt>$ </prompt>cd pkgs/servers/x11/xorg
14
+<prompt>$ </prompt>cat tarballs-7.5.list extra.list old.list \
15
+  | perl ./generate-expr-from-tarballs.pl
16
+</screen>
17
+   For each of the tarballs in the <filename>.list</filename> files, the script downloads it, unpacks it, and searches its <filename>configure.ac</filename> and <filename>*.pc.in</filename> files for dependencies. This information is used to generate <filename>default.nix</filename>. The generator caches downloaded tarballs between runs. Pay close attention to the <literal>NOT FOUND: <replaceable>name</replaceable></literal> messages at the end of the run, since they may indicate missing dependencies. (Some might be optional dependencies, however.)
18
+  </para>
19
+
20
+  <para>
21
+   A file like <filename>tarballs-7.5.list</filename> contains all tarballs in a X.org release. It can be generated like this:
22
+<screen>
23
+<prompt>$ </prompt>export i="mirror://xorg/X11R7.4/src/everything/"
24
+<prompt>$ </prompt>cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
25
+  | perl -e 'while (&lt;>) { if (/(href|HREF)="([^"]*.bz2)"/) { print "$ENV{'i'}$2\n"; }; }' \
26
+  | sort > tarballs-7.4.list
27
+</screen>
28
+   <filename>extra.list</filename> contains libraries that aren’t part of X.org proper, but are closely related to it, such as <literal>libxcb</literal>. <filename>old.list</filename> contains some packages that were removed from X.org, but are still needed by some people or by other packages (such as <varname>imake</varname>).
29
+  </para>
30
+
31
+  <para>
32
+   If the expression for a package requires derivation attributes that the generator cannot figure out automatically (say, <varname>patches</varname> or a <varname>postInstall</varname> hook), you should modify <filename>pkgs/servers/x11/xorg/overrides.nix</filename>.
33
+  </para>
34
+</section>

+ 1
- 1
doc/platform-notes.xml View File

@@ -1,6 +1,6 @@
1 1
 <chapter xmlns="http://docbook.org/ns/docbook"
2 2
          xmlns:xlink="http://www.w3.org/1999/xlink"
3
-         xml:id="chap-platform-nodes">
3
+         xml:id="chap-platform-notes">
4 4
  <title>Platform Notes</title>
5 5
  <section xml:id="sec-darwin">
6 6
   <title>Darwin (macOS)</title>

+ 1
- 1
doc/reviewing-contributions.xml View File

@@ -2,7 +2,7 @@
2 2
         xmlns:xlink="http://www.w3.org/1999/xlink"
3 3
         xmlns:xi="http://www.w3.org/2001/XInclude"
4 4
         version="5.0"
5
-        xml:id="sec-reviewing-contributions">
5
+        xml:id="chap-reviewing-contributions">
6 6
  <title>Reviewing contributions</title>
7 7
  <warning>
8 8
   <para>

+ 3
- 3
doc/stdenv.xml View File

@@ -1692,7 +1692,7 @@ someVar=$(stripHash $name)
1692 1692
     </term>
1693 1693
     <listitem>
1694 1694
      <para>
1695
-      Convenience function for <literal>makeWrapper</literal> that automatically creates a sane wrapper file. It takes all the same arguments as <literal>makeWrapper</literal>, except for <literal>--argv0</literal>.
1695
+      Convenience function for <literal>makeWrapper</literal> that automatically creates a sane wrapper file It takes all the same arguments as <literal>makeWrapper</literal>, except for <literal>--argv0</literal>.
1696 1696
      </para>
1697 1697
      <para>
1698 1698
       It cannot be applied multiple times, since it will overwrite the wrapper file.
@@ -1833,7 +1833,7 @@ addEnvHooks "$hostOffset" myBashFunction
1833 1833
        The Bintools Wrapper wraps the binary utilities for a bunch of miscellaneous purposes. These are GNU Binutils when targetting Linux, and a mix of cctools and GNU binutils for Darwin. [The "Bintools" name is supposed to be a compromise between "Binutils" and "cctools" not denoting any specific implementation.] Specifically, the underlying bintools package, and a C standard library (glibc or Darwin's libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by the Bintools Wrapper. Packages typically depend on CC Wrapper, which in turn (at run time) depends on the Bintools Wrapper.
1834 1834
       </para>
1835 1835
       <para>
1836
-       The Bintools Wrapper was only just recently split off from CC Wrapper, so the division of labor is still being worked out. For example, it shouldn't care about the C standard library, but just take a derivation with the dynamic loader (which happens to be the glibc on linux). Dependency finding however is a task both wrappers will continue to need to share, and probably the most important to understand. It is currently accomplished by collecting directories of host-platform dependencies (i.e. <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname>) in environment variables. The Bintools Wrapper's setup hook causes any <filename>lib</filename> and <filename>lib64</filename> subdirectories to be added to <envar>NIX_LDFLAGS</envar>. Since the CC Wrapper and the Bintools Wrapper use the same strategy, most of the Bintools Wrapper code is sparsely commented and refers to the CC Wrapper. But the CC Wrapper's code, by contrast, has quite lengthy comments. The Bintools Wrapper merely cites those, rather than repeating them, to avoid falling out of sync.
1836
+       The Bintools Wrapper was only just recently split off from CC Wrapper, so the division of labor is still being worked out. For example, it shouldn't care about about the C standard library, but just take a derivation with the dynamic loader (which happens to be the glibc on linux). Dependency finding however is a task both wrappers will continue to need to share, and probably the most important to understand. It is currently accomplished by collecting directories of host-platform dependencies (i.e. <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname>) in environment variables. The Bintools Wrapper's setup hook causes any <filename>lib</filename> and <filename>lib64</filename> subdirectories to be added to <envar>NIX_LDFLAGS</envar>. Since the CC Wrapper and the Bintools Wrapper use the same strategy, most of the Bintools Wrapper code is sparsely commented and refers to the CC Wrapper. But the CC Wrapper's code, by contrast, has quite lengthy comments. The Bintools Wrapper merely cites those, rather than repeating them, to avoid falling out of sync.
1837 1837
       </para>
1838 1838
       <para>
1839 1839
        A final task of the setup hook is defining a number of standard environment variables to tell build systems which executables fulfill which purpose. They are defined to just be the base name of the tools, under the assumption that the Bintools Wrapper's binaries will be on the path. Firstly, this helps poorly-written packages, e.g. ones that look for just <command>gcc</command> when <envar>CC</envar> isn't defined yet <command>clang</command> is to be used. Secondly, this helps packages not get confused when cross-compiling, in which case multiple Bintools Wrappers may simultaneously be in use.
@@ -1869,7 +1869,7 @@ addEnvHooks "$hostOffset" myBashFunction
1869 1869
   </para>
1870 1870
 
1871 1871
   <para>
1872
-   Here are some more packages that provide a setup hook. Since the list of hooks is extensible, this is not an exhaustive list. The mechanism is only to be used as a last resort, so it might cover most uses.
1872
+   Here are some more packages that provide a setup hook. Since the list of hooks is extensible, this is not an exhaustive list the mechanism is only to be used as a last resort, it might cover most uses.
1873 1873
    <variablelist>
1874 1874
     <varlistentry>
1875 1875
      <term>

+ 2
- 2
doc/submitting-changes.xml View File

@@ -244,7 +244,7 @@ Additional information.
244 244
 
245 245
    <para>
246 246
     When sandbox builds are enabled, Nix will setup an isolated environment for each build process. It is used to remove further hidden dependencies set by the build environment to improve reproducibility. This includes access to the network during the build outside of <function>fetch*</function> functions and files outside the Nix store. Depending on the operating system access to other resources are blocked as well (ex. inter process communication is isolated on Linux); see <link
247
-      xlink:href="https://nixos.org/nix/manual/#conf-sandbox">sandbox</link> in Nix manual for details.
247
+      xlink:href="https://nixos.org/nix/manual/#description-45">build-use-sandbox</link> in Nix manual for details.
248 248
    </para>
249 249
 
250 250
    <para>
@@ -265,7 +265,7 @@ Additional information.
265 265
      <listitem>
266 266
       <para>
267 267
        <emphasis role="bold">Globally enable sandboxing on non-NixOS platforms</emphasis>: add the following to: <filename>/etc/nix/nix.conf</filename>
268
-<screen>sandbox = true</screen>
268
+<screen>build-use-sandbox = true</screen>
269 269
       </para>
270 270
      </listitem>
271 271
     </itemizedlist>

+ 2
- 1
lib/default.nix View File

@@ -84,7 +84,8 @@ let
84 84
       hasInfix hasPrefix hasSuffix stringToCharacters stringAsChars escape
85 85
       escapeShellArg escapeShellArgs replaceChars lowerChars
86 86
       upperChars toLower toUpper addContextFrom splitString
87
-      removePrefix removeSuffix versionOlder versionAtLeast getVersion
87
+      removePrefix removeSuffix versionOlder versionAtLeast
88
+      getName getVersion
88 89
       nameFromURL enableFeature enableFeatureAs withFeature
89 90
       withFeatureAs fixedWidthString fixedWidthNumber isStorePath
90 91
       toInt readPathsFromFile fileContents;

+ 17
- 0
lib/strings.nix View File

@@ -472,6 +472,23 @@ rec {
472 472
   */
473 473
   versionAtLeast = v1: v2: !versionOlder v1 v2;
474 474
 
475
+  /* This function takes an argument that's either a derivation or a
476
+     derivation's "name" attribute and extracts the name part from that
477
+     argument.
478
+
479
+     Example:
480
+       getName "youtube-dl-2016.01.01"
481
+       => "youtube-dl"
482
+       getName pkgs.youtube-dl
483
+       => "youtube-dl"
484
+  */
485
+  getName = x:
486
+   let
487
+     parse = drv: (builtins.parseDrvName drv).name;
488
+   in if isString x
489
+      then parse x
490
+      else x.pname or (parse x.name);
491
+
475 492
   /* This function takes an argument that's either a derivation or a
476 493
      derivation's "name" attribute and extracts the version part from that
477 494
      argument.

+ 2
- 2
lib/systems/examples.nix View File

@@ -207,7 +207,7 @@ rec {
207 207
 
208 208
   # 32 bit mingw-w64
209 209
   mingw32 = {
210
-    config = "i686-pc-mingw32";
210
+    config = "i686-w64-mingw32";
211 211
     libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
212 212
     platform = {};
213 213
   };
@@ -215,7 +215,7 @@ rec {
215 215
   # 64 bit mingw-w64
216 216
   mingwW64 = {
217 217
     # That's the triplet they use in the mingw-w64 docs.
218
-    config = "x86_64-pc-mingw32";
218
+    config = "x86_64-w64-mingw32";
219 219
     libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
220 220
     platform = {};
221 221
   };

+ 3
- 0
lib/systems/parse.nix View File

@@ -208,6 +208,9 @@ rec {
208 208
   vendors = setTypes types.openVendor {
209 209
     apple = {};
210 210
     pc = {};
211
+    # Actually matters, unlocking some MinGW-w64-specific options in GCC. See
212
+    # bottom of https://sourceforge.net/p/mingw-w64/wiki2/Unicode%20apps/
213
+    w64 = {};
211 214
 
212 215
     none = {};
213 216
     unknown = {};

+ 1
- 1
maintainers/scripts/update.nix View File

@@ -126,7 +126,7 @@ let
126 126
 
127 127
   packageData = package: {
128 128
     name = package.name;
129
-    pname = (builtins.parseDrvName package.name).name;
129
+    pname = pkgs.lib.getName package;
130 130
     updateScript = map builtins.toString (pkgs.lib.toList package.updateScript);
131 131
   };
132 132
 

+ 12
- 9
nixos/doc/manual/development/releases.xml View File

@@ -45,12 +45,12 @@
45 45
     <listitem>
46 46
      <para>
47 47
       <literal>git tag -a -s -m &quot;Release 17.09-beta&quot; 17.09-beta
48
-      &amp;&amp; git push --tags</literal>
48
+      &amp;&amp; git push origin 17.09-beta</literal>
49 49
      </para>
50 50
     </listitem>
51 51
     <listitem>
52 52
      <para>
53
-      From the master branch run <literal>git checkout -B
53
+      From the master branch run <literal>git checkout -b
54 54
       release-17.09</literal>.
55 55
      </para>
56 56
     </listitem>
@@ -157,7 +157,7 @@
157 157
     <listitem>
158 158
      <para>
159 159
       Release Nix (currently only Eelco Dolstra can do that).
160
-      <link xlink:href="https://github.com/NixOS/nixpkgs/commit/53710c752a85f00658882531bc90a23a3d1287e4">
160
+      <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nix-fallback-paths.nix">
161 161
       Make sure fallback is updated. </link>
162 162
      </para>
163 163
     </listitem>
@@ -169,8 +169,8 @@
169 169
     </listitem>
170 170
     <listitem>
171 171
      <para>
172
-      Change <literal>stableBranch</literal> to true and wait for channel to
173
-      update.
172
+      Change <literal>stableBranch</literal> to <literal>true</literal> in Hydra and wait for
173
+      the channel to update.
174 174
      </para>
175 175
     </listitem>
176 176
    </itemizedlist>
@@ -193,9 +193,11 @@
193 193
     </listitem>
194 194
     <listitem&g