Merge branch 'master' into octave-gl2ps

This commit is contained in:
Michael Raskin 2019-12-08 18:09:08 +00:00 committed by GitHub
commit 06346a12a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5508 changed files with 158268 additions and 125394 deletions

18
.github/CODEOWNERS vendored
View File

@ -47,14 +47,17 @@
/nixos/doc/manual/man-nixos-option.xml @nbp /nixos/doc/manual/man-nixos-option.xml @nbp
/nixos/modules/installer/tools/nixos-option.sh @nbp /nixos/modules/installer/tools/nixos-option.sh @nbp
# NixOS integration test driver
/nixos/lib/test-driver @tfc
# New NixOS modules # New NixOS modules
/nixos/modules/module-list.nix @Infinisil /nixos/modules/module-list.nix @Infinisil
# Python-related code and docs # Python-related code and docs
/maintainers/scripts/update-python-libraries @FRidh /maintainers/scripts/update-python-libraries @FRidh
/pkgs/top-level/python-packages.nix @FRidh /pkgs/top-level/python-packages.nix @FRidh @jonringer
/pkgs/development/interpreters/python @FRidh /pkgs/development/interpreters/python @FRidh
/pkgs/development/python-modules @FRidh /pkgs/development/python-modules @FRidh @jonringer
/doc/languages-frameworks/python.section.md @FRidh /doc/languages-frameworks/python.section.md @FRidh
# Haskell # Haskell
@ -157,7 +160,18 @@
/pkgs/applications/editors/emacs @adisbladis /pkgs/applications/editors/emacs @adisbladis
/pkgs/top-level/emacs-packages.nix @adisbladis /pkgs/top-level/emacs-packages.nix @adisbladis
# VimPlugins
/pkgs/misc/vim-plugins @jonringer
# VsCode Extensions
/pkgs/misc/vscode-extensions @jonringer
# Prometheus exporter modules and tests # Prometheus exporter modules and tests
/nixos/modules/services/monitoring/prometheus/exporters.nix @WilliButz /nixos/modules/services/monitoring/prometheus/exporters.nix @WilliButz
/nixos/modules/services/monitoring/prometheus/exporters.xml @WilliButz /nixos/modules/services/monitoring/prometheus/exporters.xml @WilliButz
/nixos/tests/prometheus-exporters.nix @WilliButz /nixos/tests/prometheus-exporters.nix @WilliButz
# PHP
/pkgs/development/interpreters/php @etu
/pkgs/top-level/php-packages.nix @etu
/pkgs/build-support/build-pecl.nix @etu

View File

@ -6,9 +6,8 @@ under the terms of [COPYING](../COPYING), which is an MIT-like license.
## Opening issues ## Opening issues
* Make sure you have a [GitHub account](https://github.com/signup/free) * Make sure you have a [GitHub account](https://github.com/signup/free)
* [Submit an issue](https://github.com/NixOS/nixpkgs/issues) - assuming one does not already exist. * Make sure there is no open issue on the topic
* Clearly describe the issue including steps to reproduce when it is a bug. * [Submit a new issue](https://github.com/NixOS/nixpkgs/issues/new/choose) by choosing the kind of topic and fill out the template
* Include information what version of nixpkgs and Nix are you using (nixos-version or git revision).
## Submitting changes ## Submitting changes
@ -51,4 +50,4 @@ For package version upgrades and such a one-line commit message is usually suffi
## Reviewing contributions ## Reviewing contributions
See the nixpkgs manual for more details on how to [Review contributions](https://nixos.org/nixpkgs/manual/#sec-reviewing-contributions). See the nixpkgs manual for more details on how to [Review contributions](https://nixos.org/nixpkgs/manual/#chap-reviewing-contributions).

View File

@ -1,4 +1,4 @@
<!-- 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! --> <!-- 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! -->
###### Motivation for this change ###### Motivation for this change
@ -6,7 +6,7 @@
<!-- Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers. --> <!-- Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers. -->
- [ ] Tested using sandboxing ([nix.useSandbox](http://nixos.org/nixos/manual/options.html#opt-nix.useSandbox) on NixOS, or option `sandbox` in [`nix.conf`](http://nixos.org/nix/manual/#sec-conf-file) on non-NixOS) - [ ] Tested using sandboxing ([nix.useSandbox](http://nixos.org/nixos/manual/options.html#opt-nix.useSandbox) on NixOS, or option `sandbox` in [`nix.conf`](http://nixos.org/nix/manual/#sec-conf-file) on non-NixOS linux)
- Built on platform(s) - Built on platform(s)
- [ ] NixOS - [ ] NixOS
- [ ] macOS - [ ] macOS

32
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,32 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 180
# Number of days of inactivity before a stale issue is closed
daysUntilClose: false
# Issues with these labels will never be considered stale
exemptLabels:
- 1.severity: security
# Label to use when marking an issue as stale
staleLabel: 2.status: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
Thank you for your contributions.
This has been automatically marked as stale because it has had no
activity for 180 days.
If this is still important to you, we ask that you leave a
comment below. Your comment can be as simple as "still important
to me". This lets people see that at least one person still cares
about this. Someone will have to do this at most twice a year if
there is no other activity.
Here are suggestions that might help resolve this more quickly:
1. Search for maintainers and people that previously touched the
related code and @ mention them in a comment.
2. Ask on the [NixOS Discourse](https://discourse.nixos.org/).
3. Ask on the [#nixos channel](irc://irc.freenode.net/#nixos) on
[irc.freenode.net](https://freenode.net).
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@ -51,9 +51,7 @@ system, [Hydra](https://hydra.nixos.org/).
Artifacts successfully built with Hydra are published to cache at Artifacts successfully built with Hydra are published to cache at
https://cache.nixos.org/. When successful build and test criteria are https://cache.nixos.org/. When successful build and test criteria are
met, the Nixpkgs expressions are distributed via [Nix met, the Nixpkgs expressions are distributed via [Nix
channels](https://nixos.org/nix/manual/#sec-channels). The channels channels](https://nixos.org/nix/manual/#sec-channels).
are provided via a read-only mirror of the Nixpkgs repository called
[nixpkgs-channels](https://github.com/NixOS/nixpkgs-channels).
# Contributing # Contributing

View File

@ -1,17 +1,14 @@
<section xmlns="http://docbook.org/ns/docbook" <chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="sec-pkgs-fetchers"> xml:id="chap-pkgs-fetchers">
<title>Fetcher functions</title> <title>Fetchers</title>
<para> <para>
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. 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.
</para> </para>
<para> <para>
The two fetcher primitives are <function>fetchurl</function> and <function>fetchzip</function>. Both of these have two required arguments, a URL and a hash. The hash is typically <literal>sha256</literal>, although many more hash algorithms are supported. Nixpkgs contributors are currently recommended to use <literal>sha256</literal>. This hash will be used by Nix to identify your source. A typical usage of fetchurl is provided below. The two fetcher primitives are <function>fetchurl</function> and <function>fetchzip</function>. Both of these have two required arguments, a URL and a hash. The hash is typically <literal>sha256</literal>, although many more hash algorithms are supported. Nixpkgs contributors are currently recommended to use <literal>sha256</literal>. This hash will be used by Nix to identify your source. A typical usage of fetchurl is provided below.
</para> </para>
<programlisting><![CDATA[ <programlisting><![CDATA[
{ stdenv, fetchurl }: { stdenv, fetchurl }:
@ -23,19 +20,15 @@ stdenv.mkDerivation {
}; };
} }
]]></programlisting> ]]></programlisting>
<para> <para>
The main difference between <function>fetchurl</function> and <function>fetchzip</function> is in how they store the contents. <function>fetchurl</function> will store the unaltered contents of the URL within the Nix store. <function>fetchzip</function> on the other hand will decompress the archive for you, making files and directories directly accessible in the future. <function>fetchzip</function> can only be used with archives. Despite the name, <function>fetchzip</function> is not limited to .zip files and can also be used with any tarball. The main difference between <function>fetchurl</function> and <function>fetchzip</function> is in how they store the contents. <function>fetchurl</function> will store the unaltered contents of the URL within the Nix store. <function>fetchzip</function> on the other hand will decompress the archive for you, making files and directories directly accessible in the future. <function>fetchzip</function> can only be used with archives. Despite the name, <function>fetchzip</function> is not limited to .zip files and can also be used with any tarball.
</para> </para>
<para> <para>
<function>fetchpatch</function> works very similarly to <function>fetchurl</function> with the same arguments expected. It expects patch files as a source and and performs normalization on them before computing the checksum. For example it will remove comments or other unstable parts that are sometimes added by version control systems and can change over time. <function>fetchpatch</function> works very similarly to <function>fetchurl</function> with the same arguments expected. It expects patch files as a source and and performs normalization on them before computing the checksum. For example it will remove comments or other unstable parts that are sometimes added by version control systems and can change over time.
</para> </para>
<para> <para>
Other fetcher functions allow you to add source code directly from a VCS such as subversion or git. These are mostly straightforward names based on the name of the command used with the VCS system. Because they give you a working repository, they act most like <function>fetchzip</function>. Other fetcher functions allow you to add source code directly from a VCS such as subversion or git. These are mostly straightforward names based on the name of the command used with the VCS system. Because they give you a working repository, they act most like <function>fetchzip</function>.
</para> </para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term> <term>
@ -88,11 +81,9 @@ stdenv.mkDerivation {
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
<para> <para>
A number of fetcher functions wrap part of <function>fetchurl</function> and <function>fetchzip</function>. They are mainly convenience functions intended for commonly used destinations of source code in Nixpkgs. These wrapper fetchers are listed below. A number of fetcher functions wrap part of <function>fetchurl</function> and <function>fetchzip</function>. They are mainly convenience functions intended for commonly used destinations of source code in Nixpkgs. These wrapper fetchers are listed below.
</para> </para>
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term> <term>
@ -145,4 +136,4 @@ stdenv.mkDerivation {
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</section> </chapter>

12
doc/builders/images.xml Normal file
View File

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

View File

@ -0,0 +1,44 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-citrix">
<title>Citrix Workspace</title>
<para>
<note>
<para>
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>.
</para>
</note>
<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.
</para>
<section xml:id="sec-citrix-base">
<title>Basic usage</title>
<para>
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.
</para>
<warning>
<title>Caution with <command>nix-shell</command> installs</title>
<para>
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.
</para>
</warning>
</section>
<section xml:id="sec-citrix-custom-certs">
<title>Custom certificates</title>
<para>
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>:
<programlisting>
<![CDATA[with import <nixpkgs> { config.allowUnfree = true; };
let extraCerts = [ ./custom-cert-1.pem ./custom-cert-2.pem /* ... */ ]; in
citrix_workspace.override {
inherit extraCerts;
}]]>
</programlisting>
</para>
</section>
</section>

View File

@ -0,0 +1,24 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="dlib">
<title>DLib</title>
<para>
<link xlink:href="http://dlib.net/">DLib</link> is a modern, C++-based toolkit which provides several machine learning algorithms.
</para>
<section xml:id="compiling-without-avx-support">
<title>Compiling without AVX support</title>
<para>
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.
</para>
<para>
On the affected hardware errors like <literal>Illegal instruction</literal> will occur. In those cases AVX support needs to be disabled:
<programlisting>self: super: {
dlib = super.dlib.override { avxSupport = false; };
}</programlisting>
</para>
</section>
</section>

View File

@ -0,0 +1,72 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-eclipse">
<title>Eclipse</title>
<para>
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>.
</para>
<para>
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:
<screen>
<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses --description
</screen>
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.
</para>
<para>
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
<screen>
packageOverrides = pkgs: {
myEclipse = with pkgs.eclipses; eclipseWithPlugins {
eclipse = eclipse-platform;
jvmArgs = [ "-Xmx2048m" ];
plugins = [ plugins.color-theme ];
};
}
</screen>
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
<screen>
<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses.plugins --description
</screen>
</para>
<para>
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.
</para>
<para>
Expanding the previous example with two plugins using the above functions we have
<screen>
packageOverrides = pkgs: {
myEclipse = with pkgs.eclipses; eclipseWithPlugins {
eclipse = eclipse-platform;
jvmArgs = [ "-Xmx2048m" ];
plugins = [
plugins.color-theme
(plugins.buildEclipsePlugin {
name = "myplugin1-1.0";
srcFeature = fetchurl {
url = "http://…/features/myplugin1.jar";
sha256 = "123…";
};
srcPlugin = fetchurl {
url = "http://…/plugins/myplugin1.jar";
sha256 = "123…";
};
});
(plugins.buildEclipseUpdateSite {
name = "myplugin2-1.0";
src = fetchurl {
stripRoot = false;
url = "http://…/myplugin2.zip";
sha256 = "123…";
};
});
];
};
}
</screen>
</para>
</section>

View File

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

View File

@ -0,0 +1,131 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-emacs">
<title>Emacs</title>
<section xml:id="sec-emacs-config">
<title>Configuring Emacs</title>
<para>
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:
</para>
<screen>
{
packageOverrides = pkgs: with pkgs; {
myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
company
counsel
flycheck
ivy
magit
projectile
use-package
]));
}
}
</screen>
<para>
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.
</para>
<screen>
{
packageOverrides = pkgs: with pkgs; rec {
myEmacsConfig = writeText "default.el" ''
;; initialize package
(require 'package)
(package-initialize 'noactivate)
(eval-when-compile
(require 'use-package))
;; load some packages
(use-package company
:bind ("&lt;C-tab&gt;" . company-complete)
:diminish company-mode
:commands (company-mode global-company-mode)
:defer 1
:config
(global-company-mode))
(use-package counsel
:commands (counsel-descbinds)
:bind (([remap execute-extended-command] . counsel-M-x)
("C-x C-f" . counsel-find-file)
("C-c g" . counsel-git)
("C-c j" . counsel-git-grep)
("C-c k" . counsel-ag)
("C-x l" . counsel-locate)
("M-y" . counsel-yank-pop)))
(use-package flycheck
:defer 2
:config (global-flycheck-mode))
(use-package ivy
:defer 1
:bind (("C-c C-r" . ivy-resume)
("C-x C-b" . ivy-switch-buffer)
:map ivy-minibuffer-map
("C-j" . ivy-call))
:diminish ivy-mode
:commands ivy-mode
:config
(ivy-mode 1))
(use-package magit
:defer
:if (executable-find "git")
:bind (("C-x g" . magit-status)
("C-x G" . magit-dispatch-popup))
:init
(setq magit-completing-read-function 'ivy-completing-read))
(use-package projectile
:commands projectile-mode
:bind-keymap ("C-c p" . projectile-command-map)
:defer 5
:config
(projectile-global-mode))
'';
myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
(runCommand "default.el" {} ''
mkdir -p $out/share/emacs/site-lisp
cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
'')
company
counsel
flycheck
ivy
magit
projectile
use-package
]));
};
}
</screen>
<para>
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.
</para>
<para>
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>.
</para>
<screen>
overrides = self: super: rec {
haskell-mode = self.melpaPackages.haskell-mode;
...
};
((emacsPackagesGen emacs).overrideScope' overrides).emacsWithPackages (p: with p; [
# here both these package will use haskell-mode of our own choice
ghc-mod
dante
])
</screen>
</section>
</section>

View File

@ -0,0 +1,57 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-ibus-typing-booster">
<title>ibus-engines.typing-booster</title>
<para>
This package is an ibus-based completion method to speed up typing.
</para>
<section xml:id="sec-ibus-typing-booster-activate">
<title>Activating the engine</title>
<para>
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>.
</para>
<para>
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:
<programlisting>{ pkgs, ... }: {
i18n.inputMethod = {
enabled = "ibus";
ibus.engines = with pkgs.ibus-engines; [ typing-booster ];
};
}</programlisting>
</para>
</section>
<section xml:id="sec-ibus-typing-booster-customize-hunspell">
<title>Using custom hunspell dictionaries</title>
<para>
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:
<programlisting>ibus-engines.typing-booster.override {
langs = [ "de-at" "en-gb" ];
}</programlisting>
</para>
<para>
<emphasis>Note: each language passed to <literal>langs</literal> must be an attribute name in <literal>pkgs.hunspellDicts</literal>.</emphasis>
</para>
</section>
<section xml:id="sec-ibus-typing-booster-emoji-picker">
<title>Built-in emoji picker</title>
<para>
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:
</para>
<para>
On NixOS it can be installed using the following expression:
<programlisting>{ pkgs, ... }: {
fonts.fonts = with pkgs; [ noto-fonts-emoji ];
}</programlisting>
</para>
</section>
</section>

View File

@ -0,0 +1,23 @@
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="chap-packages">
<title>Packages</title>
<para>
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.
</para>
<xi:include href="citrix.xml" />
<xi:include href="dlib.xml" />
<xi:include href="eclipse.xml" />
<xi:include href="elm.xml" />
<xi:include href="emacs.xml" />
<xi:include href="ibus.xml" />
<xi:include href="kakoune.xml" />
<xi:include href="linux.xml" />
<xi:include href="locales.xml" />
<xi:include href="nginx.xml" />
<xi:include href="opengl.xml" />
<xi:include href="shell-helpers.xml" />
<xi:include href="steam.xml" />
<xi:include href="weechat.xml" />
<xi:include href="xorg.xml" />
</chapter>

View File

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

View File

@ -0,0 +1,85 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-linux-kernel">
<title>Linux kernel</title>
<para>
The Nix expressions to build the Linux kernel are in <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel"><filename>pkgs/os-specific/linux/kernel</filename></link>.
</para>
<para>
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 kernels <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>).
</para>
<para>
The kernel derivation exports an attribute <varname>features</varname> specifying whether optional functionality is or isnt 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 doesnt have to build the external <varname>iwlwifi</varname> package:
<programlisting>
modulesTree = [kernel]
++ pkgs.lib.optional (!kernel.features ? iwlwifi) kernelPackages.iwlwifi
++ ...;
</programlisting>
</para>
<para>
How to add a new (major) version of the Linux kernel to Nixpkgs:
<orderedlist>
<listitem>
<para>
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.
</para>
</listitem>
<listitem>
<para>
Add the new kernel to <filename>all-packages.nix</filename> (e.g., create an attribute <varname>kernel_2_6_22</varname>).
</para>
</listitem>
<listitem>
<para>
Now were 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:
<orderedlist>
<listitem>
<para>
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>).
</para>
</listitem>
<listitem>
<para>
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.
</para>
</listitem>
<listitem>
<para>
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. dont enable some feature on <literal>i686</literal> and disable it on <literal>x86_64</literal>).
</para>
</listitem>
<listitem>
<para>
If needed you can also run <literal>make menuconfig</literal>:
<screen>
<prompt>$ </prompt>nix-env -i ncurses
<prompt>$ </prompt>export NIX_CFLAGS_LINK=-lncurses
<prompt>$ </prompt>make menuconfig ARCH=<replaceable>arch</replaceable></screen>
</para>
</listitem>
<listitem>
<para>
Copy <filename>.config</filename> over the new config file (e.g. <filename>config-2.6.22-i686-smp</filename>).
</para>
</listitem>
</orderedlist>
</para>
</listitem>
<listitem>
<para>
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.
</para>
</listitem>
<listitem>
<para>
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 arent backwards compatible with older kernels, you may need to keep the older versions around.
</para>
</listitem>
</orderedlist>
</para>
</section>

View File

@ -0,0 +1,13 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="locales">
<title>Locales</title>
<para>
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.
</para>
<para>
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.
</para>
</section>

View File

@ -0,0 +1,25 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-nginx">
<title>Nginx</title>
<para>
<link xlink:href="https://nginx.org/">Nginx</link> is a reverse proxy and lightweight webserver.
</para>
<section xml:id="sec-nginx-etag">
<title>ETags on static files served from the Nix store</title>
<para>
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).
</para>
<para>
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.
</para>
<para>
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.
</para>
</section>
</section>

View File

@ -0,0 +1,9 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-opengl">
<title>OpenGL</title>
<para>
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.
</para>
</section>

View File

@ -0,0 +1,25 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-shell-helpers">
<title>Interactive shell helpers</title>
<para>
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:
<itemizedlist>
<listitem>
<para>
<literal>autojump</literal>: <command>autojump-share</command>
</para>
</listitem>
<listitem>
<para>
<literal>fzf</literal>: <command>fzf-share</command>
</para>
</listitem>
</itemizedlist>
E.g. <literal>autojump</literal> can then used in the .bashrc like this:
<screen>
source "$(autojump-share)/autojump.bash"
</screen>
</para>
</section>

View File

@ -0,0 +1,131 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-steam">
<title>Steam</title>
<section xml:id="sec-steam-nix">
<title>Steam in Nix</title>
<para>
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.
</para>
<para>
Nix problems and constraints:
<itemizedlist>
<listitem>
<para>
We don't have <filename>/bin/bash</filename> and many scripts point there. Similarly for <filename>/usr/bin/python</filename> .
</para>
</listitem>
<listitem>
<para>
We don't have the dynamic loader in <filename>/lib </filename>.
</para>
</listitem>
<listitem>
<para>
The <filename>steam.sh</filename> script in $HOME can not be patched, as it is checked and rewritten by steam.
</para>
</listitem>
<listitem>
<para>
The steam binary cannot be patched, it's also checked.
</para>
</listitem>
</itemizedlist>
</para>
<para>
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.
</para>
</section>
<section xml:id="sec-steam-play">
<title>How to play</title>
<para>
For 64-bit systems it's important to have
<programlisting>hardware.opengl.driSupport32Bit = true;</programlisting>
in your <filename>/etc/nixos/configuration.nix</filename>. You'll also need
<programlisting>hardware.pulseaudio.support32Bit = true;</programlisting>
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
<programlisting>hardware.steam-hardware.enable = true;</programlisting>
to your configuration.
</para>
</section>
<section xml:id="sec-steam-troub">
<title>Troubleshooting</title>
<para>
<variablelist>
<varlistentry>
<term>
Steam fails to start. What do I do?
</term>
<listitem>
<para>
Try to run
<programlisting>strace steam</programlisting>
to see what is causing steam to fail.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Using the FOSS Radeon or nouveau (nvidia) drivers
</term>
<listitem>
<itemizedlist>
<listitem>
<para>
The <literal>newStdcpp</literal> parameter was removed since NixOS 17.09 and should not be needed anymore.
</para>
</listitem>
<listitem>
<para>
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
<programlisting>steam.sh: line 713: 7842 Segmentation fault (core dumped)</programlisting>
have a look at <link xlink:href="https://github.com/NixOS/nixpkgs/pull/20269">this pull request</link>.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>
Java
</term>
<listitem>
<orderedlist>
<listitem>
<para>
There is no java in steam chrootenv by default. If you get a message like
<programlisting>/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found</programlisting>
You need to add
<programlisting> steam.override { withJava = true; };</programlisting>
to your configuration.
</para>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>
<section xml:id="sec-steam-run">
<title>steam-run</title>
<para>
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
<programlisting>pkgs.(steam.override {
nativeOnly = true;
newStdcpp = true;
}).run</programlisting>
to your configuration, rebuild, and run the game with
<programlisting>steam-run ./foo</programlisting>
</para>
</section>
</section>

View File

@ -0,0 +1,13 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="unfree-software">
<title>Unfree software</title>
<para>
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 doesnt 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.
</para>
<para>
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.
</para>
</section>

View File

@ -0,0 +1,85 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-weechat">
<title>Weechat</title>
<para>
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
<programlisting>weechat.override {configure = {availablePlugins, ...}: {
plugins = with availablePlugins; [ python perl ];
}
}</programlisting>
If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal> attribute, <literal>availablePlugins</literal> will be used automatically.
</para>
<para>
The plugins currently available are <literal>python</literal>, <literal>perl</literal>, <literal>ruby</literal>, <literal>guile</literal>, <literal>tcl</literal> and <literal>lua</literal>.
</para>
<para>
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:
<programlisting>weechat.override { configure = {availablePlugins, ...}: {
plugins = with availablePlugins; [
(python.withPackages (ps: with ps; [ pycrypto python-dbus ]))
];
};
}
</programlisting>
</para>
<para>
In order to also keep all default plugins installed, it is possible to use the following method:
<programlisting>weechat.override { configure = { availablePlugins, ... }: {
plugins = builtins.attrValues (availablePlugins // {
python = availablePlugins.python.withPackages (ps: with ps; [ pycrypto python-dbus ]);
});
}; }
</programlisting>
</para>
<para>
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:
<programlisting>weechat.override {
configure = { availablePlugins, ... }: {
init = ''
/set foo bar
/server add freenode chat.freenode.org
'';
};
}</programlisting>
Further values can be added to the list of commands when running <literal>weechat --run-command "your-commands"</literal>.
</para>
<para>
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>:
<programlisting>weechat.override {
configure = { availablePlugins, ... }: {
scripts = with pkgs.weechatScripts; [
weechat-xmpp weechat-matrix-bridge wee-slack
];
init = ''
/set plugins.var.python.jabber.key "val"
'':
};
}</programlisting>
</para>
<para>
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:
<programlisting>{ stdenv, fetchurl }:
stdenv.mkDerivation {
name = "exemplary-weechat-script";
src = fetchurl {
url = "https://scripts.tld/your-scripts.tar.gz";
sha256 = "...";
};
passthru.scripts = [ "foo.py" "bar.lua" ];
installPhase = ''
mkdir $out/share
cp foo.py $out/share
cp bar.lua $out/share
'';
}</programlisting>
</para>
</section>

View File

@ -0,0 +1,34 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="sec-xorg">
<title>X.org</title>
<para>
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.
</para>
<para>
The generator is invoked as follows:
<screen>
<prompt>$ </prompt>cd pkgs/servers/x11/xorg
<prompt>$ </prompt>cat tarballs-7.5.list extra.list old.list \
| perl ./generate-expr-from-tarballs.pl
</screen>
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.)
</para>
<para>
A file like <filename>tarballs-7.5.list</filename> contains all tarballs in a X.org release. It can be generated like this:
<screen>
<prompt>$ </prompt>export i="mirror://xorg/X11R7.4/src/everything/"
<prompt>$ </prompt>cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
| perl -e 'while (&lt;>) { if (/(href|HREF)="([^"]*.bz2)"/) { print "$ENV{'i'}$2\n"; }; }' \
| sort > tarballs-7.4.list
</screen>
<filename>extra.list</filename> contains libraries that arent 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>).
</para>
<para>
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>.
</para>
</section>

10
doc/builders/special.xml Normal file
View File

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

View File

@ -1,15 +1,13 @@
<section xmlns="http://docbook.org/ns/docbook" <chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="sec-trivial-builders"> xml:id="chap-trivial-builders">
<title>Trivial builders</title> <title>Trivial builders</title>
<para> <para>
Nixpkgs provides a couple of functions that help with building derivations. The most important one, <function>stdenv.mkDerivation</function>, has already been documented above. The following functions wrap <function>stdenv.mkDerivation</function>, making it easier to use in certain cases. Nixpkgs provides a couple of functions that help with building derivations. The most important one, <function>stdenv.mkDerivation</function>, has already been documented above. The following functions wrap <function>stdenv.mkDerivation</function>, making it easier to use in certain cases.
</para> </para>
<variablelist> <variablelist>
<varlistentry> <varlistentry xml:id="trivial-builder-runCommand">
<term> <term>
<literal>runCommand</literal> <literal>runCommand</literal>
</term> </term>
@ -42,7 +40,7 @@
</programlisting> </programlisting>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry xml:id="trivial-builder-runCommandCC">
<term> <term>
<literal>runCommandCC</literal> <literal>runCommandCC</literal>
</term> </term>
@ -52,7 +50,20 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry xml:id="trivial-builder-runCommandLocal">
<term>
<literal>runCommandLocal</literal>
</term>
<listitem>
<para>
Variant of <literal>runCommand</literal> that forces the derivation to be built locally, it is not substituted. This is intended for very cheap commands (&lt;1s execution time). It saves on the network roundrip and can speed up a build.
</para>
<note><para>
This sets <link xlink:href="https://nixos.org/nix/manual/#adv-attr-allowSubstitutes"><literal>allowSubstitutes</literal> to <literal>false</literal></link>, so only use <literal>runCommandLocal</literal> if you are certain the user will always have a builder for the <literal>system</literal> of the derivation. This should be true for most trivial use cases (e.g. just copying some files to a different location or adding symlinks), because there the <literal>system</literal> is usually the same as <literal>builtins.currentSystem</literal>.
</para></note>
</listitem>
</varlistentry>
<varlistentry xml:id="trivial-builder-writeText">
<term> <term>
<literal>writeTextFile</literal>, <literal>writeText</literal>, <literal>writeTextDir</literal>, <literal>writeScript</literal>, <literal>writeScriptBin</literal> <literal>writeTextFile</literal>, <literal>writeText</literal>, <literal>writeTextDir</literal>, <literal>writeScript</literal>, <literal>writeScriptBin</literal>
</term> </term>
@ -65,7 +76,7 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry xml:id="trivial-builder-symlinkJoin">
<term> <term>
<literal>symlinkJoin</literal> <literal>symlinkJoin</literal>
</term> </term>
@ -76,4 +87,4 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</section> </chapter>

View File

@ -620,6 +620,16 @@ args.stdenv.mkDerivation (args // {
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
If its an <emphasis>icon theme</emphasis>:
</term>
<listitem>
<para>
<filename>data/icons</filename>
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
If its related to <emphasis>SGML/XML processing</emphasis>: If its related to <emphasis>SGML/XML processing</emphasis>:
@ -652,6 +662,17 @@ args.stdenv.mkDerivation (args // {
</variablelist> </variablelist>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
If its a <emphasis>theme</emphasis> for a <emphasis>desktop environment</emphasis>,
a <emphasis>window manager</emphasis> or a <emphasis>display manager</emphasis>:
</term>
<listitem>
<para>
<filename>data/themes</filename>
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -2,7 +2,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0" version="5.0"
xml:id="sec-reviewing-contributions"> xml:id="chap-reviewing-contributions">
<title>Reviewing contributions</title> <title>Reviewing contributions</title>
<warning> <warning>
<para> <para>
@ -115,19 +115,12 @@
<para> <para>
It is possible to rebase the changes on nixos-unstable or nixpkgs-unstable for easier review by running the following commands from a nixpkgs clone. It is possible to rebase the changes on nixos-unstable or nixpkgs-unstable for easier review by running the following commands from a nixpkgs clone.
<screen> <screen>
<prompt>$ </prompt>git remote add channels https://github.com/NixOS/nixpkgs-channels.git <co <prompt>$ </prompt>git fetch origin nixos-unstable <co xml:id='reviewing-rebase-2' />
xml:id='reviewing-rebase-1' />
<prompt>$ </prompt>git fetch channels nixos-unstable <co xml:id='reviewing-rebase-2' />
<prompt>$ </prompt>git fetch origin pull/PRNUMBER/head <co xml:id='reviewing-rebase-3' /> <prompt>$ </prompt>git fetch origin pull/PRNUMBER/head <co xml:id='reviewing-rebase-3' />
<prompt>$ </prompt>git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD <co <prompt>$ </prompt>git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD <co
xml:id='reviewing-rebase-4' /> xml:id='reviewing-rebase-4' />
</screen> </screen>
<calloutlist> <calloutlist>
<callout arearefs='reviewing-rebase-1'>
<para>
This should be done only once to be able to fetch channel branches from the nixpkgs-channels repository.
</para>
</callout>
<callout arearefs='reviewing-rebase-2'> <callout arearefs='reviewing-rebase-2'>
<para> <para>
Fetching the nixos-unstable branch. Fetching the nixos-unstable branch.

View File

@ -228,6 +228,33 @@ Additional information.
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</section> </section>
<section xml:id="submitting-changes-submitting-security-fixes">
<title>Submitting security fixes</title>
<para>
Security fixes are submitted in the same way as other changes and thus the same guidelines apply.
</para>
<para>
If the security fix comes in the form of a patch and a CVE is available, then the name of the patch should be the CVE identifier, so e.g. <literal>CVE-2019-13636.patch</literal> in the case of a patch that is included in the Nixpkgs tree. If a patch is fetched the name needs to be set as well, e.g.:
</para>
<programlisting>
(fetchpatch {
name = "CVE-2019-11068.patch";
url = "https://gitlab.gnome.org/GNOME/libxslt/commit/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch";
sha256 = "0pkpb4837km15zgg6h57bncp66d5lwrlvkr73h0lanywq7zrwhj8";
})
</programlisting>
<para>
If a security fix applies to both master and a stable release then, similar to regular changes, they are preferably delivered via master first and cherry-picked to the release branch.
</para>
<para>
Critical security fixes may by-pass the staging branches and be delivered directly to release branches such as <literal>master</literal> and <literal>release-*</literal>.
</para>
</section>
<section xml:id="submitting-changes-pull-request-template"> <section xml:id="submitting-changes-pull-request-template">
<title>Pull Request Template</title> <title>Pull Request Template</title>
@ -298,12 +325,17 @@ Additional information.
<para> <para>
review changes from pull request number 12345: review changes from pull request number 12345:
<screen>nix-shell -p nix-review --run "nix-review pr 12345"</screen> <screen>nix run nixpkgs.nix-review -c nix-review pr 12345</screen>
</para> </para>
<para> <para>
review uncommitted changes: review uncommitted changes:
<screen>nix-shell -p nix-review --run "nix-review wip"</screen> <screen>nix run nixpkgs.nix-review -c nix-review wip</screen>
</para>
<para>
review changes from last commit:
<screen>nix run nixpkgs.nix-review -c nix-review rev HEAD</screen>
</para> </para>
</section> </section>
@ -375,31 +407,32 @@ Additional information.
<section xml:id="submitting-changes-master-branch"> <section xml:id="submitting-changes-master-branch">
<title>Master branch</title> <title>Master branch</title>
<para>
<itemizedlist> The <literal>master</literal> branch is the main development branch.
<listitem> It should only see non-breaking commits that do not cause mass rebuilds.
<para> </para>
It should only see non-breaking commits that do not cause mass rebuilds.
</para>
</listitem>
</itemizedlist>
</section> </section>
<section xml:id="submitting-changes-staging-branch"> <section xml:id="submitting-changes-staging-branch">
<title>Staging branch</title> <title>Staging branch</title>
<para>
The <literal>staging</literal> branch is a development branch where mass-rebuilds go.
It should only see non-breaking mass-rebuild commits.
That means it is not to be used for testing, and changes must have been well tested already.
If the branch is already in a broken state, please refrain from adding extra new breakages.
</para>
</section>
<itemizedlist> <section xml:id="submitting-changes-staging-next-branch">
<listitem> <title>Staging-next branch</title>
<para> <para>
It's only for non-breaking mass-rebuild commits. That means it's not to be used for testing, and changes must have been well tested already. <link xlink:href="https://web.archive.org/web/20160528180406/http://comments.gmane.org/gmane.linux.distributions.nixos/13447">Read policy here</link>. The <literal>staging-next</literal> branch is for stabilizing mass-rebuilds submitted to the <literal>staging</literal> branch prior to merging them into <literal>master</literal>.
</para> Mass-rebuilds should go via the <literal>staging</literal> branch.
</listitem> It should only see non-breaking commits that are fixing issues blocking it from being merged into the <literal>master </literal> branch.
<listitem> </para>
<para> <para>
If the branch is already in a broken state, please refrain from adding extra new breakages. Stabilize it for a few days, merge into master, then resume development on staging. <link xlink:href="http://hydra.nixos.org/jobset/nixpkgs/staging#tabs-evaluations">Keep an eye on the staging evaluations here</link>. If any fixes for staging happen to be already in master, then master can be merged into staging. If the branch is already in a broken state, please refrain from adding extra new breakages. Stabilize it for a few days and then merge into master.
</para> </para>
</listitem>
</itemizedlist>
</section> </section>
<section xml:id="submitting-changes-stable-release-branches"> <section xml:id="submitting-changes-stable-release-branches">
@ -408,7 +441,7 @@ Additional information.
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para> <para>
If you're cherry-picking a commit to a stable release branch, always use <command>git cherry-pick -xe</command> and ensure the message contains a clear description about why this needs to be included in the stable branch. If you're cherry-picking a commit to a stable release branch (“backporting”), always use <command>git cherry-pick -xe</command> and ensure the message contains a clear description about why this needs to be included in the stable branch.
</para> </para>
<para> <para>
An example of a cherry-picked commit would look like this: An example of a cherry-picked commit would look like this:

View File

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

View File

@ -7,17 +7,8 @@
The nixpkgs repository has several utility functions to manipulate Nix expressions. The nixpkgs repository has several utility functions to manipulate Nix expressions.
</para> </para>
<xi:include href="functions/library.xml" /> <xi:include href="functions/library.xml" />
<xi:include href="functions/overrides.xml" />
<xi:include href="functions/generators.xml" /> <xi:include href="functions/generators.xml" />
<xi:include href="functions/debug.xml" /> <xi:include href="functions/debug.xml" />
<xi:include href="functions/fetchers.xml" />
<xi:include href="functions/trivial-builders.xml" />
<xi:include href="functions/fhs-environments.xml" />
<xi:include href="functions/shell.xml" />
<xi:include href="functions/dockertools.xml" />
<xi:include href="functions/snaptools.xml" />
<xi:include href="functions/appimagetools.xml" />
<xi:include href="functions/prefer-remote-fetch.xml" /> <xi:include href="functions/prefer-remote-fetch.xml" />
<xi:include href="functions/nix-gitignore.xml" /> <xi:include href="functions/nix-gitignore.xml" />
<xi:include href="functions/ocitools.xml" />
</chapter> </chapter>

View File

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

View File

@ -26,7 +26,7 @@
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<literal>packages</literal>: a set of package sets, each compiled with a specific Erlang/OTP version, e.g. <literal>beam.packages.erlangR19</literal>. <literal>packages</literal>: a set of package builders (Mix and rebar3), each compiled with a specific Erlang/OTP version, e.g. <literal>beam.packages.erlangR19</literal>.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
@ -36,15 +36,11 @@
</para> </para>
<para> <para>
To create a package set built with a custom Erlang version, use the lambda, <literal>beam.packagesWith</literal>, which accepts an Erlang/OTP derivation and produces a package set similar to <literal>beam.packages.erlang</literal>. To create a package builder built with a custom Erlang version, use the lambda, <literal>beam.packagesWith</literal>, which accepts an Erlang/OTP derivation and produces a package builder similar to <literal>beam.packages.erlang</literal>.
</para> </para>
<para> <para>
Many Erlang/OTP distributions available in <literal>beam.interpreters</literal> have versions with ODBC and/or Java enabled. For example, there's <literal>beam.interpreters.erlangR19_odbc_javac</literal>, which corresponds to <literal>beam.interpreters.erlangR19</literal>. Many Erlang/OTP distributions available in <literal>beam.interpreters</literal> have versions with ODBC and/or Java enabled or without wx (no observer support). For example, there's <literal>beam.interpreters.erlangR22_odbc_javac</literal>, which corresponds to <literal>beam.interpreters.erlangR22</literal> and <literal>beam.interpreters.erlangR22_nox</literal>, which corresponds to <literal>beam.interpreters.erlangR22</literal>.
</para>
<para xml:id="erlang-call-package">
We also provide the lambda, <literal>beam.packages.erlang.callPackage</literal>, which simplifies writing BEAM package definitions by injecting all packages from <literal>beam.packages.erlang</literal> into the top-level context.
</para> </para>
</section> </section>
@ -55,7 +51,7 @@
<title>Rebar3</title> <title>Rebar3</title>
<para> <para>
We provide a version of Rebar3, which is the normal, unmodified Rebar3, under <literal>rebar3</literal>. We also provide a helper to fetch Rebar3 dependencies from a lockfile under <literal>fetchRebar3Deps</literal>. We provide a version of Rebar3, under <literal>rebar3</literal>. We also provide a helper to fetch Rebar3 dependencies from a lockfile under <literal>fetchRebar3Deps</literal>.
</para> </para>
</section> </section>
@ -72,32 +68,14 @@
<title>How to Install BEAM Packages</title> <title>How to Install BEAM Packages</title>
<para> <para>
BEAM packages are not registered at the top level, simply because they are not relevant to the vast majority of Nix users. They are installable using the <literal>beam.packages.erlang</literal> attribute set (aliased as <literal>beamPackages</literal>), which points to packages built by the default Erlang/OTP version in Nixpkgs, as defined by <literal>beam.interpreters.erlang</literal>. To list the available packages in <literal>beamPackages</literal>, use the following command: BEAM builders are not registered at the top level, simply because they are not relevant to the vast majority of Nix users.
To install any of those builders into your profile, refer to them by their attribute path <literal>beamPackages.rebar3</literal>:
</para> </para>
<screen> <screen>
<prompt>$ </prompt>nix-env -f &quot;&lt;nixpkgs&gt;&quot; -qaP -A beamPackages <prompt>$ </prompt>nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.rebar3
beamPackages.esqlite esqlite-0.2.1 </screen>
beamPackages.goldrush goldrush-0.1.7 </section>
beamPackages.ibrowse ibrowse-4.2.2
beamPackages.jiffy jiffy-0.14.5
beamPackages.lager lager-3.0.2
beamPackages.meck meck-0.8.3
beamPackages.rebar3-pc pc-1.1.0
</screen>
<para>
To install any of those packages into your profile, refer to them by their attribute path (first column):
</para>
<screen>
<prompt>$ </prompt>nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA beamPackages.ibrowse
</screen>
<para>
The attribute path of any BEAM package corresponds to the name of that particular package in <link xlink:href="https://hex.pm">Hex</link> or its OTP Application/Release name.
</para>
</section>
<section xml:id="packaging-beam-applications"> <section xml:id="packaging-beam-applications">
<title>Packaging BEAM Applications</title> <title>Packaging BEAM Applications</title>
@ -109,35 +87,7 @@ beamPackages.rebar3-pc pc-1.1.0
<title>Rebar3 Packages</title> <title>Rebar3 Packages</title>
<para> <para>
The Nix function, <literal>buildRebar3</literal>, defined in <literal>beam.packages.erlang.buildRebar3</literal> and aliased at the top level, can be used to build a derivation that understands how to build a Rebar3 project. For example, we can build <link The Nix function, <literal>buildRebar3</literal>, defined in <literal>beam.packages.erlang.buildRebar3</literal> and aliased at the top level, can be used to build a derivation that understands how to build a Rebar3 project.
xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link> as follows:
</para>
<programlisting>
{ stdenv, fetchFromGitHub, buildRebar3, ibrowse, jsx, erlware_commons }:
buildRebar3 rec {
name = "hex2nix";
version = "0.0.1";
src = fetchFromGitHub {
owner = "ericbmerritt";
repo = "hex2nix";
rev = "${version}";
sha256 = "1w7xjidz1l5yjmhlplfx7kphmnpvqm67w99hd2m7kdixwdxq0zqg";
};
beamDeps = [ ibrowse jsx erlware_commons ];
}
</programlisting>
<para>
Such derivations are callable with <literal>beam.packages.erlang.callPackage</literal> (see <xref
linkend="erlang-call-package"/>). To call this package using the normal <literal>callPackage</literal>, refer to dependency packages via <literal>beamPackages</literal>, e.g. <literal>beamPackages.ibrowse</literal>.
</para>
<para>
Notably, <literal>buildRebar3</literal> includes <literal>beamDeps</literal>, while <literal>stdenv.mkDerivation</literal> does not. BEAM dependencies added there will be correctly handled by the system.
</para> </para>
<para> <para>
@ -152,30 +102,6 @@ buildRebar3 rec {
Erlang.mk functions similarly to Rebar3, except we use <literal>buildErlangMk</literal> instead of <literal>buildRebar3</literal>. Erlang.mk functions similarly to Rebar3, except we use <literal>buildErlangMk</literal> instead of <literal>buildRebar3</literal>.
</para> </para>
<programlisting>
{ buildErlangMk, fetchHex, cowlib, ranch }:
buildErlangMk {
name = "cowboy";
version = "1.0.4";
src = fetchHex {
pkg = "cowboy";
version = "1.0.4";
sha256 = "6a0edee96885fae3a8dd0ac1f333538a42e807db638a9453064ccfdaa6b9fdac";
};
beamDeps = [ cowlib ranch ];
meta = {
description = ''
Small, fast, modular HTTP server written in Erlang
'';
license = stdenv.lib.licenses.isc;
homepage = https://github.com/ninenines/cowboy;
};
}
</programlisting>
</section> </section>
<section xml:id="mix-packages"> <section xml:id="mix-packages">
@ -185,57 +111,9 @@ buildErlangMk {
Mix functions similarly to Rebar3, except we use <literal>buildMix</literal> instead of <literal>buildRebar3</literal>. Mix functions similarly to Rebar3, except we use <literal>buildMix</literal> instead of <literal>buildRebar3</literal>.
</para> </para>
<programlisting>
{ buildMix, fetchHex, plug, absinthe }:
buildMix {
name = "absinthe_plug";
version = "1.0.0";
src = fetchHex {
pkg = "absinthe_plug";
version = "1.0.0";
sha256 = "08459823fe1fd4f0325a8bf0c937a4520583a5a26d73b193040ab30a1dfc0b33";
};
beamDeps = [ plug absinthe ];
meta = {
description = ''
A plug for Absinthe, an experimental GraphQL toolkit
'';
license = stdenv.lib.licenses.bsd3;
homepage = https://github.com/CargoSense/absinthe_plug;
};
}
</programlisting>
<para> <para>
Alternatively, we can use <literal>buildHex</literal> as a shortcut: Alternatively, we can use <literal>buildHex</literal> as a shortcut:
</para> </para>
<programlisting>
{ buildHex, buildMix, plug, absinthe }:
buildHex {
name = "absinthe_plug";
version = "1.0.0";
sha256 = "08459823fe1fd4f0325a8bf0c937a4520583a5a26d73b193040ab30a1dfc0b33";
builder = buildMix;
beamDeps = [ plug absinthe ];
meta = {
description = ''
A plug for Absinthe, an experimental GraphQL toolkit
'';
license = stdenv.lib.licenses.bsd3;
homepage = https://github.com/CargoSense/absinthe_plug;
};
}
</programlisting>
</section> </section>
</section> </section>
</section> </section>
@ -243,66 +121,13 @@ buildHex {
<section xml:id="how-to-develop"> <section xml:id="how-to-develop">
<title>How to Develop</title> <title>How to Develop</title>
<section xml:id="accessing-an-environment">
<title>Accessing an Environment</title>
<para>
Often, we simply want to access a valid environment that contains a specific package and its dependencies. We can accomplish that with the <literal>env</literal> attribute of a derivation. For example, let's say we want to access an Erlang REPL with <literal>ibrowse</literal> loaded up. We could do the following:
</para>
<screen>
<prompt>$ </prompt><userinput>nix-shell -A beamPackages.ibrowse.env --run "erl"</userinput>
<computeroutput>Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V7.0 (abort with ^G)</computeroutput>
<prompt>1> </prompt><userinput>m(ibrowse).</userinput>
<computeroutput>Module: ibrowse
MD5: 3b3e0137d0cbb28070146978a3392945
Compiled: January 10 2016, 23:34
Object file: /nix/store/g1rlf65rdgjs4abbyj4grp37ry7ywivj-ibrowse-4.2.2/lib/erlang/lib/ibrowse-4.2.2/ebin/ibrowse.beam
Compiler options: [{outdir,"/tmp/nix-build-ibrowse-4.2.2.drv-0/hex-source-ibrowse-4.2.2/_build/default/lib/ibrowse/ebin"},
debug_info,debug_info,nowarn_shadow_vars,
warn_unused_import,warn_unused_vars,warnings_as_errors,
{i,"/tmp/nix-build-ibrowse-4.2.2.drv-0/hex-source-ibrowse-4.2.2/_build/default/lib/ibrowse/include"}]
Exports:
add_config/1 send_req_direct/7
all_trace_off/0 set_dest/3
code_change/3 set_max_attempts/3
get_config_value/1 set_max_pipeline_size/3
get_config_value/2 set_max_sessions/3
get_metrics/0 show_dest_status/0
get_metrics/2 show_dest_status/1
handle_call/3 show_dest_status/2
handle_cast/2 spawn_link_worker_process/1
handle_info/2 spawn_link_worker_process/2
init/1 spawn_worker_process/1
module_info/0 spawn_worker_process/2
module_info/1 start/0
rescan_config/0 start_link/0
rescan_config/1 stop/0
send_req/3 stop_worker_process/1
send_req/4 stream_close/1
send_req/5 stream_next/1
send_req/6 terminate/2
send_req_direct/4 trace_off/0
send_req_direct/5 trace_off/2
send_req_direct/6 trace_on/0
trace_on/2
ok</computeroutput>
<prompt>2></prompt>
</screen>
<para>
Notice the <literal>-A beamPackages.ibrowse.env</literal>. That is the key to this functionality.
</para>
</section>
<section xml:id="creating-a-shell"> <section xml:id="creating-a-shell">
<title>Creating a Shell</title> <title>Creating a Shell</title>
<para> <para>
Getting access to an environment often isn't enough to do real development. Usually, we need to create a <literal>shell.nix</literal> file and do our development inside of the environment specified therein. This file looks a lot like the packaging described above, except that <literal>src</literal> points to the project root and we call the package directly. Usually, we need to create a <literal>shell.nix</literal> file and do our development inside of the environment specified therein. Just install your version of erlang and other interpreter, and then user your normal build tools.
</para> As an example with elixir:
</para>
<programlisting> <programlisting>
{ pkgs ? import &quot;&lt;nixpkgs&quot;&gt; {} }: { pkgs ? import &quot;&lt;nixpkgs&quot;&gt; {} }:
@ -311,114 +136,24 @@ with pkgs;
let let
f = { buildRebar3, ibrowse, jsx, erlware_commons }: elixir = beam.packages.erlangR22.elixir_1_9;
buildRebar3 {
name = "hex2nix";
version = "0.1.0";
src = ./.;
beamDeps = [ ibrowse jsx erlware_commons ];
};
drv = beamPackages.callPackage f {};
in in
mkShell {
buildInputs = [ elixir ];
drv ERL_INCLUDE_PATH="${erlang}/lib/erlang/usr/include";
}
</programlisting> </programlisting>
<section xml:id="building-in-a-shell"> <section xml:id="building-in-a-shell">
<title>Building in a Shell (for Mix Projects)</title> <title>Building in a Shell (for Mix Projects)</title>
<para>
We can leverage the support of the derivation, irrespective of the build derivation, by calling the commands themselves.
</para>
<programlisting>
# =============================================================================
# Variables
# =============================================================================
NIX_TEMPLATES := "$(CURDIR)/nix-templates"
TARGET := "$(PREFIX)"
PROJECT_NAME := thorndyke
NIXPKGS=../nixpkgs
NIX_PATH=nixpkgs=$(NIXPKGS)
NIX_SHELL=nix-shell -I "$(NIX_PATH)" --pure
# =============================================================================
# Rules
# =============================================================================
.PHONY= all test clean repl shell build test analyze configure install \
test-nix-install publish plt analyze
all: build
guard-%:
@ if [ "${${*}}" == "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi
clean:
rm -rf _build
rm -rf .cache
repl:
$(NIX_SHELL) --run "iex -pa './_build/prod/lib/*/ebin'"
shell:
$(NIX_SHELL)
configure:
$(NIX_SHELL) --command 'eval "$$configurePhase"'
build: configure
$(NIX_SHELL) --command 'eval "$$buildPhase"'
install:
$(NIX_SHELL) --command 'eval "$$installPhase"'
test:
$(NIX_SHELL) --command 'mix test --no-start --no-deps-check'
plt:
$(NIX_SHELL) --run "mix dialyzer.plt --no-deps-check"
analyze: build plt
$(NIX_SHELL) --run "mix dialyzer --no-compile"
</programlisting>
<para> <para>
Using a <literal>shell.nix</literal> as described (see <xref Using a <literal>shell.nix</literal> as described (see <xref
linkend="creating-a-shell"/>) should just work. Aside from <literal>test</literal>, <literal>plt</literal>, and <literal>analyze</literal>, the Make targets work just fine for all of the build derivations. linkend="creating-a-shell"/>) should just work.
</para> </para>
</section> </section>
</section> </section>
</section> </section>
<section xml:id="generating-packages-from-hex-with-hex2nix">
<title>Generating Packages from Hex with <literal>hex2nix</literal></title>
<para>
Updating the <link xlink:href="https://hex.pm">Hex</link> package set requires <link
xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link>. Given the path to the Erlang modules (usually <literal>pkgs/development/erlang-modules</literal>), it will dump a file called <literal>hex-packages.nix</literal>, containing all the packages that use a recognized build system in <link
xlink:href="https://hex.pm">Hex</link>. It can't be determined, however, whether every package is buildable.
</para>
<para>
To make life easier for our users, try to build every <link
xlink:href="https://hex.pm">Hex</link> package and remove those that fail. To do that, simply run the following command in the root of your <literal>nixpkgs</literal> repository:
</para>
<screen>
<prompt>$ </prompt>nix-build -A beamPackages
</screen>
<para>
That will attempt to build every package in <literal>beamPackages</literal>. Then manually remove those that fail. Hopefully, someone will improve <link
xlink:href="https://github.com/erlang-nix/hex2nix">hex2nix</link> in the future to automate the process.
</para>
</section>
</section> </section>

View File

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

View File

@ -32,7 +32,11 @@
<title>Icons</title> <title>Icons</title>
<para> <para>
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. 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.
</para>
<para>
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.
</para> </para>
</section> </section>
@ -70,7 +74,7 @@
preFixup = '' preFixup = ''
for f in $(find $out/bin/ $out/libexec/ -type f -executable); do for f in $(find $out/bin/ $out/libexec/ -type f -executable); do
wrapProgram "$f" \ wrapProgram "$f" \
--prefix GIO_EXTRA_MODULES : "${getLib gnome3.dconf}/lib/gio/modules" \ --prefix GIO_EXTRA_MODULES : "${getLib dconf}/lib/gio/modules" \
--prefix XDG_DATA_DIRS : "$out/share" \ --prefix XDG_DATA_DIRS : "$out/share" \
--prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/${name}" \ --prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/${name}" \
--prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \ --prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}" \
@ -91,9 +95,14 @@ preFixup = ''
<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>. <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>.
</para> </para>
</listitem> </listitem>
<listitem xml:id="ssec-gnome-hooks-gtk-drop-icon-theme-cache">
<para>
One of <package>gtk3</package>s setup hooks will remove <filename>icon-theme.cache</filename> files from packages icon theme directories to avoid conflicts. Icon theme packages should prevent this with <code>dontDropIconThemeCache = true;</code>.
</para>
</listitem>
<listitem xml:id="ssec-gnome-hooks-dconf"> <listitem xml:id="ssec-gnome-hooks-dconf">
<para> <para>
<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. <package>dconf.lib</package> is a dependency of <package>wrapGAppsHook</package>, which then also adds it to the <envar>GIO_EXTRA_MODULES</envar> variable.
</para> </para>
</listitem> </listitem>
<listitem xml:id="ssec-gnome-hooks-hicolor-icon-theme"> <listitem xml:id="ssec-gnome-hooks-hicolor-icon-theme">

View File

@ -3,7 +3,7 @@ title: User's Guide for Haskell in Nixpkgs
author: Peter Simons author: Peter Simons
date: 2015-06-01 date: 2015-06-01
--- ---
# User's Guide to the Haskell Infrastructure # Haskell
## How to install Haskell packages ## How to install Haskell packages
@ -25,14 +25,14 @@ avoided that by keeping all Haskell-related packages in a separate attribute
set called `haskellPackages`, which the following command will list: set called `haskellPackages`, which the following command will list:
``` ```
$ nix-env -f "<nixpkgs>" -qaP -A haskellPackages $ nix-env -f "<nixpkgs>" -qaP -A haskellPackages
haskellPackages.a50 a50-0.5 haskellPackages.a50 a50-0.5
haskellPackages.abacate haskell-abacate-0.0.0.0 haskellPackages.AAI AAI-0.2.0.1
haskellPackages.abcBridge haskell-abcBridge-0.12 haskellPackages.abacate abacate-0.0.0.0
haskellPackages.afv afv-0.1.1 haskellPackages.abc-puzzle abc-puzzle-0.2.1
haskellPackages.alex alex-3.1.4 haskellPackages.abcBridge abcBridge-0.15
haskellPackages.Allure Allure-0.4.101.1 haskellPackages.abcnotation abcnotation-1.9.0
haskellPackages.alms alms-0.6.7 haskellPackages.abeson abeson-0.1.0.1
[... some 8000 entries omitted ...] [... some 14000 entries omitted ...]
``` ```
To install any of those packages into your profile, refer to them by their To install any of those packages into your profile, refer to them by their
@ -101,19 +101,21 @@ to compile your Haskell packages with any GHC version you please. The following
command displays the complete list of available compilers: command displays the complete list of available compilers:
``` ```
$ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler $ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler
haskell.compiler.ghc6104 ghc-6.10.4 haskell.compiler.ghc822 ghc-8.2.2
haskell.compiler.ghc6123 ghc-6.12.3 haskell.compiler.integer-simple.ghc822 ghc-8.2.2
haskell.compiler.ghc704 ghc-7.0.4 haskell.compiler.ghc822Binary ghc-8.2.2-binary
haskell.compiler.ghc722 ghc-7.2.2 haskell.compiler.ghc844 ghc-8.4.4
haskell.compiler.ghc742 ghc-7.4.2 haskell.compiler.ghc863Binary ghc-8.6.3-binary
haskell.compiler.ghc763 ghc-7.6.3 haskell.compiler.ghc864 ghc-8.6.4
haskell.compiler.ghc784 ghc-7.8.4 haskell.compiler.integer-simple.ghc864 ghc-8.6.4
haskell.compiler.ghc7102 ghc-7.10.2 haskell.compiler.ghc865 ghc-8.6.5
haskell.compiler.ghcHEAD ghc-7.11.20150402 haskell.compiler.integer-simple.ghc865 ghc-8.6.5
haskell.compiler.ghcNokinds ghc-nokinds-7.11.20150704 haskell.compiler.ghc881 ghc-8.8.1
haskell.compiler.ghcjs ghcjs-0.1.0 haskell.compiler.integer-simple.ghc881 ghc-8.8.1
haskell.compiler.jhc jhc-0.8.2 haskell.compiler.ghcHEAD ghc-8.9.20190601
haskell.compiler.uhc uhc-1.1.9.0 haskell.compiler.integer-simple.ghcHEAD ghc-8.9.20190601
haskell.compiler.ghcjs84 ghcjs-8.4.0.1
haskell.compiler.ghcjs ghcjs-8.6.0.1
``` ```
We have no package sets for `jhc` or `uhc` yet, unfortunately, but for every We have no package sets for `jhc` or `uhc` yet, unfortunately, but for every
@ -398,7 +400,9 @@ nix:
For more on how to write a `shell.nix` file see the below section. You'll need For more on how to write a `shell.nix` file see the below section. You'll need
to express a derivation. Note that Nixpkgs ships with a convenience wrapper to express a derivation. Note that Nixpkgs ships with a convenience wrapper
function around `mkDerivation` called `haskell.lib.buildStackProject` to help you function around `mkDerivation` called `haskell.lib.buildStackProject` to help you
create this derivation in exactly the way Stack expects. All of the same inputs create this derivation in exactly the way Stack expects. However for this to work
you need to disable the sandbox, which you can do by using `--option sandbox relaxed`
or `--option sandbox false` to the Nix command. All of the same inputs
as `mkDerivation` can be provided. For example, to build a Stack project that as `mkDerivation` can be provided. For example, to build a Stack project that
including packages that link against a version of the R library compiled with including packages that link against a version of the R library compiled with
special options turned on: special options turned on:

View File

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

View File

@ -1,7 +1,7 @@
<chapter xmlns="http://docbook.org/ns/docbook" <chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="chap-language-support"> xml:id="chap-language-support">
<title>Support for specific programming languages and frameworks</title> <title>Languages and frameworks</title>
<para> <para>
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. 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.
</para> </para>
@ -9,6 +9,8 @@
<xi:include href="beam.xml" /> <xi:include href="beam.xml" />
<xi:include href="bower.xml" /> <xi:include href="bower.xml" />
<xi:include href="coq.xml" /> <xi:include href="coq.xml" />
<xi:include href="crystal.section.xml" />
<xi:include href="emscripten.section.xml" />
<xi:include href="gnome.xml" /> <xi:include href="gnome.xml" />
<xi:include href="go.xml" /> <xi:include href="go.xml" />
<xi:include href="haskell.section.xml" /> <xi:include href="haskell.section.xml" />
@ -27,6 +29,4 @@
<xi:include href="texlive.xml" /> <xi:include href="texlive.xml" />
<xi:include href="titanium.section.xml" /> <xi:include href="titanium.section.xml" />
<xi:include href="vim.section.xml" /> <xi:include href="vim.section.xml" />
<xi:include href="emscripten.section.xml" />
<xi:include href="crystal.section.xml" />
</chapter> </chapter>

View File

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

View File

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

View File

@ -144,6 +144,24 @@ What's happening here?
2. Then we create a Python 3.5 environment with the `withPackages` function. 2. Then we create a Python 3.5 environment with the `withPackages` function.
3. The `withPackages` function expects us to provide a function as an argument that takes the set of all python packages and returns a list of packages to include in the environment. Here, we select the packages `numpy` and `toolz` from the package set. 3. The `withPackages` function expects us to provide a function as an argument that takes the set of all python packages and returns a list of packages to include in the environment. Here, we select the packages `numpy` and `toolz` from the package set.
To combine this with `mkShell` you can:
```nix
with import <nixpkgs> {};
let
pythonEnv = python35.withPackages (ps: [
ps.numpy
ps.toolz
]);
in mkShell {
buildInputs = [
pythonEnv
hello
];
}
```
##### Execute command with `--run` ##### Execute command with `--run`
A convenient option with `nix-shell` is the `--run` A convenient option with `nix-shell` is the `--run`
option, with which you can execute a command in the `nix-shell`. We can option, with which you can execute a command in the `nix-shell`. We can
@ -593,7 +611,7 @@ as the interpreter unless overridden otherwise.
All parameters from `stdenv.mkDerivation` function are still supported. The following are specific to `buildPythonPackage`: All parameters from `stdenv.mkDerivation` function are still supported. The following are specific to `buildPythonPackage`:
* `catchConflicts ? true`: If `true`, abort package build if a package name appears more than once in dependency tree. Default is `true`. * `catchConflicts ? true`: If `true`, abort package build if a package name appears more than once in dependency tree. Default is `true`.
* `disabled` ? false: If `true`, package is not build for the particular Python interpreter version. * `disabled` ? false: If `true`, package is not built for the particular Python interpreter version.
* `dontWrapPythonPrograms ? false`: Skip wrapping of python programs. * `dontWrapPythonPrograms ? false`: Skip wrapping of python programs.
* `permitUserSite ? false`: Skip setting the `PYTHONNOUSERSITE` environment variable in wrapped programs. * `permitUserSite ? false`: Skip setting the `PYTHONNOUSERSITE` environment variable in wrapped programs.
* `installFlags ? []`: A list of strings. Arguments to be passed to `pip install`. To pass options to `python setup.py install`, use `--install-option`. E.g., `installFlags=["--install-option='--cpp_implementation'"]`. * `installFlags ? []`: A list of strings. Arguments to be passed to `pip install`. To pass options to `python setup.py install`, use `--install-option`. E.g., `installFlags=["--install-option='--cpp_implementation'"]`.
@ -850,9 +868,8 @@ Note: There is a boolean value `lib.inNixShell` set to `true` if nix-shell is in
Packages inside nixpkgs are written by hand. However many tools exist in Packages inside nixpkgs are written by hand. However many tools exist in
community to help save time. No tool is preferred at the moment. community to help save time. No tool is preferred at the moment.
- [python2nix](https://github.com/proger/python2nix) by Vladimir Kirillov - [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).
- [pypi2nix](https://github.com/garbas/pypi2nix) by Rok Garbas - [python2nix](https://github.com/proger/python2nix) by Vladimir Kirillov.
- [pypi2nix](https://github.com/offlinehacker/pypi2nix) by Jaka Hudoklin
### Deterministic builds ### Deterministic builds

View File

@ -1,5 +1,5 @@
R packages R
========== =
## Installation ## Installation

View File

@ -4,7 +4,7 @@ author: Matthias Beyer
date: 2017-03-05 date: 2017-03-05
--- ---
# User's Guide to the Rust Infrastructure # Rust
To install the rust compiler and cargo put To install the rust compiler and cargo put
@ -68,6 +68,17 @@ build-time.
When `verifyCargoDeps` is set to `true`, the build will also verify that the When `verifyCargoDeps` is set to `true`, the build will also verify that the
`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. `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.
### Building a crate for a different target
To build your crate with a different cargo `--target` simply specify the `target` attribute:
```nix
pkgs.rustPlatform.buildRustPackage {
(...)
target = "x86_64-fortanix-unknown-sgx";
}
```
## Compiling Rust crates using Nix instead of Cargo ## Compiling Rust crates using Nix instead of Cargo
### Simple operation ### Simple operation
@ -192,7 +203,7 @@ argument and returns a set that contains all attribute that should be
overwritten. overwritten.
For more complicated cases, such as when parts of the crate's For more complicated cases, such as when parts of the crate's
derivation depend on the the crate's version, the `attrs` argument of derivation depend on the crate's version, the `attrs` argument of
the override above can be read, as in the following example, which the override above can be read, as in the following example, which
patches the derivation: patches the derivation:

View File

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

View File

@ -5,21 +5,37 @@
<subtitle>Version <xi:include href=".version" parse="text" /> <subtitle>Version <xi:include href=".version" parse="text" />
</subtitle> </subtitle>
</info> </info>
<xi:include href="introduction.chapter.xml" /> <xi:include href="preface.chapter.xml" />
<xi:include href="quick-start.xml" /> <part>
<xi:include href="package-specific-user-notes.xml" /> <title>Using Nixpkgs</title>
<xi:include href="stdenv.xml" /> <xi:include href="using/configuration.xml" />
<xi:include href="multiple-output.xml" /> <xi:include href="using/overlays.xml" />
<xi:include href="cross-compilation.xml" /> <xi:include href="using/overrides.xml" />
<xi:include href="configuration.xml" /> <xi:include href="functions.xml" />
<xi:include href="functions.xml" /> </part>
<xi:include href="meta.xml" /> <part>
<xi:include href="languages-frameworks/index.xml" /> <title>Standard environment</title>
<xi:include href="platform-notes.xml" /> <xi:include href="stdenv/stdenv.xml" />
<xi:include href="package-notes.xml" /> <xi:include href="stdenv/meta.xml" />
<xi:include href="overlays.xml" /> <xi:include href="stdenv/multiple-output.xml" />
<xi:include href="coding-conventions.xml" /> <xi:include href="stdenv/cross-compilation.xml" />
<xi:include href="submitting-changes.xml" /> <xi:include href="stdenv/platform-notes.xml" />
<xi:include href="reviewing-contributions.xml" /> </part>
<xi:include href="contributing.xml" /> <part>
<title>Builders</title>
<xi:include href="builders/fetchers.xml" />
<xi:include href="builders/trivial-builders.xml" />
<xi:include href="builders/special.xml" />
<xi:include href="builders/images.xml" />
<xi:include href="languages-frameworks/index.xml" />
<xi:include href="builders/packages/index.xml" />
</part>
<part>
<title>Contributing to Nixpkgs</title>
<xi:include href="contributing/quick-start.xml" />
<xi:include href="contributing/coding-conventions.xml" />
<xi:include href="contributing/submitting-changes.xml" />
<xi:include href="contributing/reviewing-contributions.xml" />
<xi:include href="contributing/contributing-to-documentation.xml" />
</part>
</book> </book>

View File

@ -1,422 +0,0 @@
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="chap-package-notes">
<title>Package Notes</title>
<para>
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.
</para>
<!--============================================================-->
<section xml:id="sec-linux-kernel">
<title>Linux kernel</title>
<para>
The Nix expressions to build the Linux kernel are in <link
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel"><filename>pkgs/os-specific/linux/kernel</filename></link>.
</para>
<para>
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 kernels <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>).
</para>
<para>
The kernel derivation exports an attribute <varname>features</varname> specifying whether optional functionality is or isnt 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 doesnt have to build the external <varname>iwlwifi</varname> package:
<programlisting>
modulesTree = [kernel]
++ pkgs.lib.optional (!kernel.features ? iwlwifi) kernelPackages.iwlwifi
++ ...;
</programlisting>
</para>
<para>
How to add a new (major) version of the Linux kernel to Nixpkgs:
<orderedlist>
<listitem>
<para>
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.
</para>
</listitem>
<listitem>
<para>
Add the new kernel to <filename>all-packages.nix</filename> (e.g., create an attribute <varname>kernel_2_6_22</varname>).
</para>
</listitem>
<listitem>
<para>
Now were 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:
<orderedlist>
<listitem>
<para>
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>).
</para>
</listitem>
<listitem>
<para>
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.
</para>
</listitem>
<listitem>
<para>
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. dont enable some feature on <literal>i686</literal> and disable it on <literal>x86_64</literal>).
</para>
</listitem>
<listitem>
<para>
If needed you can also run <literal>make menuconfig</literal>:
<screen>
<prompt>$ </prompt>nix-env -i ncurses
<prompt>$ </prompt>export NIX_CFLAGS_LINK=-lncurses
<prompt>$ </prompt>make menuconfig ARCH=<replaceable>arch</replaceable></screen>
</para>
</listitem>
<listitem>
<para>
Copy <filename>.config</filename> over the new config file (e.g. <filename>config-2.6.22-i686-smp</filename>).
</para>
</listitem>
</orderedlist>
</para>
</listitem>
<listitem>
<para>
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.
</para>
</listitem>
<listitem>
<para>
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 arent backwards compatible with older kernels, you may need to keep the older versions around.
</para>
</listitem>
</orderedlist>
</para>
</section>
<!--============================================================-->
<section xml:id="sec-xorg">
<title>X.org</title>
<para>
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.
</para>
<para>
The generator is invoked as follows:
<screen>
<prompt>$ </prompt>cd pkgs/servers/x11/xorg
<prompt>$ </prompt>cat tarballs-7.5.list extra.list old.list \
| perl ./generate-expr-from-tarballs.pl
</screen>
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.)
</para>
<para>
A file like <filename>tarballs-7.5.list</filename> contains all tarballs in a X.org release. It can be generated like this:
<screen>
<prompt>$ </prompt>export i="mirror://xorg/X11R7.4/src/everything/"
<prompt>$ </prompt>cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \
| perl -e 'while (&lt;>) { if (/(href|HREF)="([^"]*.bz2)"/) { print "$ENV{'i'}$2\n"; }; }' \
| sort > tarballs-7.4.list
</screen>
<filename>extra.list</filename> contains libraries that arent 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>).
</para>
<para>
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>.
</para>
</section>
<!--============================================================-->
<!--
<section xml:id="sec-package-notes-gnome">
<title>Gnome</title>
<para>* Expression is auto-generated</para>
<para>* How to update</para>
</section>
-->
<!--============================================================-->
<!--
<section xml:id="sec-package-notes-gcc">
<title>GCC</title>
<para></para>
</section>
-->
<!--============================================================-->
<section xml:id="sec-eclipse">
<title>Eclipse</title>
<para>
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>.
</para>
<para>
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:
<screen>
<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses --description
</screen>
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.
</para>
<para>
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
<screen>
packageOverrides = pkgs: {
myEclipse = with pkgs.eclipses; eclipseWithPlugins {
eclipse = eclipse-platform;
jvmArgs = [ "-Xmx2048m" ];
plugins = [ plugins.color-theme ];
};
}
</screen>
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
<screen>
<prompt>$ </prompt>nix-env -f '&lt;nixpkgs&gt;' -qaP -A eclipses.plugins --description
</screen>
</para>
<para>
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.
</para>
<para>
Expanding the previous example with two plugins using the above functions we have
<screen>
packageOverrides = pkgs: {
myEclipse = with pkgs.eclipses; eclipseWithPlugins {
eclipse = eclipse-platform;
jvmArgs = [ "-Xmx2048m" ];
plugins = [
plugins.color-theme
(plugins.buildEclipsePlugin {
name = "myplugin1-1.0";
srcFeature = fetchurl {
url = "http://…/features/myplugin1.jar";
sha256 = "123…";
};
srcPlugin = fetchurl {
url = "http://…/plugins/myplugin1.jar";
sha256 = "123…";
};
});
(plugins.buildEclipseUpdateSite {
name = "myplugin2-1.0";
src = fetchurl {
stripRoot = false;
url = "http://…/myplugin2.zip";
sha256 = "123…";
};
});
];
};
}
</screen>
</para>
</section>
<section xml:id="sec-elm">
<title>Elm</title>
<para>
To start a development environment do <command>nix-shell -p elmPackages.elm elmPackages.elm-format</command>
</para>
<para>
To update Elm compiler, see <filename>nixpkgs/pkgs/development/compilers/elm/README.md</filename>.
</para>
<para>
To package Elm applications, <link xlink:href="https://github.com/hercules-ci/elm2nix#elm2nix">read about elm2nix</link>.
</para>
</section>
<section xml:id="sec-kakoune">
<title>Kakoune</title>
<para>
Kakoune can be built to autoload plugins:
<programlisting>(kakoune.override {
configure = {
plugins = with pkgs.kakounePlugins; [ parinfer-rust ];
};
})</programlisting>
</para>
</section>
<section xml:id="sec-shell-helpers">
<title>Interactive shell helpers</title>
<para>
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:
<itemizedlist>
<listitem>
<para>
<literal>autojump</literal>: <command>autojump-share</command>
</para>
</listitem>
<listitem>
<para>
<literal>fzf</literal>: <command>fzf-share</command>
</para>
</listitem>
</itemizedlist>
E.g. <literal>autojump</literal> can then used in the .bashrc like this:
<screen>
source "$(autojump-share)/autojump.bash"
</screen>
</para>
</section>
<section xml:id="sec-weechat">
<title>Weechat</title>
<para>
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
<programlisting>weechat.override {configure = {availablePlugins, ...}: {
plugins = with availablePlugins; [ python perl ];
}
}</programlisting>
If the <literal>configure</literal> function returns an attrset without the <literal>plugins</literal> attribute, <literal>availablePlugins</literal> will be used automatically.
</para>
<para>
The plugins currently available are <literal>python</literal>, <literal>perl</literal>, <literal>ruby</literal>, <literal>guile</literal>, <literal>tcl</literal> and <literal>lua</literal>.
</para>
<para>
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:
<programlisting>weechat.override { configure = {availablePlugins, ...}: {
plugins = with availablePlugins; [
(python.withPackages (ps: with ps; [ pycrypto python-dbus ]))
];
};
}
</programlisting>
</para>
<para>
In order to also keep all default plugins installed, it is possible to use the following method:
<programlisting>weechat.override { configure = { availablePlugins, ... }: {
plugins = builtins.attrValues (availablePlugins // {
python = availablePlugins.python.withPackages (ps: with ps; [ pycrypto python-dbus ]);
});
}; }
</programlisting>
</para>
<para>
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:
<programlisting>weechat.override {
configure = { availablePlugins, ... }: {
init = ''
/set foo bar
/server add freenode chat.freenode.org
'';
};
}</programlisting>
Further values can be added to the list of commands when running <literal>weechat --run-command "your-commands"</literal>.
</para>
<para>
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>:
<programlisting>weechat.override {
configure = { availablePlugins, ... }: {
scripts = with pkgs.weechatScripts; [
weechat-xmpp weechat-matrix-bridge wee-slack
];
init = ''
/set plugins.var.python.jabber.key "val"
'':
};
}</programlisting>
</para>
<para>
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:
<programlisting>{ stdenv, fetchurl }:
stdenv.mkDerivation {
name = "exemplary-weechat-script";
src = fetchurl {
url = "https://scripts.tld/your-scripts.tar.gz";
sha256 = "...";
};
passthru.scripts = [ "foo.py" "bar.lua" ];
installPhase = ''
mkdir $out/share
cp foo.py $out/share
cp bar.lua $out/share
'';
}</programlisting>
</para>
</section>
<section xml:id="sec-ibus-typing-booster">
<title>ibus-engines.typing-booster</title>
<para>
This package is an ibus-based completion method to speed up typing.
</para>
<section xml:id="sec-ibus-typing-booster-activate">
<title>Activating the engine</title>
<para>
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>.
</para>
<para>
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:
<programlisting>{ pkgs, ... }: {
i18n.inputMethod = {
enabled = "ibus";
ibus.engines = with pkgs.ibus-engines; [ typing-booster ];
};
}</programlisting>
</para>
</section>
<section xml:id="sec-ibus-typing-booster-customize-hunspell">
<title>Using custom hunspell dictionaries</title>
<para>
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:
<programlisting>ibus-engines.typing-booster.override {
langs = [ "de-at" "en-gb" ];
}</programlisting>
</para>
<para>
<emphasis>Note: each language passed to <literal>langs</literal> must be an attribute name in <literal>pkgs.hunspellDicts</literal>.</emphasis>
</para>
</section>
<section xml:id="sec-ibus-typing-booster-emoji-picker">
<title>Built-in emoji picker</title>
<para>
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:
</para>
<para>
On NixOS it can be installed using the following expression:
<programlisting>{ pkgs, ... }: {
fonts.fonts = with pkgs; [ noto-fonts-emoji ];
}</programlisting>
</para>
</section>
</section>
<section xml:id="sec-nginx">
<title>Nginx</title>
<para>
<link xlink:href="https://nginx.org/">Nginx</link> is a reverse proxy and lightweight webserver.
</para>
<section xml:id="sec-nginx-etag">
<title>ETags on static files served from the Nix store</title>
<para>
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).
</para>
<para>
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.
</para>
<para>
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.
</para>
</section>
</section>
</chapter>

View File

@ -1,357 +0,0 @@
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="package-specific-user-notes">
<title>Package-specific usage notes</title>
<para>
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>.
</para>
<section xml:id="opengl">
<title>OpenGL</title>
<para>
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.
</para>
</section>
<section xml:id="locales">
<title>Locales</title>
<para>
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.
</para>
<para>
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.
</para>
</section>
<section xml:id="sec-emacs">
<title>Emacs</title>
<section xml:id="sec-emacs-config">
<title>Configuring Emacs</title>
<para>
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:
</para>
<screen>
{
packageOverrides = pkgs: with pkgs; {
myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
company
counsel
flycheck
ivy
magit
projectile
use-package
]));
}
}
</screen>
<para>
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.
</para>
<screen>
{
packageOverrides = pkgs: with pkgs; rec {
myEmacsConfig = writeText "default.el" ''
;; initialize package
(require 'package)
(package-initialize 'noactivate)
(eval-when-compile
(require 'use-package))
;; load some packages
(use-package company
:bind ("&lt;C-tab&gt;" . company-complete)
:diminish company-mode
:commands (company-mode global-company-mode)
:defer 1
:config
(global-company-mode))
(use-package counsel
:commands (counsel-descbinds)
:bind (([remap execute-extended-command] . counsel-M-x)
("C-x C-f" . counsel-find-file)
("C-c g" . counsel-git)
("C-c j" . counsel-git-grep)
("C-c k" . counsel-ag)
("C-x l" . counsel-locate)
("M-y" . counsel-yank-pop)))
(use-package flycheck
:defer 2
:config (global-flycheck-mode))
(use-package ivy
:defer 1
:bind (("C-c C-r" . ivy-resume)
("C-x C-b" . ivy-switch-buffer)
:map ivy-minibuffer-map
("C-j" . ivy-call))
:diminish ivy-mode
:commands ivy-mode
:config
(ivy-mode 1))
(use-package magit
:defer
:if (executable-find "git")
:bind (("C-x g" . magit-status)
("C-x G" . magit-dispatch-popup))
:init
(setq magit-completing-read-function 'ivy-completing-read))
(use-package projectile
:commands projectile-mode
:bind-keymap ("C-c p" . projectile-command-map)
:defer 5
:config
(projectile-global-mode))
'';
myEmacs = emacsWithPackages (epkgs: (with epkgs.melpaStablePackages; [
(runCommand "default.el" {} ''
mkdir -p $out/share/emacs/site-lisp
cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el
'')
company
counsel
flycheck
ivy
magit
projectile
use-package
]));
};
}
</screen>
<para>
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.
</para>
<para>
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>.
</para>
<screen>
overrides = self: super: rec {
haskell-mode = self.melpaPackages.haskell-mode;
...
};
((emacsPackagesGen emacs).overrideScope' overrides).emacsWithPackages (p: with p; [
# here both these package will use haskell-mode of our own choice
ghc-mod
dante
])
</screen>
</section>
</section>
<section xml:id="dlib">
<title>DLib</title>
<para>
<link xlink:href="http://dlib.net/">DLib</link> is a modern, C++-based toolkit which provides several machine learning algorithms.
</para>
<section xml:id="compiling-without-avx-support">
<title>Compiling without AVX support</title>
<para>
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.
</para>
<para>
On the affected hardware errors like <literal>Illegal instruction</literal> will occur. In those cases AVX support needs to be disabled:
<programlisting>self: super: {
dlib = super.dlib.override { avxSupport = false; };
}</programlisting>
</para>
</section>
</section>
<section xml:id="unfree-software">
<title>Unfree software</title>
<para>
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 doesnt 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.
</para>
<para>
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.
</para>
</section>
<section xml:id="sec-steam">
<title>Steam</title>
<section xml:id="sec-steam-nix">
<title>Steam in Nix</title>
<para>
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.
</para>
<para>
Nix problems and constraints:
<itemizedlist>
<listitem>
<para>
We don't have <filename>/bin/bash</filename> and many scripts point there. Similarly for <filename>/usr/bin/python</filename> .
</para>
</listitem>
<listitem>
<para>
We don't have the dynamic loader in <filename>/lib </filename>.
</para>
</listitem>
<listitem>
<para>
The <filename>steam.sh</filename> script in $HOME can not be patched, as it is checked and rewritten by steam.
</para>
</listitem>
<listitem>
<para>
The steam binary cannot be patched, it's also checked.
</para>
</listitem>
</itemizedlist>
</para>
<para>
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.
</para>
</section>
<section xml:id="sec-steam-play">
<title>How to play</title>
<para>
For 64-bit systems it's important to have
<programlisting>hardware.opengl.driSupport32Bit = true;</programlisting>
in your <filename>/etc/nixos/configuration.nix</filename>. You'll also need
<programlisting>hardware.pulseaudio.support32Bit = true;</programlisting>
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
<programlisting>hardware.steam-hardware.enable = true;</programlisting>
to your configuration.
</para>
</section>
<section xml:id="sec-steam-troub">
<title>Troubleshooting</title>
<para>
<variablelist>
<varlistentry>
<term>
Steam fails to start. What do I do?
</term>
<listitem>
<para>
Try to run
<programlisting>strace steam</programlisting>
to see what is causing steam to fail.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
Using the FOSS Radeon or nouveau (nvidia) drivers
</term>
<listitem>
<itemizedlist>
<listitem>
<para>
The <literal>newStdcpp</literal> parameter was removed since NixOS 17.09 and should not be needed anymore.
</para>
</listitem>
<listitem>
<para>
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
<programlisting>steam.sh: line 713: 7842 Segmentation fault (core dumped)</programlisting>
have a look at <link xlink:href="https://github.com/NixOS/nixpkgs/pull/20269">this pull request</link>.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>
Java
</term>
<listitem>
<orderedlist>
<listitem>
<para>
There is no java in steam chrootenv by default. If you get a message like
<programlisting>/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found</programlisting>
You need to add
<programlisting> steam.override { withJava = true; };</programlisting>
to your configuration.
</para>
</listitem>
</orderedlist>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>
<section xml:id="sec-steam-run">
<title>steam-run</title>
<para>
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
<programlisting>pkgs.(steam.override {
nativeOnly = true;
newStdcpp = true;
}).run</programlisting>
to your configuration, rebuild, and run the game with
<programlisting>steam-run ./foo</programlisting>
</para>
</section>
</section>
<section xml:id="sec-citrix">
<title>Citrix Receiver &amp; Citrix Workspace App</title>
<para>
<note>
<para>
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>.
</para>
</note>
<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.
</para>
<section xml:id="sec-citrix-base">
<title>Basic usage</title>
<para>
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.
</para>
<warning>
<title>Caution with <command>nix-shell</command> installs</title>
<para>
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.
</para>
</warning>
</section>
<section xml:id="sec-citrix-custom-certs">
<title>Custom certificates</title>
<para>
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>:
<programlisting>
<![CDATA[with import <nixpkgs> { config.allowUnfree = true; };
let extraCerts = [ ./custom-cert-1.pem ./custom-cert-2.pem /* ... */ ]; in
citrix_workspace.override {
inherit extraCerts;
}]]>
</programlisting>
</para>
</section>
</section>
</chapter>

View File

@ -1,44 +1,45 @@
--- ---
title: Introduction title: Preface
author: Frederik Rietdijk author: Frederik Rietdijk
date: 2015-11-25 date: 2015-11-25
--- ---
# Introduction # Preface
The Nix Packages collection (Nixpkgs) is a set of thousands of packages for the The Nix Packages collection (Nixpkgs) is a set of thousands of packages for the
[Nix package manager](http://nixos.org/nix/), released under a [Nix package manager](https://nixos.org/nix/), released under a
[permissive MIT/X11 license](https://github.com/NixOS/nixpkgs/blob/master/COPYING). [permissive MIT/X11 license](https://github.com/NixOS/nixpkgs/blob/master/COPYING).
Packages are available for several platforms, and can be used with the Nix Packages are available for several platforms, and can be used with the Nix
package manager on most GNU/Linux distributions as well as NixOS. package manager on most GNU/Linux distributions as well as [NixOS](https://nixos.org/nixos).
This manual primarily describes how to write packages for the Nix Packages collection This manual primarily describes how to write packages for the Nix Packages collection
(Nixpkgs). Thus its mainly for packagers and developers who want to add packages to (Nixpkgs). Thus its mainly for packagers and developers who want to add packages to
Nixpkgs. If you like to learn more about the Nix package manager and the Nix Nixpkgs. If you like to learn more about the Nix package manager and the Nix
expression language, then you are kindly referred to the [Nix manual](http://nixos.org/nix/manual/). expression language, then you are kindly referred to the [Nix manual](https://nixos.org/nix/manual/).
The NixOS distribution is documented in the [NixOS manual](https://nixos.org/nixos/manual/).
## Overview of Nixpkgs ## Overview of Nixpkgs
Nix expressions describe how to build packages from source and are collected in Nix expressions describe how to build packages from source and are collected in
the [nixpkgs repository](https://github.com/NixOS/nixpkgs). Also included in the the [nixpkgs repository](https://github.com/NixOS/nixpkgs). Also included in the
collection are Nix expressions for collection are Nix expressions for
[NixOS modules](http://nixos.org/nixos/manual/index.html#sec-writing-modules). [NixOS modules](https://nixos.org/nixos/manual/index.html#sec-writing-modules).
With these expressions the Nix package manager can build binary packages. With these expressions the Nix package manager can build binary packages.
Packages, including the Nix packages collection, are distributed through Packages, including the Nix packages collection, are distributed through
[channels](http://nixos.org/nix/manual/#sec-channels). The collection is [channels](https://nixos.org/nix/manual/#sec-channels). The collection is
distributed for users of Nix on non-NixOS distributions through the channel distributed for users of Nix on non-NixOS distributions through the channel
`nixpkgs`. Users of NixOS generally use one of the `nixos-*` channels, e.g. `nixpkgs`. Users of NixOS generally use one of the `nixos-*` channels, e.g.
`nixos-16.03`, which includes all packages and modules for the stable NixOS `nixos-19.09`, which includes all packages and modules for the stable NixOS
16.03. Stable NixOS releases are generally only given 19.09. Stable NixOS releases are generally only given
security updates. More up to date packages and modules are available via the security updates. More up to date packages and modules are available via the
`nixos-unstable` channel. `nixos-unstable` channel.
Both `nixos-unstable` and `nixpkgs` follow the `master` branch of the Nixpkgs Both `nixos-unstable` and `nixpkgs` follow the `master` branch of the Nixpkgs
repository, although both do lag the `master` branch by generally repository, although both do lag the `master` branch by generally
[a couple of days](http://howoldis.herokuapp.com/). Updates to a channel are [a couple of days](https://howoldis.herokuapp.com/). Updates to a channel are
distributed as soon as all tests for that channel pass, e.g. distributed as soon as all tests for that channel pass, e.g.
[this table](http://hydra.nixos.org/job/nixpkgs/trunk/unstable#tabs-constituents) [this table](https://hydra.nixos.org/job/nixpkgs/trunk/unstable#tabs-constituents)
shows the status of tests for the `nixpkgs` channel. shows the status of tests for the `nixpkgs` channel.
The tests are conducted by a cluster called [Hydra](http://nixos.org/hydra/), The tests are conducted by a cluster called [Hydra](http://nixos.org/hydra/),
@ -47,5 +48,5 @@ which also builds binary packages from the Nix expressions in Nixpkgs for
The binaries are made available via a [binary cache](https://cache.nixos.org). The binaries are made available via a [binary cache](https://cache.nixos.org).
The current Nix expressions of the channels are available in the The current Nix expressions of the channels are available in the
[`nixpkgs-channels`](https://github.com/NixOS/nixpkgs-channels) repository, [`nixpkgs`](https://github.com/NixOS/nixpkgs) repository in branches
which has branches corresponding to the available channels. that correspond to the channel names (e.g. `nixos-19.09-small`).

View File

@ -244,7 +244,7 @@
</question> </question>
<answer> <answer>
<para> <para>
Many packages assume that an unprefixed <command>ar</command> is available, but Nix doesn't provide one. It only provides a prefixed one, just as it only does for all the other binutils programs. It may be necessary to patch the package to fix the build system to use a prefixed `ar`. Many packages assume that an unprefixed <command>ar</command> is available, but Nix doesn't provide one. It only provides a prefixed one, just as it only does for all the other binutils programs. It may be necessary to patch the package to fix the build system to use a prefixed <command>ar</command>.
</para> </para>
</answer> </answer>
</qandaentry> </qandaentry>
@ -348,12 +348,12 @@ nix-build '&lt;nixpkgs&gt;' --arg crossSystem '{ config = "&lt;arch&gt;-&lt;os&g
</para> </para>
</listitem> </listitem>
</orderedlist> </orderedlist>
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>. 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>.
</para> </para>
<note> <note>
<para> <para>
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. 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.
</para> </para>
</note> </note>

View File

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

View File

@ -1692,7 +1692,7 @@ someVar=$(stripHash $name)
</term> </term>
<listitem> <listitem>
<para> <para>
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>. 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>.
</para> </para>
<para> <para>
It cannot be applied multiple times, since it will overwrite the wrapper file. It cannot be applied multiple times, since it will overwrite the wrapper file.
@ -1717,7 +1717,7 @@ someVar=$(stripHash $name)
</para> </para>
<para> <para>
The most typical use of the setup hook is actually to add other hooks which are then run (i.e. after all the setup hooks) on each dependency. For example, the C compiler wrapper's setup hook feeds itself flags for each dependency that contains relevant libraries and headers. This is done by defining a bash function, and appending its name to one of <envar>envBuildBuildHooks</envar>`, <envar>envBuildHostHooks</envar>`, <envar>envBuildTargetHooks</envar>`, <envar>envHostHostHooks</envar>`, <envar>envHostTargetHooks</envar>`, or <envar>envTargetTargetHooks</envar>`. These 6 bash variables correspond to the 6 sorts of dependencies by platform (there's 12 total but we ignore the propagated/non-propagated axis). The most typical use of the setup hook is actually to add other hooks which are then run (i.e. after all the setup hooks) on each dependency. For example, the C compiler wrapper's setup hook feeds itself flags for each dependency that contains relevant libraries and headers. This is done by defining a bash function, and appending its name to one of <envar>envBuildBuildHooks</envar>, <envar>envBuildHostHooks</envar>, <envar>envBuildTargetHooks</envar>, <envar>envHostHostHooks</envar>, <envar>envHostTargetHooks</envar>, or <envar>envTargetTargetHooks</envar>. These 6 bash variables correspond to the 6 sorts of dependencies by platform (there's 12 total but we ignore the propagated/non-propagated axis).
</para> </para>
<para> <para>
@ -1869,7 +1869,7 @@ addEnvHooks "$hostOffset" myBashFunction
</para> </para>
<para> <para>
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. 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.
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term> <term>

View File

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

View File

@ -1,17 +1,14 @@
<section xmlns="http://docbook.org/ns/docbook" <chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="sec-overrides"> xml:id="chap-overrides">
<title>Overriding</title> <title>Overriding</title>
<para> <para>
Sometimes one wants to override parts of <literal>nixpkgs</literal>, e.g. derivation attributes, the results of derivations. Sometimes one wants to override parts of <literal>nixpkgs</literal>, e.g. derivation attributes, the results of derivations.
</para> </para>
<para> <para>
These functions are used to make changes to packages, returning only single packages. <link xlink:href="#chap-overlays">Overlays</link>, on the other hand, can be used to combine the overridden packages across the entire package set of Nixpkgs. These functions are used to make changes to packages, returning only single packages. <link xlink:href="#chap-overlays">Overlays</link>, on the other hand, can be used to combine the overridden packages across the entire package set of Nixpkgs.
</para> </para>
<section xml:id="sec-pkg-override"> <section xml:id="sec-pkg-override">
<title>&lt;pkg&gt;.override</title> <title>&lt;pkg&gt;.override</title>
@ -45,7 +42,6 @@ mypkg = pkgs.callPackage ./mypkg.nix {
In the first example, <varname>pkgs.foo</varname> is the result of a function call with some default arguments, usually a derivation. Using <varname>pkgs.foo.override</varname> will call the same function with the given new arguments. In the first example, <varname>pkgs.foo</varname> is the result of a function call with some default arguments, usually a derivation. Using <varname>pkgs.foo.override</varname> will call the same function with the given new arguments.
</para> </para>
</section> </section>
<section xml:id="sec-pkg-overrideAttrs"> <section xml:id="sec-pkg-overrideAttrs">
<title>&lt;pkg&gt;.overrideAttrs</title> <title>&lt;pkg&gt;.overrideAttrs</title>
@ -76,7 +72,6 @@ helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec {
</para> </para>
</note> </note>
</section> </section>
<section xml:id="sec-pkg-overrideDerivation"> <section xml:id="sec-pkg-overrideDerivation">
<title>&lt;pkg&gt;.overrideDerivation</title> <title>&lt;pkg&gt;.overrideDerivation</title>
@ -124,7 +119,6 @@ mySed = pkgs.gnused.overrideDerivation (oldAttrs: {
</para> </para>
</note> </note>
</section> </section>
<section xml:id="sec-lib-makeOverridable"> <section xml:id="sec-lib-makeOverridable">
<title>lib.makeOverridable</title> <title>lib.makeOverridable</title>
@ -148,4 +142,4 @@ c = lib.makeOverridable f { a = 1; b = 2; };
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. 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.
</para> </para>
</section> </section>
</section> </chapter>

View File

@ -66,22 +66,31 @@ rec {
*/ */
makeOverridable = f: origArgs: makeOverridable = f: origArgs:
let let
ff = f origArgs; result = f origArgs;
# Creates a functor with the same arguments as f
copyArgs = g: lib.setFunctionArgs g (lib.functionArgs f);
# Changes the original arguments with (potentially a function that returns) a set of new attributes
overrideWith = newArgs: origArgs // (if lib.isFunction newArgs then newArgs origArgs else newArgs); overrideWith = newArgs: origArgs // (if lib.isFunction newArgs then newArgs origArgs else newArgs);
# Re-call the function but with different arguments
overrideArgs = copyArgs (newArgs: makeOverridable f (overrideWith newArgs));
# Change the result of the function call by applying g to it
overrideResult = g: makeOverridable (copyArgs (args: g (f args))) origArgs;
in in
if builtins.isAttrs ff then (ff // { if builtins.isAttrs result then
override = newArgs: makeOverridable f (overrideWith newArgs); result // {
overrideDerivation = fdrv: override = overrideArgs;
makeOverridable (args: overrideDerivation (f args) fdrv) origArgs; overrideDerivation = fdrv: overrideResult (x: overrideDerivation x fdrv);
${if ff ? overrideAttrs then "overrideAttrs" else null} = fdrv: ${if result ? overrideAttrs then "overrideAttrs" else null} = fdrv:
makeOverridable (args: (f args).overrideAttrs fdrv) origArgs; overrideResult (x: x.overrideAttrs fdrv);
}) }
else if lib.isFunction ff then { else if lib.isFunction result then
override = newArgs: makeOverridable f (overrideWith newArgs); # Transform the result into a functor while propagating its arguments
__functor = self: ff; lib.setFunctionArgs result (lib.functionArgs result) // {
overrideDerivation = throw "overrideDerivation not yet supported for functors"; override = overrideArgs;
} }
else ff; else result;
/* Call the package function in the file `fn' with the required /* Call the package function in the file `fn' with the required

View File

@ -57,8 +57,8 @@ let
hasAttr head isAttrs isBool isInt isList isString length hasAttr head isAttrs isBool isInt isList isString length
lessThan listToAttrs pathExists readFile replaceStrings seq lessThan listToAttrs pathExists readFile replaceStrings seq
stringLength sub substring tail; stringLength sub substring tail;
inherit (trivial) id const concat or and bitAnd bitOr bitXor bitNot inherit (trivial) id const pipe concat or and bitAnd bitOr bitXor
boolToString mergeAttrs flip mapNullable inNixShell min max bitNot boolToString mergeAttrs flip mapNullable inNixShell min max
importJSON warn info showWarnings nixpkgsVersion version mod compare importJSON warn info showWarnings nixpkgsVersion version mod compare
splitByAndCompare functionArgs setFunctionArgs isFunction; splitByAndCompare functionArgs setFunctionArgs isFunction;
inherit (fixedPoints) fix fix' converge extends composeExtensions inherit (fixedPoints) fix fix' converge extends composeExtensions
@ -84,7 +84,8 @@ let
hasInfix hasPrefix hasSuffix stringToCharacters stringAsChars escape hasInfix hasPrefix hasSuffix stringToCharacters stringAsChars escape
escapeShellArg escapeShellArgs replaceChars lowerChars escapeShellArg escapeShellArgs replaceChars lowerChars
upperChars toLower toUpper addContextFrom splitString upperChars toLower toUpper addContextFrom splitString
removePrefix removeSuffix versionOlder versionAtLeast getVersion removePrefix removeSuffix versionOlder versionAtLeast
getName getVersion
nameFromURL enableFeature enableFeatureAs withFeature nameFromURL enableFeature enableFeatureAs withFeature
withFeatureAs fixedWidthString fixedWidthNumber isStorePath withFeatureAs fixedWidthString fixedWidthNumber isStorePath
toInt readPathsFromFile fileContents; toInt readPathsFromFile fileContents;

View File

@ -326,6 +326,8 @@ rec {
# The value with a check that it is defined # The value with a check that it is defined
valueDefined = if res.isDefined then res.mergedValue else valueDefined = if res.isDefined then res.mergedValue else
# (nixos-option detects this specific error message and gives it special
# handling. If changed here, please change it there too.)
throw "The option `${showOption loc}' is used but not defined."; throw "The option `${showOption loc}' is used but not defined.";
# Apply the 'apply' function to the merged value. This allows options to # Apply the 'apply' function to the merged value. This allows options to

View File

@ -472,6 +472,23 @@ rec {
*/ */
versionAtLeast = v1: v2: !versionOlder v1 v2; versionAtLeast = v1: v2: !versionOlder v1 v2;
/* This function takes an argument that's either a derivation or a
derivation's "name" attribute and extracts the name part from that
argument.
Example:
getName "youtube-dl-2016.01.01"
=> "youtube-dl"
getName pkgs.youtube-dl
=> "youtube-dl"
*/
getName = x:
let
parse = drv: (builtins.parseDrvName drv).name;
in if isString x
then parse x
else x.pname or (parse x.name);
/* This function takes an argument that's either a derivation or a /* This function takes an argument that's either a derivation or a
derivation's "name" attribute and extracts the version part from that derivation's "name" attribute and extracts the version part from that
argument. argument.

View File

@ -37,6 +37,7 @@ rec {
else if final.isAndroid then "bionic" else if final.isAndroid then "bionic"
else if final.isLinux /* default */ then "glibc" else if final.isLinux /* default */ then "glibc"
else if final.isMsp430 then "newlib" else if final.isMsp430 then "newlib"
else if final.isVc4 then "newlib"
else if final.isAvr then "avrlibc" else if final.isAvr then "avrlibc"
else if final.isNetBSD then "nblibc" else if final.isNetBSD then "nblibc"
# TODO(@Ericson2314) think more about other operating systems # TODO(@Ericson2314) think more about other operating systems
@ -79,6 +80,7 @@ rec {
else if final.isAarch64 then "arm64" else if final.isAarch64 then "arm64"
else if final.isx86_32 then "x86" else if final.isx86_32 then "x86"
else if final.isx86_64 then "ia64" else if final.isx86_64 then "ia64"
else if final.isMips then "mips"
else final.parsed.cpu.name; else final.parsed.cpu.name;
qemuArch = qemuArch =

View File

@ -26,7 +26,7 @@ let
"riscv32-linux" "riscv64-linux" "riscv32-linux" "riscv64-linux"
"aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" "riscv64-none" "riscv32-none" "aarch64-none" "avr-none" "arm-none" "i686-none" "x86_64-none" "powerpc-none" "msp430-none" "riscv64-none" "riscv32-none" "vc4-none"
]; ];
allParsed = map parse.mkSystemFromString all; allParsed = map parse.mkSystemFromString all;
@ -45,6 +45,7 @@ in {
x86_64 = filterDoubles predicates.isx86_64; x86_64 = filterDoubles predicates.isx86_64;
mips = filterDoubles predicates.isMips; mips = filterDoubles predicates.isMips;
riscv = filterDoubles predicates.isRiscV; riscv = filterDoubles predicates.isRiscV;
vc4 = filterDoubles predicates.isVc4;
cygwin = filterDoubles predicates.isCygwin; cygwin = filterDoubles predicates.isCygwin;
darwin = filterDoubles predicates.isDarwin; darwin = filterDoubles predicates.isDarwin;

View File

@ -118,6 +118,12 @@ rec {
config = "avr"; config = "avr";
}; };
vc4 = {
config = "vc4-elf";
libc = "newlib";
platform = {};
};
arm-embedded = { arm-embedded = {
config = "arm-none-eabi"; config = "arm-none-eabi";
libc = "newlib"; libc = "newlib";
@ -207,7 +213,7 @@ rec {
# 32 bit mingw-w64 # 32 bit mingw-w64
mingw32 = { mingw32 = {
config = "i686-pc-mingw32"; config = "i686-w64-mingw32";
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {}; platform = {};
}; };
@ -215,7 +221,7 @@ rec {
# 64 bit mingw-w64 # 64 bit mingw-w64
mingwW64 = { mingwW64 = {
# That's the triplet they use in the mingw-w64 docs. # That's the triplet they use in the mingw-w64 docs.
config = "x86_64-pc-mingw32"; config = "x86_64-w64-mingw32";
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {}; platform = {};
}; };

View File

@ -21,6 +21,7 @@ rec {
isSparc = { cpu = { family = "sparc"; }; }; isSparc = { cpu = { family = "sparc"; }; };
isWasm = { cpu = { family = "wasm"; }; }; isWasm = { cpu = { family = "wasm"; }; };
isMsp430 = { cpu = { family = "msp430"; }; }; isMsp430 = { cpu = { family = "msp430"; }; };
isVc4 = { cpu = { family = "vc4"; }; };
isAvr = { cpu = { family = "avr"; }; }; isAvr = { cpu = { family = "avr"; }; };
isAlpha = { cpu = { family = "alpha"; }; }; isAlpha = { cpu = { family = "alpha"; }; };
isJavaScript = { cpu = cpuTypes.js; }; isJavaScript = { cpu = cpuTypes.js; };

View File

@ -112,6 +112,8 @@ rec {
msp430 = { bits = 16; significantByte = littleEndian; family = "msp430"; }; msp430 = { bits = 16; significantByte = littleEndian; family = "msp430"; };
avr = { bits = 8; family = "avr"; }; avr = { bits = 8; family = "avr"; };
vc4 = { bits = 32; significantByte = littleEndian; family = "vc4"; };
js = { bits = 32; significantByte = littleEndian; family = "js"; }; js = { bits = 32; significantByte = littleEndian; family = "js"; };
}; };
@ -208,6 +210,9 @@ rec {
vendors = setTypes types.openVendor { vendors = setTypes types.openVendor {
apple = {}; apple = {};
pc = {}; pc = {};
# Actually matters, unlocking some MinGW-w64-specific options in GCC. See
# bottom of https://sourceforge.net/p/mingw-w64/wiki2/Unicode%20apps/
w64 = {};
none = {}; none = {};
unknown = {}; unknown = {};
@ -327,6 +332,7 @@ rec {
} }
]; ];
}; };
gnuabi64 = { abi = "64"; };
musleabi = { float = "soft"; }; musleabi = { float = "soft"; };
musleabihf = { float = "hard"; }; musleabihf = { float = "hard"; };

View File

@ -18,6 +18,31 @@ runTests {
expected = 2; expected = 2;
}; };
testPipe = {
expr = pipe 2 [
(x: x + 2) # 2 + 2 = 4
(x: x * 2) # 4 * 2 = 8
];
expected = 8;
};
testPipeEmpty = {
expr = pipe 2 [];
expected = 2;
};
testPipeStrings = {
expr = pipe [ 3 4 ] [
(map toString)
(map (s: s + "\n"))
concatStrings
];
expected = ''
3
4
'';
};
/* /*
testOr = { testOr = {
expr = or true false; expr = or true false;

View File

@ -29,6 +29,43 @@ rec {
# Value to ignore # Value to ignore
y: x; y: x;
/* Pipes a value through a list of functions, left to right.
Type: pipe :: a -> [<functions>] -> <return type of last function>
Example:
pipe 2 [
(x: x + 2) # 2 + 2 = 4
(x: x * 2) # 4 * 2 = 8
]
=> 8
# ideal to do text transformations
pipe [ "a/b" "a/c" ] [
# create the cp command
(map (file: ''cp "${src}/${file}" $out\n''))
# concatenate all commands into one string
lib.concatStrings
# make that string into a nix derivation
(pkgs.runCommand "copy-to-out" {})
]
=> <drv which copies all files to $out>
The output type of each function has to be the input type
of the next function, and the last function returns the
final value.
*/
pipe = val: functions:
let reverseApply = x: f: f x;
in builtins.foldl' reverseApply val functions;
/* note please dont add a function like `compose = flip pipe`.
This would confuse users, because the order of the functions
in the list is not clear. With pipe, its obvious that it
goes first-to-last. With `compose`, not so much.
*/
## Named versions corresponding to some builtin operators. ## Named versions corresponding to some builtin operators.

View File

@ -137,6 +137,11 @@
githubId = 2321000; githubId = 2321000;
name = "Ruslan Babayev"; name = "Ruslan Babayev";
}; };
acairncross = {
email = "acairncross@gmail.com";
github = "acairncross";
name = "Aiken Cairncross";
};
acowley = { acowley = {
email = "acowley@gmail.com"; email = "acowley@gmail.com";
github = "acowley"; github = "acowley";
@ -184,6 +189,12 @@
githubId = 1250775; githubId = 1250775;
name = "Adolfo E. García Castro"; name = "Adolfo E. García Castro";
}; };
adsr = {
email = "as@php.net";
github = "adsr";
githubId = 315003;
name = "Adam Saponara";
};
aepsil0n = { aepsil0n = {
email = "eduard.bopp@aepsil0n.de"; email = "eduard.bopp@aepsil0n.de";
github = "aepsil0n"; github = "aepsil0n";
@ -546,12 +557,24 @@
githubId = 56009; githubId = 56009;
name = "Arcadio Rubio García"; name = "Arcadio Rubio García";
}; };
arcnmx = {
email = "arcnmx@users.noreply.github.com";
github = "arcnmx";
githubId = 13426784;
name = "arcnmx";
};
ardumont = { ardumont = {
email = "eniotna.t@gmail.com"; email = "eniotna.t@gmail.com";
github = "ardumont"; github = "ardumont";
githubId = 718812; githubId = 718812;
name = "Antoine R. Dumont"; name = "Antoine R. Dumont";
}; };
arianvp = {
email = "arian.vanputten@gmail.com";
github = "arianvp";
githubId = 628387;
name = "Arian van Putten";
};
aristid = { aristid = {
email = "aristidb@gmail.com"; email = "aristidb@gmail.com";
github = "aristidb"; github = "aristidb";
@ -580,6 +603,12 @@
fingerprint = "3D2B B230 F9FA F0C5 1832 46DD 4FDC 96F1 61E7 BA8A"; fingerprint = "3D2B B230 F9FA F0C5 1832 46DD 4FDC 96F1 61E7 BA8A";
}]; }];
}; };
arthur = {
email = "me@arthur.li";
github = "arthurl";
githubId = 3965744;
name = "Arthur Lee";
};
artuuge = { artuuge = {
email = "artuuge@gmail.com"; email = "artuuge@gmail.com";
github = "artuuge"; github = "artuuge";
@ -702,6 +731,16 @@
githubId = 135230; githubId = 135230;
name = "Aycan iRiCAN"; name = "Aycan iRiCAN";
}; };
b4dm4n = {
email = "fabianm88@gmail.com";
github = "B4dM4n";
githubId = 448169;
name = "Fabian Möller";
keys = [{
longkeyid = "rsa4096/0x754B5C0963C42C5";
fingerprint = "6309 E212 29D4 DA30 AF24 BDED 754B 5C09 63C4 2C50";
}];
};
babariviere = { babariviere = {
email = "babathriviere@gmail.com"; email = "babathriviere@gmail.com";
github = "babariviere"; github = "babariviere";
@ -905,6 +944,12 @@
githubId = 5718007; githubId = 5718007;
name = "Bastian Köcher"; name = "Bastian Köcher";
}; };
blitz = {
email = "js@alien8.de";
github = "blitz";
githubId = 37907;
name = "Julian Stecklina";
};
bluescreen303 = { bluescreen303 = {
email = "mathijs@bluescreen303.nl"; email = "mathijs@bluescreen303.nl";
github = "bluescreen303"; github = "bluescreen303";
@ -1125,6 +1170,12 @@
githubId = 5771456; githubId = 5771456;
name = "Chaddaï Fouché"; name = "Chaddaï Fouché";
}; };
cfsmp3 = {
email = "carlos@sanz.dev";
github = "cfsmp3";
githubId = 5949913;
name = "Carlos Fernandez Sanz";
};
chaduffy = { chaduffy = {
email = "charles@dyfis.net"; email = "charles@dyfis.net";
github = "charles-dyfis-net"; github = "charles-dyfis-net";
@ -1171,6 +1222,12 @@
githubId = 30435868; githubId = 30435868;
name = "Okina Matara"; name = "Okina Matara";
}; };
chkno = {
email = "chuck@intelligence.org";
github = "chkno";
githubId = 1118859;
name = "Scott Worley";
};
choochootrain = { choochootrain = {
email = "hurshal@imap.cc"; email = "hurshal@imap.cc";
github = "choochootrain"; github = "choochootrain";
@ -1348,6 +1405,12 @@
githubId = 1740337; githubId = 1740337;
name = "Chris Ostrouchov"; name = "Chris Ostrouchov";
}; };
contrun = {
email = "uuuuuu@protonmail.com";
github = "contrun";
githubId = 32609395;
name = "B YI";
};
couchemar = { couchemar = {
email = "couchemar@yandex.ru"; email = "couchemar@yandex.ru";
github = "couchemar"; github = "couchemar";
@ -1360,6 +1423,12 @@
githubId = 411324; githubId = 411324;
name = "Carles Pagès"; name = "Carles Pagès";
}; };
craigem = {
email = "craige@mcwhirter.io";
github = "craigem";
githubId = "6470493";
name = "Craige McWhirter";
};
cransom = { cransom = {
email = "cransom@hubns.net"; email = "cransom@hubns.net";
github = "cransom"; github = "cransom";
@ -1415,6 +1484,26 @@
} }
]; ];
}; };
d-goldin = {
email = "dgoldin+github@protonmail.ch";
github = "d-goldin";
githubId = 43349662;
name = "Dima";
keys = [{
longkeyid = "rsa4096/BAB1D15FB7B4D4CE";
fingerprint = "1C4E F4FE 7F8E D8B7 1E88 CCDF BAB1 D15F B7B4 D4CE";
}];
};
dadada = {
name = "dadada";
email = "dadada@dadada.li";
github = "dadada";
githubId = 7216772;
keys = [{
longkeyid = "ed25519/0xEEB8D1CE62C4DFEA";
fingerprint = "D68C 8469 5C08 7E0F 733A 28D0 EEB8 D1CE 62C4 DFEA";
}];
};
dalance = { dalance = {
email = "dalance@gmail.com"; email = "dalance@gmail.com";
github = "dalance"; github = "dalance";
@ -1439,6 +1528,12 @@
githubId = 245394; githubId = 245394;
name = "Hannu Hartikainen"; name = "Hannu Hartikainen";
}; };
danderson = {
email = "dave@natulte.net";
github = "danderson";
githubId = 1918;
name = "David Anderson";
};
danharaj = { danharaj = {
email = "dan@obsidian.systems"; email = "dan@obsidian.systems";
github = "danharaj"; github = "danharaj";
@ -1524,6 +1619,12 @@
githubId = 14032; githubId = 14032;
name = "Daniel Brockman"; name = "Daniel Brockman";
}; };
dduan = {
email = "daniel@duan.ca";
github = "dduan";
githubId = 75067;
name = "Daniel Duan";
};
deepfire = { deepfire = {
email = "_deepfire@feelingofgreen.ru"; email = "_deepfire@feelingofgreen.ru";
github = "deepfire"; github = "deepfire";
@ -1689,6 +1790,12 @@
githubId = 875324; githubId = 875324;
name = "David Johnson"; name = "David Johnson";
}; };
dmrauh = {
email = "dmrauh@posteo.de";
github = "dmrauh";
githubId = 37698547;
name = "Dominik Michael Rauh";
};
dmvianna = { dmvianna = {
email = "dmlvianna@gmail.com"; email = "dmlvianna@gmail.com";
github = "dmvianna"; github = "dmvianna";
@ -1725,7 +1832,7 @@
name = "Chris Double"; name = "Chris Double";
}; };
dpaetzel = { dpaetzel = {
email = "david.a.paetzel@gmail.com"; email = "david.paetzel@posteo.de";
github = "dpaetzel"; github = "dpaetzel";
githubId = 974130; githubId = 974130;
name = "David Pätzel"; name = "David Pätzel";
@ -1903,7 +2010,9 @@
name = "Eric Hegnes"; name = "Eric Hegnes";
}; };
ehmry = { ehmry = {
email = "emery@vfemail.net"; email = "ehmry@posteo.net";
github= "ehmry";
githubId = 537775;
name = "Emery Hemingway"; name = "Emery Hemingway";
}; };
eikek = { eikek = {
@ -1989,6 +2098,12 @@
github = "ericnorris"; github = "ericnorris";
githubId = 1906605; githubId = 1906605;
}; };
Enteee = {
email = "nix@duckpond.ch";
github = "Enteee";
githubid = 5493775;
name = "Ente";
};
enzime = { enzime = {
email = "enzime@users.noreply.github.com"; email = "enzime@users.noreply.github.com";
github = "enzime"; github = "enzime";
@ -2005,6 +2120,12 @@
email = "mpcervin@uncg.edu"; email = "mpcervin@uncg.edu";
name = "Mabry Cervin"; name = "Mabry Cervin";
}; };
equirosa = {
email = "eduardo@eduardoquiros.com";
github = "equirosa";
githubId = 39096810;
name = "Eduardo Quiros";
};
eqyiel = { eqyiel = {
email = "ruben@maher.fyi"; email = "ruben@maher.fyi";
github = "eqyiel"; github = "eqyiel";
@ -2061,6 +2182,12 @@
githubId = 1583484; githubId = 1583484;
name = "Andrey Golovizin"; name = "Andrey Golovizin";
}; };
ersin = {
email = "me@ersinakinci.com";
github = "earksiinni";
githubId = 5427394;
name = "Ersin Akinci";
};
ertes = { ertes = {
email = "esz@posteo.de"; email = "esz@posteo.de";
github = "ertes"; github = "ertes";
@ -2146,12 +2273,6 @@
githubId = 2817965; githubId = 2817965;
name = "f--t"; name = "f--t";
}; };
fleaz = {
email = "mail@felixbreidenstein.de";
github = "fleaz";
githubId = 2489598;
name = "Felix Breidenstein";
};
fadenb = { fadenb = {
email = "tristan.helmich+nixos@gmail.com"; email = "tristan.helmich+nixos@gmail.com";
github = "fadenb"; github = "fadenb";
@ -2192,12 +2313,32 @@
githubId = 8182846; githubId = 8182846;
name = "Francesco Gazzetta"; name = "Francesco Gazzetta";
}; };
filalex77 = {
email = "brightone@protonmail.com";
github = "filalex77";
githubId = 12615679;
name = "Oleksii Filonenko";
keys = [{
longkeyid = "rsa3072/0xA1BC8428323ECFE8";
fingerprint = "F549 3B7F 9372 5578 FDD3 D0B8 A1BC 8428 323E CFE8";
}];
};
FireyFly = { FireyFly = {
email = "nix@firefly.nu"; email = "nix@firefly.nu";
github = "FireyFly"; github = "FireyFly";
githubId = 415760; githubId = 415760;
name = "Jonas Höglund"; name = "Jonas Höglund";
}; };
Flakebi = {
email = "flakebi@t-online.de";
github = "Flakebi";
githubId = "Flakebi";
name = "Sebastian Neubauer";
keys = [{
longkeyid = "rsa4096/0xECC755EE583C1672";
fingerprint = "2F93 661D AC17 EA98 A104 F780 ECC7 55EE 583C 1672";
}];
};
flexw = { flexw = {
email = "felix.weilbach@t-online.de"; email = "felix.weilbach@t-online.de";
github = "FlexW"; github = "FlexW";
@ -2282,7 +2423,7 @@
name = "Frede Emil"; name = "Frede Emil";
}; };
freepotion = { freepotion = {
email = "free.potion@yandex.ru"; email = "42352817+freepotion@users.noreply.github.com";
github = "freepotion"; github = "freepotion";
githubId = 42352817; githubId = 42352817;
name = "Free Potion"; name = "Free Potion";
@ -2393,6 +2534,12 @@
github = "gavinrogers"; github = "gavinrogers";
name = "Gavin Rogers"; name = "Gavin Rogers";
}; };
gazally = {
email = "gazally@runbox.com";
github = "gazally";
githubId = 16470252;
name = "Gemini Lasswell";
};
gebner = { gebner = {
email = "gebner@gebner.org"; email = "gebner@gebner.org";
github = "gebner"; github = "gebner";
@ -2535,6 +2682,12 @@
githubId = 9705357; githubId = 9705357;
name = "Guillaume Bouchard"; name = "Guillaume Bouchard";
}; };
GuillaumeDesforges = {
email = "aceus02@gmail.com";
github = "GuillaumeDesforges";
githubId = 1882000;
name = "Guillaume Desforges";
};
guillaumekoenig = { guillaumekoenig = {
email = "guillaume.edward.koenig@gmail.com"; email = "guillaume.edward.koenig@gmail.com";
github = "guillaumekoenig"; github = "guillaumekoenig";
@ -2637,6 +2790,11 @@
githubId = 1401179; githubId = 1401179;
name = "Guanpeng Xu"; name = "Guanpeng Xu";
}; };
hexa = {
github = "mweinelt";
githubId = 131599;
name = "Martin Weinelt";
};
hhm = { hhm = {
email = "heehooman+nixpkgs@gmail.com"; email = "heehooman+nixpkgs@gmail.com";
github = "hhm0"; github = "hhm0";
@ -2793,6 +2951,15 @@
githubId = 137306; githubId = 137306;
name = "Michele Catalano"; name = "Michele Catalano";
}; };
isgy = {
email = "isgy@teiyg.com";
github = "isgy";
githubId = 13622947;
keys = [{
longkeyid = "rsa4096/0xD3E1B013B4631293";
fingerprint = "1412 816B A9FA F62F D051 1975 D3E1 B013 B463 1293";
}];
};
ivan = { ivan = {
email = "ivan@ludios.org"; email = "ivan@ludios.org";
github = "ivan"; github = "ivan";
@ -3047,6 +3214,11 @@
githubId = 184898; githubId = 184898;
name = "Jirka Marsik"; name = "Jirka Marsik";
}; };
jitwit = {
email = "jrn@bluefarm.ca";
github = "jitwit";
name = "jitwit";
};
jlesquembre = { jlesquembre = {
email = "jl@lafuente.me"; email = "jl@lafuente.me";
github = "jlesquembre"; github = "jlesquembre";
@ -3059,6 +3231,12 @@
githubId = 2195834; githubId = 2195834;
name = "Jaakko Luttinen"; name = "Jaakko Luttinen";
}; };
jm2dev = {
email = "jomarcar@gmail.com";
github = "jm2dev";
githubId = 474643;
name = "José Miguel Martínez Carrasco";
};
jmagnusj = { jmagnusj = {
email = "jmagnusj@gmail.com"; email = "jmagnusj@gmail.com";
github = "magnusjonsson"; github = "magnusjonsson";
@ -3259,6 +3437,12 @@
github = "juliendehos"; github = "juliendehos";
name = "Julien Dehos"; name = "Julien Dehos";
}; };
jumper149 = {
email = "felixspringer149@gmail.com";
github = "jumper149";
githubId = 39434424;
name = "Felix Springer";
};
justinwoo = { justinwoo = {
email = "moomoowoo@gmail.com"; email = "moomoowoo@gmail.com";
github = "justinwoo"; github = "justinwoo";
@ -3271,6 +3455,12 @@
githubId = 8460; githubId = 8460;
name = "John Wiegley"; name = "John Wiegley";
}; };
jwijenbergh = {
email = "jeroenwijenbergh@protonmail.com";
github = "jwijenbergh";
githubId = 46386452;
name = "Jeroen Wijenbergh";
};
jwilberding = { jwilberding = {
email = "jwilberding@afiniate.com"; email = "jwilberding@afiniate.com";
name = "Jordan Wilberding"; name = "Jordan Wilberding";
@ -3313,6 +3503,12 @@
email = "info+nix@chmist.com"; email = "info+nix@chmist.com";
name = "karolchmist"; name = "karolchmist";
}; };
kayhide = {
email = "kayhide@gmail.com";
github = "kayhide";
githubId = 1730718;
name = "Hideaki Kawai";
};
kazcw = { kazcw = {
email = "kaz@lambdaverse.org"; email = "kaz@lambdaverse.org";
github = "kazcw"; github = "kazcw";
@ -3427,6 +3623,12 @@
github = "klntsky"; github = "klntsky";
githubId = 18447310; githubId = 18447310;
}; };
kmcopper = {
email = "kmcopper@danwin1210.me";
name = "Kyle Copperfield";
github = "kmcopper";
githubId = 57132115;
};
kmeakin = { kmeakin = {
email = "karlwfmeakin@gmail.com"; email = "karlwfmeakin@gmail.com";
name = "Karl Meakin"; name = "Karl Meakin";
@ -3533,6 +3735,18 @@
githubId = 449813; githubId = 449813;
name = "Roman Kuznetsov"; name = "Roman Kuznetsov";
}; };
kylesferrazza = {
name = "Kyle Sferrazza";
email = "kyle.sferrazza@gmail.com";
github = "kylesferrazza";
githubId = 6677292;
keys = [{
longkeyid = "rsa4096/81A1540948162372";
fingerprint = "5A9A 1C9B 2369 8049 3B48 CF5B 81A1 5409 4816 2372";
}];
};
kylewlacy = { kylewlacy = {
email = "kylelacy+nix@pm.me"; email = "kylelacy+nix@pm.me";
github = "kylewlacy"; github = "kylewlacy";
@ -3783,6 +3997,22 @@
github = "lovek323"; github = "lovek323";
name = "Jason O'Conal"; name = "Jason O'Conal";
}; };
lovesegfault = {
email = "meurerbernardo@gmail.com";
github = "lovesegfault";
githubId = 7243783;
name = "Bernardo Meurer";
keys = [
{
longkeyid = "rsa2048/0xE421C74191EA186C";
fingerprint = "5894 12CE 19DF 582A E10A 3320 E421 C741 91EA 186C";
}
{
longkeyid = "rsa2048/0x4A6D87A0E7475769";
fingerprint = "56A8 E164 E834 290C 4AC0 EE3E 4A6D 87A0 E747 5769";
}
];
};
lowfatcomputing = { lowfatcomputing = {
email = "andreas.wagner@lowfatcomputing.org"; email = "andreas.wagner@lowfatcomputing.org";
github = "lowfatcomputing"; github = "lowfatcomputing";
@ -3854,6 +4084,11 @@
githubId = 13791; githubId = 13791;
name = "Luke Gorrie"; name = "Luke Gorrie";
}; };
lumi = {
email = "lumi@pew.im";
github = "lumi-me-not";
name = "lumi";
};
luz = { luz = {
email = "luz666@daum.net"; email = "luz666@daum.net";
github = "Luz"; github = "Luz";
@ -3939,6 +4174,12 @@
github = "marcweber"; github = "marcweber";
githubId = 34086; githubId = 34086;
name = "Marc Weber"; name = "Marc Weber";
};
marcus7070 = {
email = "marcus@geosol.com.au";
github = "marcus7070";
githubId = 50230945;
name = "Marcus Boyd";
}; };
marenz = { marenz = {
email = "marenz@arkom.men"; email = "marenz@arkom.men";
@ -4025,6 +4266,12 @@
githubId = 427866; githubId = 427866;
name = "Matthias Beyer"; name = "Matthias Beyer";
}; };
matthuszagh = {
email = "huszaghmatt@gmail.com";
github = "matthuszagh";
githubId = 7377393;
name = "Matt Huszagh";
};
matti-kariluoma = { matti-kariluoma = {
email = "matti@kariluo.ma"; email = "matti@kariluo.ma";
github = "matti-kariluoma"; github = "matti-kariluoma";
@ -4272,6 +4519,12 @@
githubId = 16974598; githubId = 16974598;
name = "Mike Playle"; name = "Mike Playle";
}; };
mkaito = {
email = "chris@mkaito.net";
github = "mkaito";
githubId = 20434;
name = "Christian Höppner";
};
mkazulak = { mkazulak = {
email = "kazulakm@gmail.com"; email = "kazulakm@gmail.com";
github = "mulderr"; github = "mulderr";
@ -4293,6 +4546,16 @@
githubId = 22477669; githubId = 22477669;
name = "Mark K Gardner"; name = "Mark K Gardner";
}; };
mkg20001 = {
email = "mkg20001+nix@gmail.com";
github = "mkg20001";
githubId = 7735145;
name = "Maciej Krüger";
keys = [{
longkeyid = "rsa4096/0x0D948CE19CF49C5F";
fingerprint = "E90C BA34 55B3 6236 740C 038F 0D94 8CE1 9CF4 9C5F";
}];
};
mlieberman85 = { mlieberman85 = {
email = "mlieberman85@gmail.com"; email = "mlieberman85@gmail.com";
github = "mlieberman85"; github = "mlieberman85";
@ -4305,6 +4568,18 @@
githubId = 104795; githubId = 104795;
name = "Marek Mahut"; name = "Marek Mahut";
}; };
mmai = {
email = "henri.bourcereau@gmail.com";
github = "mmai";
githubId = 117842;
name = "Henri Bourcereau";
};
mmilata = {
email = "martin@martinmilata.cz";
github = "mmilata";
gitHubId = 85857;
name = "Martin Milata";
};
mmlb = { mmlb = {
email = "me.mmlb@mmlb.me"; email = "me.mmlb@mmlb.me";
github = "mmlb"; github = "mmlb";
@ -4362,6 +4637,10 @@
github = "moredread"; github = "moredread";
githubId = 100848; githubId = 100848;
name = "André-Patrick Bubel"; name = "André-Patrick Bubel";
keys = [{
longkeyid = "rsa8192/0x118CE7C424B45728";
fingerprint = "4412 38AD CAD3 228D 876C 5455 118C E7C4 24B4 5728";
}];
}; };
moretea = { moretea = {
email = "maarten@moretea.nl"; email = "maarten@moretea.nl";
@ -4415,6 +4694,12 @@
githubId = 2881922; githubId = 2881922;
name = "Francis St-Amour"; name = "Francis St-Amour";
}; };
mtrsk = {
email = "marcos.schonfinkel@protonmail.com";
github = "mtrsk";
githubId = 16356569;
name = "Marcos Benevides";
};
mredaelli = { mredaelli = {
email = "massimo@typish.io"; email = "massimo@typish.io";
github = "mredaelli"; github = "mredaelli";
@ -4452,6 +4737,12 @@
githubId = 437005; githubId = 437005;
name = "Mikkel Christiansen"; name = "Mikkel Christiansen";
}; };
mschuwalow = {
github = "mschuwalow";
githubId = 16665913;
name = "Maxim Schuwalow";
email = "maxim.schuwalow@gmail.com";
};
msiedlarek = { msiedlarek = {
email = "mikolaj@siedlarek.pl"; email = "mikolaj@siedlarek.pl";
github = "msiedlarek"; github = "msiedlarek";
@ -5043,6 +5334,16 @@
githubId = 1179566; githubId = 1179566;
name = "Nicolas B. Pierron"; name = "Nicolas B. Pierron";
}; };
pingiun = {
email = "nixos@pingiun.com";
github = "pingiun";
githubId = 1576660;
name = "Jelle Besseling";
keys = [{
longkeyid = "rsa4096/0x9712452E8BE3372E";
fingerprint = "A3A3 65AE 16ED A7A0 C29C 88F1 9712 452E 8BE3 372E";
}];
};
piotr = { piotr = {
email = "ppietrasa@gmail.com"; email = "ppietrasa@gmail.com";
name = "Piotr Pietraszkiewicz"; name = "Piotr Pietraszkiewicz";
@ -5848,6 +6149,16 @@
githubId = 307899; githubId = 307899;
name = "Gurkan Gur"; name = "Gurkan Gur";
}; };
servalcatty = {
email = "servalcat@pm.me";
github = "servalcatty";
githubid = 51969817;
name = "Serval";
keys = [{
longkeyid = "rsa4096/0x4A2AAAA382F8294C";
fingerprint = "A317 37B3 693C 921B 480C C629 4A2A AAA3 82F8 294C";
}];
};
sfrijters = { sfrijters = {
email = "sfrijters@gmail.com"; email = "sfrijters@gmail.com";
github = "sfrijters"; github = "sfrijters";
@ -5873,7 +6184,7 @@
name = "Shahrukh Khan"; name = "Shahrukh Khan";
}; };
shanemikel = { shanemikel = {
email = "shanemikel1@gmail.com"; email = "shanepearlman@pm.me";
github = "shanemikel"; github = "shanemikel";
githubId = 6720672; githubId = 6720672;
name = "Shane Pearlman"; name = "Shane Pearlman";
@ -6266,6 +6577,12 @@
githubId = 120188; githubId = 120188;
name = "Scott W. Dunlop"; name = "Scott W. Dunlop";
}; };
sweber = {
email = "sweber2342+nixpkgs@gmail.com";
github = "sweber83";
githubId = 19905904;
name = "Simon Weber";
};
swflint = { swflint = {
email = "swflint@flintfam.org"; email = "swflint@flintfam.org";
github = "swflint"; github = "swflint";
@ -6383,6 +6700,12 @@
githubId = 506181; githubId = 506181;
name = "Peter Marheine"; name = "Peter Marheine";
}; };
tasmo = {
email = "tasmo@tasmo.de";
github = "tasmo";
githubId = 102685;
name = "Thomas Friese";
};
tavyc = { tavyc = {
email = "octavian.cerna@gmail.com"; email = "octavian.cerna@gmail.com";
github = "tavyc"; github = "tavyc";
@ -6482,6 +6805,12 @@
githubId = 42933; githubId = 42933;
name = "Andrew Childs"; name = "Andrew Childs";
}; };
thefenriswolf = {
email = "stefan.rohrbacher97@gmail.com";
github = "thefenriswolf";
githubId = "8547242";
name = "Stefan Rohrbacher";
};
thesola10 = { thesola10 = {
email = "thesola10@bobile.fr"; email = "thesola10@bobile.fr";
github = "thesola10"; github = "thesola10";
@ -6522,6 +6851,12 @@
githubId = 224674; githubId = 224674;
name = "Thomas Pham"; name = "Thomas Pham";
}; };
Thra11 = {
email = "tahall256@protonmail.ch";
github = "Thra11";
githubId = 1391883;
name = "Tom Hall";
};
tilpner = { tilpner = {
email = "till@hoeppner.ws"; email = "till@hoeppner.ws";
github = "tilpner"; github = "tilpner";
@ -6563,6 +6898,16 @@
githubId = 13026; githubId = 13026;
name = "Jonathan Rudenberg"; name = "Jonathan Rudenberg";
}; };
tkerber = {
email = "tk@drwx.org";
github = "tkerber";
githubId = 5722198;
name = "Thomas Kerber";
keys = [ {
longkeyid = "rsa4096/0x8489B911F9ED617B";
fingerprint = "556A 403F B0A2 D423 F656 3424 8489 B911 F9ED 617B";
} ];
};
tmplt = { tmplt = {
email = "tmplt@dragons.rocks"; email = "tmplt@dragons.rocks";
github = "tmplt"; github = "tmplt";
@ -6610,6 +6955,12 @@
githubId = 178444; githubId = 178444;
name = "Thomas Bereknyei"; name = "Thomas Bereknyei";
}; };
tomfitzhenry = {
email = "tom@tom-fitzhenry.me.uk";
github = "tomfitzhenry";
githubId = 61303;
name = "Tom Fitzhenry";
};
tomsmeets = { tomsmeets = {
email = "tom.tsmeets@gmail.com"; email = "tom.tsmeets@gmail.com";
github = "tomsmeets"; github = "tomsmeets";
@ -6640,6 +6991,12 @@
githubId = 1312290; githubId = 1312290;
name = "Trevor Joynson"; name = "Trevor Joynson";
}; };
tricktron = {
email = "tgagnaux@gmail.com";
github = "tricktron";
githubId = 16036882;
name = "Thibault Gagnaux";
};
trino = { trino = {
email = "muehlhans.hubert@ekodia.de"; email = "muehlhans.hubert@ekodia.de";
github = "hmuehlhans"; github = "hmuehlhans";
@ -6652,6 +7009,11 @@
githubId = 483735; githubId = 483735;
name = "Dmitry Geurkov"; name = "Dmitry Geurkov";
}; };
tscholak = {
email = "torsten.scholak@googlemail.com";
github = "tscholak";
name = "Torsten Scholak";
};
tstrobel = { tstrobel = {
email = "4ZKTUB6TEP74PYJOPWIR013S2AV29YUBW5F9ZH2F4D5UMJUJ6S@hash.domains"; email = "4ZKTUB6TEP74PYJOPWIR013S2AV29YUBW5F9ZH2F4D5UMJUJ6S@hash.domains";
name = "Thomas Strobel"; name = "Thomas Strobel";
@ -6968,6 +7330,12 @@
email = "kirill.wedens@gmail.com"; email = "kirill.wedens@gmail.com";
name = "wedens"; name = "wedens";
}; };
WhittlesJr = {
email = "alex.joseph.whitt@gmail.com";
github = "WhittlesJr";
githubId = 19174984;
name = "Alex Whitt";
};
willibutz = { willibutz = {
email = "willibutz@posteo.de"; email = "willibutz@posteo.de";
github = "willibutz"; github = "willibutz";
@ -7065,6 +7433,12 @@
githubId = 36407913; githubId = 36407913;
name = "Uli Baum"; name = "Uli Baum";
}; };
xfix = {
email = "konrad@borowski.pw";
github = "xfix";
githubId = 1297598;
name = "Konrad Borowski";
};
xnaveira = { xnaveira = {
email = "xnaveira@gmail.com"; email = "xnaveira@gmail.com";
github = "xnaveira"; github = "xnaveira";
@ -7177,14 +7551,24 @@
githubId = 1866448; githubId = 1866448;
name = "Eric Bailey"; name = "Eric Bailey";
}; };
Yumasi = {
email = "gpagnoux@gmail.com";
github = "Yumasi";
githubId = 24368641;
name = "Guillaume Pagnoux";
keys = [{
longkeyid = "rsa4096/0xEC5065899AEAAF4C";
fingerprint = "85F8 E850 F8F2 F823 F934 535B EC50 6589 9AEA AF4C";
}];
};
yvt = { yvt = {
email = "i@yvt.jp"; email = "i@yvt.jp";
github = "yvt"; github = "yvt";
githubId = 5253988; githubId = 5253988;
name = "yvt"; name = "yvt";
}; };
z77z = { maggesi = {
email = "maggesi@math.unifi.it"; email = "marco.maggesi@gmail.com";
github = "maggesi"; github = "maggesi";
githubId = 1809783; githubId = 1809783;
name = "Marco Maggesi"; name = "Marco Maggesi";
@ -7228,6 +7612,12 @@
email = "zef@zef.me"; email = "zef@zef.me";
name = "Zef Hemel"; name = "Zef Hemel";
}; };
zfnmxt = {
name = "zfnmxt";
email = "zfnmxt@zfnmxt.com";
github = "zfnmxt";
githubId = 37446532;
};
zgrannan = { zgrannan = {
email = "zgrannan@gmail.com"; email = "zgrannan@gmail.com";
github = "zgrannan"; github = "zgrannan";
@ -7300,4 +7690,28 @@
githubId = 1986844; githubId = 1986844;
name = "Daniel Wheeler"; name = "Daniel Wheeler";
}; };
zokrezyl = {
email = "zokrezyl@gmail.com";
github = "zokrezyl";
githubId = 51886259;
name = "Zokre Zyl";
};
rakesh4g = {
email = "rakeshgupta4u@gmail.com";
github = "rakesh4g";
githubId = 50867187;
name = "Rakesh Gupta";
};
mlatus = {
email = "wqseleven@gmail.com";
github = "Ninlives";
githubId = 17873203;
name = "mlatus";
};
waiting-for-dev = {
email = "marc@lamarciana.com";
github = "waiting-for-dev";
githubId = 52650;
name = "Marc Busqué";
};
} }

View File

@ -37,14 +37,17 @@ lua-zlib,,,,,koral
lua_cliargs,,,,, lua_cliargs,,,,,
luabitop,,,,, luabitop,,,,,
luacheck,,,,, luacheck,,,,,
luacov,,,,,
luadbi,,,,, luadbi,,,,,
luadbi-mysql,,,,, luadbi-mysql,,,,,
luadbi-postgresql,,,,, luadbi-postgresql,,,,,
luadbi-sqlite3,,,,, luadbi-sqlite3,,,,,
luadoc,,,,,
luaevent,,,,, luaevent,,,,,
luaexpat,,,1.3.0-1,,arobyn flosse luaexpat,,,1.3.0-1,,arobyn flosse
luaffi,,http://luarocks.org/dev,,, luaffi,,http://luarocks.org/dev,,,
luafilesystem,,,1.7.0-2,,flosse vcunat luafilesystem,,,1.7.0-2,,flosse vcunat
lualogging,,,,,
luaossl,,,,lua5_1,vcunat luaossl,,,,lua5_1,vcunat
luaposix,,,,,vyp lblasc luaposix,,,,,vyp lblasc
luasec,,,,,flosse luasec,,,,,flosse

1 # nix name luarocks name server version luaversion maintainers
37 lua_cliargs
38 luabitop
39 luacheck
40 luacov
41 luadbi
42 luadbi-mysql
43 luadbi-postgresql
44 luadbi-sqlite3
45 luadoc
46 luaevent
47 luaexpat 1.3.0-1 arobyn flosse
48 luaffi http://luarocks.org/dev
49 luafilesystem 1.7.0-2 flosse vcunat
50 lualogging
51 luaossl lua5_1 vcunat
52 luaposix vyp lblasc
53 luasec flosse

View File

@ -6,7 +6,7 @@ exec >${1:?usage: $0 <output-file>}
cat <<EOF cat <<EOF
{ branch ? "stable", pkgs }: { branch ? "stable", pkgs }:
# Generated by /maintainers/scripts/update-discord
let let
inherit (pkgs) callPackage fetchurl; inherit (pkgs) callPackage fetchurl;
in { in {
@ -16,7 +16,7 @@ for branch in "" ptb canary; do
url=$(curl -sI "https://discordapp.com/api/download${branch:+/}${branch}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+') url=$(curl -sI "https://discordapp.com/api/download${branch:+/}${branch}?platform=linux&format=tar.gz" | grep -oP 'location: \K\S+')
version=${url##https://dl*.discordapp.net/apps/linux/} version=${url##https://dl*.discordapp.net/apps/linux/}
version=${version%%/*.tar.gz} version=${version%%/*.tar.gz}
echo " ${branch:-stable} = callPackage ./base.nix {" echo " ${branch:-stable} = callPackage ./base.nix rec {"
echo " pname = \"discord${branch:+-}${branch}\";" echo " pname = \"discord${branch:+-}${branch}\";"
case $branch in case $branch in
"") suffix="" ;; "") suffix="" ;;
@ -27,7 +27,7 @@ for branch in "" ptb canary; do
echo " desktopName = \"Discord${suffix:+ }${suffix}\";" echo " desktopName = \"Discord${suffix:+ }${suffix}\";"
echo " version = \"${version}\";" echo " version = \"${version}\";"
echo " src = fetchurl {" echo " src = fetchurl {"
echo " url = \"${url}\";" echo " url = \"${url//${version}/\$\{version\}}\";"
echo " sha256 = \"$(nix-prefetch-url "$url")\";" echo " sha256 = \"$(nix-prefetch-url "$url")\";"
echo " };" echo " };"
echo " };" echo " };"

View File

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

View File

@ -13,9 +13,7 @@
<para> <para>
It sets <xref linkend="opt-services.xserver.enable"/>, It sets <xref linkend="opt-services.xserver.enable"/>,
<xref linkend="opt-services.xserver.displayManager.sddm.enable"/>, <xref linkend="opt-services.xserver.displayManager.sddm.enable"/>,
<xref linkend="opt-services.xserver.desktopManager.plasma5.enable"/> ( <xref linkend="opt-services.xserver.desktopManager.plasma5.enable"/>, and
<link linkend="opt-services.xserver.desktopManager.plasma5.enableQt4Support">
without Qt4 Support</link>), and
<xref linkend="opt-services.xserver.libinput.enable"/> to true. It also <xref linkend="opt-services.xserver.libinput.enable"/> to true. It also
includes glxinfo and firefox in the system packages list. includes glxinfo and firefox in the system packages list.
</para> </para>

View File

@ -39,7 +39,7 @@
can select an alternative one by picking one of the following lines: can select an alternative one by picking one of the following lines:
<programlisting> <programlisting>
<xref linkend="opt-services.xserver.displayManager.sddm.enable"/> = true; <xref linkend="opt-services.xserver.displayManager.sddm.enable"/> = true;
<xref linkend="opt-services.xserver.displayManager.slim.enable"/> = true; <xref linkend="opt-services.xserver.displayManager.gdm.enable"/> = true;
</programlisting> </programlisting>
</para> </para>
<para> <para>

View File

@ -62,14 +62,13 @@ let
"--stringparam html.stylesheet 'style.css overrides.css highlightjs/mono-blue.css'" "--stringparam html.stylesheet 'style.css overrides.css highlightjs/mono-blue.css'"
"--stringparam html.script './highlightjs/highlight.pack.js ./highlightjs/loader.js'" "--stringparam html.script './highlightjs/highlight.pack.js ./highlightjs/loader.js'"
"--param xref.with.number.and.title 1" "--param xref.with.number.and.title 1"
"--param toc.section.depth 3" "--param toc.section.depth 0"
"--stringparam admon.style ''" "--stringparam admon.style ''"
"--stringparam callout.graphics.extension .svg" "--stringparam callout.graphics.extension .svg"
"--stringparam current.docid manual" "--stringparam current.docid manual"
"--param chunk.section.depth 0" "--param chunk.section.depth 0"
"--param chunk.first.sections 1" "--param chunk.first.sections 1"
"--param use.id.as.filename 1" "--param use.id.as.filename 1"
"--stringparam generate.toc 'book toc appendix toc'"
"--stringparam chunk.toc ${toc}" "--stringparam chunk.toc ${toc}"
]; ];

View File

@ -99,7 +99,7 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
<para> <para>
As an example, we will take the case of display managers. There is a central As an example, we will take the case of display managers. There is a central
display manager module for generic display manager options and a module file display manager module for generic display manager options and a module file
per display manager backend (slim, sddm, gdm ...). per display manager backend (sddm, gdm ...).
</para> </para>
<para> <para>
@ -146,7 +146,7 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming">
/>), and to extend />), and to extend
it in each backend module it in each backend module
(<xref (<xref
linkend='ex-option-declaration-eot-backend-slim' />, linkend='ex-option-declaration-eot-backend-gdm' />,
<xref <xref
linkend='ex-option-declaration-eot-backend-sddm' />). linkend='ex-option-declaration-eot-backend-sddm' />).
</para> </para>
@ -167,11 +167,11 @@ services.xserver.displayManager.enable = mkOption {
};</screen> };</screen>
</example> </example>
<example xml:id='ex-option-declaration-eot-backend-slim'> <example xml:id='ex-option-declaration-eot-backend-gdm'>
<title>Extending <literal>services.xserver.displayManager.enable</literal> in the <literal>slim</literal> module</title> <title>Extending <literal>services.xserver.displayManager.enable</literal> in the <literal>gdm</literal> module</title>
<screen> <screen>
services.xserver.displayManager.enable = mkOption { services.xserver.displayManager.enable = mkOption {
type = with types; nullOr (enum [ "slim" ]); type = with types; nullOr (enum [ "gdm" ]);
};</screen> };</screen>
</example> </example>

View File

@ -45,12 +45,12 @@
<listitem> <listitem>
<para> <para>
<literal>git tag -a -s -m &quot;Release 17.09-beta&quot; 17.09-beta <literal>git tag -a -s -m &quot;Release 17.09-beta&quot; 17.09-beta
&amp;&amp; git push --tags</literal> &amp;&amp; git push origin 17.09-beta</literal>
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
From the master branch run <literal>git checkout -B From the master branch run <literal>git checkout -b
release-17.09</literal>. release-17.09</literal>.
</para> </para>
</listitem> </listitem>
@ -157,7 +157,7 @@
<listitem> <listitem>
<para> <para>
Release Nix (currently only Eelco Dolstra can do that). Release Nix (currently only Eelco Dolstra can do that).
<link xlink:href="https://github.com/NixOS/nixpkgs/commit/53710c752a85f00658882531bc90a23a3d1287e4"> <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nix-fallback-paths.nix">
Make sure fallback is updated. </link> Make sure fallback is updated. </link>
</para> </para>
</listitem> </listitem>
@ -169,8 +169,8 @@
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Change <literal>stableBranch</literal> to true and wait for channel to Change <literal>stableBranch</literal> to <literal>true</literal> in Hydra and wait for
update. the channel to update.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
@ -193,9 +193,11 @@
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Update http://nixos.org/nixos/download.html and Update the
http://nixos.org/nixos/manual in <link xlink:href="https://github.com/NixOS/nixos-homepage/commit/2a37975d5a617ecdfca94696242b6f32ffcba9f1"><code>NIXOS_SERIES</code></link>
https://github.com/NixOS/nixos-org-configurations in the
<link xlink:href="https://github.com/NixOS/nixos-homepage">nixos-homepage</link>
repository.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -212,7 +214,8 @@
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Send an email to nix-dev to announce the release with above information. Create a new topic on <link xlink:href="https://discourse.nixos.org/">the
Discourse instance</link> to announce the release with the above information.
Best to check how previous email was formulated to see what needs to be Best to check how previous email was formulated to see what needs to be
included. included.
</para> </para>

View File

@ -2,7 +2,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0" version="5.0"
xml:id="sec-running-nixos-tests"> xml:id="sec-running-nixos-tests-interactively">
<title>Running Tests interactively</title> <title>Running Tests interactively</title>
<para> <para>
@ -14,14 +14,14 @@
starting VDE switch for network 1 starting VDE switch for network 1
<prompt>&gt;</prompt> <prompt>&gt;</prompt>
</screen> </screen>
You can then take any Perl statement, e.g. You can then take any Python statement, e.g.
<screen> <screen>
<prompt>&gt;</prompt> startAll <prompt>&gt;</prompt> start_all()
<prompt>&gt;</prompt> testScript <prompt>&gt;</prompt> test_script()
<prompt>&gt;</prompt> $machine->succeed("touch /tmp/foo") <prompt>&gt;</prompt> machine.succeed("touch /tmp/foo")
<prompt>&gt;</prompt> print($machine->succeed("pwd")) # Show stdout of command <prompt>&gt;</prompt> print(machine.succeed("pwd")) # Show stdout of command
</screen> </screen>
The function <command>testScript</command> executes the entire test script The function <command>test_script</command> executes the entire test script
and drops you back into the test driver command line upon its completion. and drops you back into the test driver command line upon its completion.
This allows you to inspect the state of the VMs after the test (e.g. to debug This allows you to inspect the state of the VMs after the test (e.g. to debug
the test script). the test script).

View File

@ -2,7 +2,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0" version="5.0"
xml:id="sec-running-nixos-tests-interactively"> xml:id="sec-running-nixos-tests">
<title>Running Tests</title> <title>Running Tests</title>
<para> <para>

View File

@ -13,17 +13,16 @@
<screen> <screen>
<prompt>$ </prompt>git clone https://github.com/NixOS/nixpkgs <prompt>$ </prompt>git clone https://github.com/NixOS/nixpkgs
<prompt>$ </prompt>cd nixpkgs <prompt>$ </prompt>cd nixpkgs
<prompt>$ </prompt>git remote add channels https://github.com/NixOS/nixpkgs-channels <prompt>$ </prompt>git remote update origin
<prompt>$ </prompt>git remote update channels
</screen> </screen>
This will check out the latest Nixpkgs sources to This will check out the latest Nixpkgs sources to
<filename>./nixpkgs</filename> the NixOS sources to <filename>./nixpkgs</filename> the NixOS sources to
<filename>./nixpkgs/nixos</filename>. (The NixOS source tree lives in a <filename>./nixpkgs/nixos</filename>. (The NixOS source tree lives in a
subdirectory of the Nixpkgs repository.) The remote subdirectory of the Nixpkgs repository.) The
<literal>channels</literal> refers to a read-only repository that tracks the <literal>nixpkgs</literal> repository has branches that correspond
Nixpkgs/NixOS channels (see <xref linkend="sec-upgrading"/> for more to each Nixpkgs/NixOS channel (see <xref linkend="sec-upgrading"/> for more
information about channels). Thus, the Git branch information about channels). Thus, the Git branch
<literal>channels/nixos-17.03</literal> will contain the latest built and <literal>origin/nixos-17.03</literal> will contain the latest built and
tested version available in the <literal>nixos-17.03</literal> channel. tested version available in the <literal>nixos-17.03</literal> channel.
</para> </para>
<para> <para>
@ -40,15 +39,15 @@
Or, to base your local branch on the latest version available in a NixOS Or, to base your local branch on the latest version available in a NixOS
channel: channel:
<screen> <screen>
<prompt>$ </prompt>git remote update channels <prompt>$ </prompt>git remote update origin
<prompt>$ </prompt>git checkout -b local channels/nixos-17.03 <prompt>$ </prompt>git checkout -b local origin/nixos-17.03
</screen> </screen>
(Replace <literal>nixos-17.03</literal> with the name of the channel you want (Replace <literal>nixos-17.03</literal> with the name of the channel you want
to use.) You can use <command>git merge</command> or <command>git to use.) You can use <command>git merge</command> or <command>git
rebase</command> to keep your local branch in sync with the channel, e.g. rebase</command> to keep your local branch in sync with the channel, e.g.
<screen> <screen>
<prompt>$ </prompt>git remote update channels <prompt>$ </prompt>git remote update origin
<prompt>$ </prompt>git merge channels/nixos-17.03 <prompt>$ </prompt>git merge origin/nixos-17.03
</screen> </screen>
You can use <command>git cherry-pick</command> to copy commits from your You can use <command>git cherry-pick</command> to copy commits from your
local branch to the upstream branch. local branch to the upstream branch.

View File

@ -8,7 +8,7 @@
<para> <para>
A NixOS test is a Nix expression that has the following structure: A NixOS test is a Nix expression that has the following structure:
<programlisting> <programlisting>
import ./make-test.nix { import ./make-test-python.nix {
# Either the configuration of a single machine: # Either the configuration of a single machine:
machine = machine =
@ -27,11 +27,11 @@ import ./make-test.nix {
testScript = testScript =
'' ''
<replaceable>Perl code…</replaceable> <replaceable>Python code…</replaceable>
''; '';
} }
</programlisting> </programlisting>
The attribute <literal>testScript</literal> is a bit of Perl code that The attribute <literal>testScript</literal> is a bit of Python code that
executes the test (described below). During the test, it will start one or executes the test (described below). During the test, it will start one or
more virtual machines, the configuration of which is described by the more virtual machines, the configuration of which is described by the
attribute <literal>machine</literal> (if you need only one machine in your attribute <literal>machine</literal> (if you need only one machine in your
@ -96,26 +96,27 @@ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualis
</para> </para>
<para> <para>
The test script is a sequence of Perl statements that perform various The test script is a sequence of Python statements that perform various
actions, such as starting VMs, executing commands in the VMs, and so on. Each actions, such as starting VMs, executing commands in the VMs, and so on. Each
virtual machine is represented as an object stored in the variable virtual machine is represented as an object stored in the variable
<literal>$<replaceable>name</replaceable></literal>, where <literal><replaceable>name</replaceable></literal> if this is also the
<replaceable>name</replaceable> is the identifier of the machine (which is identifier of the machine in the declarative config.
just <literal>machine</literal> if you didnt specify multiple machines If you didn't specify multiple machines using the <literal>nodes</literal>
using the <literal>nodes</literal> attribute). For instance, the following attribute, it is just <literal>machine</literal>.
starts the machine, waits until it has finished booting, then executes a The following example starts the machine, waits until it has finished booting,
command and checks that the output is more-or-less correct: then executes a command and checks that the output is more-or-less correct:
<programlisting> <programlisting>
$machine->start; machine.start()
$machine->waitForUnit("default.target"); machine.wait_for_unit("default.target")
$machine->succeed("uname") =~ /Linux/ or die; if not "Linux" in machine.succeed("uname"):
raise Exception("Wrong OS")
</programlisting> </programlisting>
The first line is actually unnecessary; machines are implicitly started when The first line is actually unnecessary; machines are implicitly started when
you first execute an action on them (such as <literal>waitForUnit</literal> you first execute an action on them (such as <literal>wait_for_unit</literal>
or <literal>succeed</literal>). If you have multiple machines, you can speed or <literal>succeed</literal>). If you have multiple machines, you can speed
up the test by starting them in parallel: up the test by starting them in parallel:
<programlisting> <programlisting>
startAll; start_all()
</programlisting> </programlisting>
</para> </para>
@ -187,7 +188,7 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>getScreenText</methodname> <methodname>get_screen_text</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -204,7 +205,7 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>sendMonitorCommand</methodname> <methodname>send_monitor_command</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -215,23 +216,23 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>sendKeys</methodname> <methodname>send_keys</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
Simulate pressing keys on the virtual keyboard, e.g., Simulate pressing keys on the virtual keyboard, e.g.,
<literal>sendKeys("ctrl-alt-delete")</literal>. <literal>send_keys("ctrl-alt-delete")</literal>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>sendChars</methodname> <methodname>send_chars</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
Simulate typing a sequence of characters on the virtual keyboard, e.g., Simulate typing a sequence of characters on the virtual keyboard, e.g.,
<literal>sendKeys("foobar\n")</literal> will type the string <literal>send_keys("foobar\n")</literal> will type the string
<literal>foobar</literal> followed by the Enter key. <literal>foobar</literal> followed by the Enter key.
</para> </para>
</listitem> </listitem>
@ -272,7 +273,7 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>waitUntilSucceeds</methodname> <methodname>wait_until_succeeds</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -282,7 +283,7 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>waitUntilFails</methodname> <methodname>wait_until_fails</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -292,7 +293,7 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>waitForUnit</methodname> <methodname>wait_for_unit</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -302,7 +303,7 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>waitForFile</methodname> <methodname>wait_for_file</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -312,7 +313,7 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>waitForOpenPort</methodname> <methodname>wait_for_open_port</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -323,7 +324,7 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>waitForClosedPort</methodname> <methodname>wait_for_closed_port</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -333,7 +334,7 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>waitForX</methodname> <methodname>wait_for_x</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
@ -343,13 +344,13 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>waitForText</methodname> <methodname>wait_for_text</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
Wait until the supplied regular expressions matches the textual contents Wait until the supplied regular expressions matches the textual contents
of the screen by using optical character recognition (see of the screen by using optical character recognition (see
<methodname>getScreenText</methodname>). <methodname>get_screen_text</methodname>).
</para> </para>
<note> <note>
<para> <para>
@ -361,23 +362,23 @@ startAll;
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>waitForWindow</methodname> <methodname>wait_for_window</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
Wait until an X11 window has appeared whose name matches the given Wait until an X11 window has appeared whose name matches the given
regular expression, e.g., <literal>waitForWindow(qr/Terminal/)</literal>. regular expression, e.g., <literal>wait_for_window("Terminal")</literal>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<methodname>copyFileFromHost</methodname> <methodname>copy_file_from_host</methodname>
</term> </term>
<listitem> <listitem>
<para> <para>
Copies a file from host to machine, e.g., Copies a file from host to machine, e.g.,
<literal>copyFileFromHost("myfile", "/etc/my/important/file")</literal>. <literal>copy_file_from_host("myfile", "/etc/my/important/file")</literal>.
</para> </para>
<para> <para>
The first argument is the file on the host. The file needs to be The first argument is the file on the host. The file needs to be
@ -397,8 +398,8 @@ startAll;
</para> </para>
<para> <para>
<programlisting> <programlisting>
$machine->systemctl("list-jobs --no-pager"); // runs `systemctl list-jobs --no-pager` machine.systemctl("list-jobs --no-pager") # runs `systemctl list-jobs --no-pager`
$machine->systemctl("list-jobs --no-pager", "any-user"); // spawns a shell for `any-user` and runs `systemctl --user list-jobs --no-pager` machine.systemctl("list-jobs --no-pager", "any-user") # spawns a shell for `any-user` and runs `systemctl --user list-jobs --no-pager`
</programlisting> </programlisting>
</para> </para>
</listitem> </listitem>
@ -408,14 +409,14 @@ $machine->systemctl("list-jobs --no-pager", "any-user"); // spawns a shell for `
<para> <para>
To test user units declared by <literal>systemd.user.services</literal> the To test user units declared by <literal>systemd.user.services</literal> the
optional <literal>$user</literal> argument can be used: optional <literal>user</literal> argument can be used:
<programlisting> <programlisting>
$machine->start; machine.start()
$machine->waitForX; machine.wait_for_x()
$machine->waitForUnit("xautolock.service", "x-session-user"); machine.wait_for_unit("xautolock.service", "x-session-user")
</programlisting> </programlisting>
This applies to <literal>systemctl</literal>, <literal>getUnitInfo</literal>, This applies to <literal>systemctl</literal>, <literal>get_unit_info</literal>,
<literal>waitForUnit</literal>, <literal>startJob</literal> and <literal>wait_for_unit</literal>, <literal>start_job</literal> and
<literal>stopJob</literal>. <literal>stop_job</literal>.
</para> </para>
</section> </section>

View File

@ -47,6 +47,11 @@
acceleration acceleration
</para> </para>
</listitem> </listitem>
<listitem>
<para>
Click on Settings / Display / Screen and select VBoxVGA as Graphics Controller
</para>
</listitem>
<listitem> <listitem>
<para> <para>
Save the settings, start the virtual machine, and continue installation Save the settings, start the virtual machine, and continue installation

View File

@ -68,7 +68,7 @@
If you would like to continue the installation from a different machine you If you would like to continue the installation from a different machine you
need to activate the SSH daemon via <command>systemctl start need to activate the SSH daemon via <command>systemctl start
sshd</command>. You then must set a password for either <literal>root</literal> or sshd</command>. You then must set a password for either <literal>root</literal> or
<literal>nixos</literal> with <command>passwd></command> to be able to login. <literal>nixos</literal> with <command>passwd</command> to be able to login.
</para> </para>
</section> </section>
</section> </section>
@ -380,7 +380,10 @@
</para> </para>
<para> <para>
If you need to configure networking for your machine the configuration If you need to configure networking for your machine the configuration
options are described in <xref linkend="sec-networking"/>. options are described in <xref linkend="sec-networking"/>. In particular,
while wifi is supported on the installation image, it is not enabled by
default in the configuration generated by
<command>nixos-generate-config</command>.
</para> </para>
<para> <para>
Another critical option is <option>fileSystems</option>, specifying the Another critical option is <option>fileSystems</option>, specifying the
@ -392,11 +395,11 @@
<filename>hardware-configuration.nix</filename> is included from <filename>hardware-configuration.nix</filename> is included from
<filename>configuration.nix</filename> and will be overwritten by future <filename>configuration.nix</filename> and will be overwritten by future
invocations of <command>nixos-generate-config</command>; thus, you invocations of <command>nixos-generate-config</command>; thus, you
generally should not modify it.) Additionally, you may want to look at generally should not modify it.) Additionally, you may want to look at
<link xlink:href="https://github.com/NixOS/nixos-hardware">Hardware <link xlink:href="https://github.com/NixOS/nixos-hardware">Hardware
configuration for known-hardware</link> at this point or after configuration for known-hardware</link> at this point or after
installation. installation.
</para> </para>
<note> <note>
<para> <para>
@ -418,11 +421,11 @@
Do the installation: Do the installation:
<screen> <screen>
<prompt># </prompt>nixos-install</screen> <prompt># </prompt>nixos-install</screen>
Cross fingers. If this fails due to a temporary problem (such as a network This will install your system based on the configuration you provided.
issue while downloading binaries from the NixOS binary cache), you can If anything fails due to a configuration problem or any other issue
just re-run <command>nixos-install</command>. Otherwise, fix your (such as a network outage while downloading binaries from the NixOS
<filename>configuration.nix</filename> and then re-run binary cache), you can re-run <command>nixos-install</command> after
<command>nixos-install</command>. fixing your <filename>configuration.nix</filename>.
</para> </para>
<para> <para>
As the last step, <command>nixos-install</command> will ask you to set the As the last step, <command>nixos-install</command> will ask you to set the

View File

@ -19,14 +19,10 @@
</arg> </arg>
<arg> <arg>
<option>--verbose</option> <option>--all</option>
</arg> </arg>
<arg> <arg>
<option>--xml</option>
</arg>
<arg choice="plain">
<replaceable>option.name</replaceable> <replaceable>option.name</replaceable>
</arg> </arg>
</cmdsynopsis> </cmdsynopsis>
@ -62,22 +58,11 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<option>--verbose</option> <option>--all</option>
</term> </term>
<listitem> <listitem>
<para> <para>
This option enables verbose mode, which currently is just the Bash Print the values of all options.
<command>set</command> <option>-x</option> debug mode.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--xml</option>
</term>
<listitem>
<para>
This option causes the output to be rendered as XML.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -494,6 +494,20 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<option>--use-remote-sudo</option>
</term>
<listitem>
<para>
When set, nixos-rebuild prefixes remote commands that run on
the <option>--build-host</option> and <option>--target-host</option>
systems with <command>sudo</command>. Setting this option allows
deploying as a non-root user.
</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
<para> <para>

View File

@ -8,32 +8,7 @@
<subtitle>Version <xi:include href="./generated/version" parse="text" /> <subtitle>Version <xi:include href="./generated/version" parse="text" />
</subtitle> </subtitle>
</info> </info>
<preface xml:id="preface"> <xi:include href="preface.xml" />
<title>Preface</title>
<para>
This manual describes how to install, use and extend NixOS, a Linux
distribution based on the purely functional package management system Nix.
</para>
<para>
If you encounter problems, please report them on the
<literal
xlink:href="https://discourse.nixos.org">Discourse</literal> or
on the <link
xlink:href="irc://irc.freenode.net/#nixos">
<literal>#nixos</literal> channel on Freenode</link>. Bugs should be
reported in
<link
xlink:href="https://github.com/NixOS/nixpkgs/issues">NixOS
GitHub issue tracker</link>.
</para>
<note>
<para>
Commands prefixed with <literal>#</literal> have to be run as root, either
requiring to login as root user or temporarily switching to it using
<literal>sudo</literal> for example.
</para>
</note>
</preface>
<xi:include href="installation/installation.xml" /> <xi:include href="installation/installation.xml" />
<xi:include href="configuration/configuration.xml" /> <xi:include href="configuration/configuration.xml" />
<xi:include href="administration/running.xml" /> <xi:include href="administration/running.xml" />

View File

@ -0,0 +1,37 @@
<preface xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:id="preface">
<title>Preface</title>
<para>
This manual describes how to install, use and extend NixOS, a Linux
distribution based on the purely functional package management system
<link xlink:href="https://nixos.org/nix">Nix</link>, that is composed
using modules and packages defined in the
<link xlink:href="https://nixos.org/nixpkgs">Nixpkgs</link> project.
</para>
<para>
Additional information regarding the Nix package manager and the Nixpkgs
project can be found in respectively the
<link xlink:href="https://nixos.org/nix/manual">Nix manual</link> and the
<link xlink:href="https://nixos.org/nixpkgs/manual">Nixpkgs manual</link>.
</para>
<para>
If you encounter problems, please report them on the
<literal
xlink:href="https://discourse.nixos.org">Discourse</literal> or
on the <link
xlink:href="irc://irc.freenode.net/#nixos">
<literal>#nixos</literal> channel on Freenode</link>. Bugs should be
reported in
<link
xlink:href="https://github.com/NixOS/nixpkgs/issues">NixOS
GitHub issue tracker</link>.
</para>
<note>
<para>
Commands prefixed with <literal>#</literal> have to be run as root, either
requiring to login as root user or temporarily switching to it using
<literal>sudo</literal> for example.
</para>
</note>
</preface>

View File

@ -3,7 +3,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0" version="5.0"
xml:id="sec-release-19.09"> xml:id="sec-release-19.09">
<title>Release 19.09 (“Loris”, 2019/09/??)</title> <title>Release 19.09 (“Loris”, 2019/10/09)</title>
<section xmlns="http://docbook.org/ns/docbook" <section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
@ -23,6 +23,26 @@
End of support is planned for end of April 2020, handing over to 20.03. End of support is planned for end of April 2020, handing over to 20.03.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
Nix has been updated to 2.3; see its
<link xlink:href="https://nixos.org/nix/manual/#ssec-relnotes-2.3">release
notes</link>.
</para>
</listitem>
<listitem>
<para>Core version changes:</para>
<para>systemd: 239 -&gt; 243</para>
<para>gcc: 7 -&gt; 8</para>
<para>glibc: 2.27 (unchanged)</para>
<para>linux: 4.19 LTS (unchanged)</para>
<para>openssl: 1.0 -&gt; 1.1</para>
</listitem>
<listitem>
<para>Desktop version changes:</para>
<para>plasma5: 5.14 -&gt; 5.16</para>
<para>gnome3: 3.30 -&gt; 3.32</para>
</listitem>
<listitem> <listitem>
<para> <para>
PHP now defaults to PHP 7.3, updated from 7.2. PHP now defaults to PHP 7.3, updated from 7.2.
@ -170,6 +190,13 @@
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</listitem> </listitem>
<listitem>
<para>
<xref linkend="opt-services.blueman.enable"/> has been added.
If you previously had blueman installed via <option>environment.systemPackages</option> please
migrate to using the NixOS module, as this would result in an insufficiently configured blueman.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>
@ -512,9 +539,11 @@
is set to <literal>/var/lib/gitlab/state</literal>, <literal>gitlab</literal> and all parent directories is set to <literal>/var/lib/gitlab/state</literal>, <literal>gitlab</literal> and all parent directories
must be owned by either <literal>root</literal> or the user specified in <option>services.gitlab.user</option>. must be owned by either <literal>root</literal> or the user specified in <option>services.gitlab.user</option>.
</para> </para>
</listitem>
<listitem>
<para> <para>
The <option>networking.useDHCP</option> option is unsupported in combination with The <option>networking.useDHCP</option> option is unsupported in combination with
<option>networking.useNetworkd</option> in anticipation of defaulting to it by default. <option>networking.useNetworkd</option> in anticipation of defaulting to it.
It has to be set to <literal>false</literal> and enabled per It has to be set to <literal>false</literal> and enabled per
interface with <option>networking.interfaces.&lt;name&gt;.useDHCP = true;</option> interface with <option>networking.interfaces.&lt;name&gt;.useDHCP = true;</option>
</para> </para>
@ -541,6 +570,27 @@
earlier version of NixOS. earlier version of NixOS.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
Due to the short lifetime of non-LTS kernel releases package attributes like <literal>linux_5_1</literal>,
<literal>linux_5_2</literal> and <literal>linux_5_3</literal> have been removed to discourage dependence
on specific non-LTS kernel versions in stable NixOS releases.
Going forward, versioned attributes like <literal>linux_4_9</literal> will exist for LTS versions only.
Please use <literal>linux_latest</literal> or <literal>linux_testing</literal> if you depend on non-LTS
releases. Keep in mind that <literal>linux_latest</literal> and <literal>linux_testing</literal> will
change versions under the hood during the lifetime of a stable release and might include breaking changes.
</para>
</listitem>
<listitem>
<para>
Because of the systemd upgrade,
some network interfaces might change their name. For details see
<link xlink:href="https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html#History">
upstream docs</link> or <link xlink:href="https://github.com/NixOS/nixpkgs/issues/71086">
our ticket</link>.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>

View File

@ -36,6 +36,25 @@
quirk in the boot menu. quirk in the boot menu.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
By default zfs pools will now be trimmed on a weekly basis.
Trimming is only done on supported devices (i.e. NVME or SSDs)
and should improve throughput and lifetime of these devices.
It is controlled by the <varname>services.zfs.trim.enable</varname> varname.
The zfs scrub service (<varname>services.zfs.autoScrub.enable</varname>)
and the zfs autosnapshot service (<varname>services.zfs.autoSnapshot.enable</varname>)
are now only enabled if zfs is set in <varname>config.boot.initrd.supportedFilesystems</varname> or
<varname>config.boot.supportedFilesystems</varname>. These lists will automatically contain
zfs as soon as any zfs mountpoint is configured in <varname>fileSystems</varname>.
</para>
</listitem>
<listitem>
<para>
<command>nixos-option</command> has been rewritten in C++, speeding it up, improving correctness,
and adding a <option>--all</option> option which prints all options and their values.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>
@ -52,7 +71,17 @@
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para /> <para>
The kubernetes kube-proxy now supports a new hostname configuration
<literal>services.kubernetes.proxy.hostname</literal> which has to
be set if the hostname of the node should be non default.
</para>
</listitem>
<listitem>
<para>
UPower's configuration is now managed by NixOS and can be customized
via <option>services.upower</option>.
</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
@ -72,7 +101,124 @@
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para /> <para>
GnuPG is now built without support for a graphical passphrase entry
by default. Please enable the <literal>gpg-agent</literal> user service
via the NixOS option <literal>programs.gnupg.agent.enable</literal>.
Note that upstream recommends using <literal>gpg-agent</literal> and
will spawn a <literal>gpg-agent</literal> on the first invocation of
GnuPG anyway.
</para>
</listitem>
<listitem>
<para>
The <literal>dynamicHosts</literal> option has been removed from the
<link linkend="opt-networking.networkmanager.enable">networkd</link>
module. Allowing (multiple) regular users to override host entries
affecting the whole system opens up a huge attack vector.
There seem to be very rare cases where this might be useful.
Consider setting system-wide host entries using
<link linkend="opt-networking.hosts">networking.hosts</link>, provide
them via the DNS server in your network, or use
<link linkend="opt-environment.etc">environment.etc</link>
to add a file into <literal>/etc/NetworkManager/dnsmasq.d</literal>
reconfiguring <literal>hostsdir</literal>.
</para>
</listitem>
<listitem>
<para>
The <literal>99-main.network</literal> file was removed. Maching all
network interfaces caused many breakages, see
<link xlink:href="https://github.com/NixOS/nixpkgs/pull/18962">#18962</link>
and <link xlink:href="https://github.com/NixOS/nixpkgs/pull/71106">#71106</link>.
</para>
<para>
We already don't support the global <link linkend="opt-networking.useDHCP">networking.useDHCP</link>,
<link linkend="opt-networking.defaultGateway">networking.defaultGateway</link> and
<link linkend="opt-networking.defaultGateway6">networking.defaultGateway6</link> options
if <link linkend="opt-networking.useNetworkd">networking.useNetworkd</link> is enabled,
but direct users to configure the per-device
<link linkend="opt-networking.interfaces">networking.interfaces.&lt;name&gt;.…</link> options.
</para>
</listitem>
<listitem>
<para>
The stdenv now runs all bash with <literal>set -u</literal>, to catch the use of undefined variables.
Before, it itself used <literal>set -u</literal> but was careful to unset it so other packages' code ran as before.
Now, all bash code is held to the same high standard, and the rather complex stateful manipulation of the options can be discarded.
</para>
</listitem>
<listitem>
<para>
The SLIM Display Manager has been removed, as it has been unmaintained since 2013.
Consider migrating to a different display manager such as LightDM (current default in NixOS),
SDDM, GDM, or using the startx module which uses Xinitrc.
</para>
</listitem>
<listitem>
<para>
The BEAM package set has been deleted. You will only find there the different interpreters.
You should now use the different build tools coming with the languages with sandbox mode disabled.
</para>
</listitem>
<listitem>
<para>
There is now only one Xfce package-set and module. This means attributes, <literal>xfce4-14</literal>
<literal>xfce4-12</literal>, and <literal>xfceUnstable</literal> all now point to the latest Xfce 4.14
packages. And in future NixOS releases will be the latest released version of Xfce available at the
time during the releases development (if viable).
</para>
</listitem>
<listitem>
<para>
The <link linkend="opt-services.phpfpm.pools">phpfpm</link> module now sets
<literal>PrivateTmp=true</literal> in its systemd units for better process isolation.
If you rely on <literal>/tmp</literal> being shared with other services, explicitly override this by
setting <literal>serviceConfig.PrivateTmp</literal> to <literal>false</literal> for each phpfpm unit.
</para>
</listitem>
<listitem>
<para>
KDEs old multimedia framework Phonon no longer supports Qt 4. For that reason, Plasma desktop also does not have <option>enableQt4Support</option> option any more.
</para>
</listitem>
<listitem>
<para>
The BeeGFS module has been removed.
</para>
</listitem>
<listitem>
<para>
The osquery module has been removed.
</para>
</listitem>
<listitem>
<para>
Going forward, <literal>~/bin</literal> in the users home directory will no longer be in <literal>PATH</literal> by default.
If you depend on this you should set the option <literal>environment.homeBinInPath</literal> to <literal>true</literal>.
The aforementioned option was added this release.
</para>
</listitem>
<listitem>
<para>
The <literal>buildRustCrate</literal> infrastructure now produces <literal>lib</literal> outputs in addition to the <literal>out</literal> output.
This has led to drastically reduced closed sizes for some rust crates since development dependencies are now in the <literal>lib</literal> output.
</para>
</listitem>
<listitem>
<para>
The packages <literal>openobex</literal> and <literal>obexftp</literal>
are no longer installed when enabling Bluetooth via
<option>hardware.bluetooth.enable</option>.
</para>
</listitem>
<listitem>
<para>
The <literal>dump1090</literal> derivation has been changed to use FlightAware's dump1090
as its upstream. However, this version does not have an internal webserver anymore. The
assets in the <literal>share/dump1090</literal> directory of the derivation can be used
in conjunction with an external webserver to replace this functionality.
</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</section> </section>
@ -88,6 +234,20 @@
<listitem> <listitem>
<para>SD images are now compressed by default using <literal>bzip2</literal>.</para> <para>SD images are now compressed by default using <literal>bzip2</literal>.</para>
</listitem> </listitem>
<listitem>
<para>
OpenSSH has been upgraded from 7.9 to 8.1, improving security and adding features
but with potential incompatibilities. Consult the
<link xlink:href="https://www.openssh.com/txt/release-8.1">
release announcement</link> for more information.
</para>
</listitem>
<listitem>
<para>
<literal>PRETTY_NAME</literal> in <literal>/etc/os-release</literal>
now uses the short rather than full version string.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>
</section> </section>

View File

@ -10,9 +10,9 @@
contents contents
, # In addition to `contents', the closure of the store paths listed , # In addition to `contents', the closure of the store paths listed
# in `packages' are also placed in the Nix store of the CD. This is # in `storeContents' are also placed in the Nix store of the CD.
# a list of attribute sets {object, symlink} where `object' if a # This is a list of attribute sets {object, symlink} where `object'
# store path whose closure will be copied, and `symlink' is a # is a store path whose closure will be copied, and `symlink' is a
# symlink to `object' that will be added to the CD. # symlink to `object' that will be added to the CD.
storeContents ? [] storeContents ? []

View File

@ -86,7 +86,7 @@ let
optionsList = lib.sort optionLess optionsListDesc; optionsList = lib.sort optionLess optionsListDesc;
# Convert the list of options into an XML file. # Convert the list of options into an XML file.
optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList); optionsXML = pkgs.writeText "options.xml" (builtins.toXML optionsList);
optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList); optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList);

Some files were not shown because too many files have changed in this diff Show More