From 641f6356d387ef493812de23f75114effc0cc398 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 6 Sep 2019 04:24:10 +0200 Subject: doc: Disable wrapping source Even a simple typo fix can result in a reflow of a whole paragraph, leading to illegible diffs. The majority of text editors supports wrapping the source code to a comfortable width so it makes sense to me to sacrifice the few that do not rather than the unfortunately line-oriented diff tools. --- nixos/doc/xmlformat.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/nixos/doc/xmlformat.conf b/nixos/doc/xmlformat.conf index 4a565c8465bc..c3f39c7fd81b 100644 --- a/nixos/doc/xmlformat.conf +++ b/nixos/doc/xmlformat.conf @@ -37,7 +37,6 @@ para abstract entry-break 1 exit-break 1 normalize yes - wrap-length 79 title format block -- cgit 1.4.1 From 713fda2eb51911ae9420d6c5295317fa932b3497 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 18 Sep 2019 21:50:18 +0200 Subject: nixos/sway: install swaybg by default --- nixos/modules/programs/sway.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/programs/sway.nix b/nixos/modules/programs/sway.nix index b4f03151cdc1..f92d09a7ef44 100644 --- a/nixos/modules/programs/sway.nix +++ b/nixos/modules/programs/sway.nix @@ -55,7 +55,7 @@ in { extraPackages = mkOption { type = with types; listOf package; default = with pkgs; [ - swaylock swayidle + swaylock swayidle swaybg xwayland rxvt_unicode dmenu ]; defaultText = literalExample '' -- cgit 1.4.1 From cde50a4fab169a90ee4a6c08e82c77be803aa744 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 18 Sep 2019 21:53:40 +0200 Subject: shotcut: use vaapi_device /dev/dri/renderD128 instead of ":0" This fixes the auto-detection of VAAPI hardware encoders provided by Intel chipsets. Be sure to define hardware.opengl.extraPackages = [pkgs.vaapiIntel]; in configuration.nix to make the necessary OpenGL drivers available. --- pkgs/applications/video/shotcut/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/video/shotcut/default.nix b/pkgs/applications/video/shotcut/default.nix index a50ee8b56643..3edee15db5fc 100644 --- a/pkgs/applications/video/shotcut/default.nix +++ b/pkgs/applications/video/shotcut/default.nix @@ -33,6 +33,8 @@ mkDerivation rec { sed 's_qApp->applicationDirPath(), "ffmpeg"_"${mlt.ffmpeg}/bin/ffmpeg"_' -i src/docks/encodedock.cpp NICE=$(type -P nice) sed "s_/usr/bin/nice_''${NICE}_" -i src/jobs/meltjob.cpp src/jobs/ffmpegjob.cpp + # Fix VAAPI auto-config: https://github.com/mltframework/shotcut/issues/771 + sed 's#"-vaapi_device" << ":0"#"-vaapi_device" << "/dev/dri/renderD128"#' -i src/docks/encodedock.cpp ''; qtWrapperArgs = [ -- cgit 1.4.1 From 83c2ad80ca8c6087b034155e2a767c4f72a6df3f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 18 Sep 2019 22:12:54 +0200 Subject: doc: re-format --- doc/coding-conventions.xml | 306 ++------ doc/configuration.xml | 184 ++--- doc/contributing.xml | 15 +- doc/cross-compilation.xml | 390 ++-------- doc/functions.xml | 3 +- doc/functions/appimagetools.xml | 32 +- doc/functions/debug.xml | 11 +- doc/functions/dockertools.xml | 224 ++---- doc/functions/fetchers.xml | 78 +- doc/functions/fhs-environments.xml | 38 +- doc/functions/generators.xml | 25 +- doc/functions/library.xml | 3 +- doc/functions/library/asserts.xml | 13 +- doc/functions/library/attrsets.xml | 145 ++-- doc/functions/nix-gitignore.xml | 24 +- doc/functions/ocitools.xml | 26 +- doc/functions/overrides.xml | 95 +-- doc/functions/prefer-remote-fetch.xml | 8 +- doc/functions/shell.xml | 4 +- doc/functions/snaptools.xml | 31 +- doc/functions/trivial-builders.xml | 46 +- doc/languages-frameworks/beam.xml | 163 +---- doc/languages-frameworks/bower.xml | 71 +- doc/languages-frameworks/coq.xml | 20 +- doc/languages-frameworks/gnome.xml | 185 +---- doc/languages-frameworks/go.xml | 73 +- doc/languages-frameworks/index.xml | 7 +- doc/languages-frameworks/java.xml | 40 +- doc/languages-frameworks/lua.xml | 20 +- doc/languages-frameworks/ocaml.xml | 32 +- doc/languages-frameworks/perl.xml | 98 +-- doc/languages-frameworks/qt.xml | 60 +- doc/languages-frameworks/ruby.xml | 37 +- doc/languages-frameworks/texlive.xml | 27 +- doc/meta.xml | 164 +---- doc/multiple-output.xml | 158 +--- doc/overlays.xml | 93 +-- doc/package-notes.xml | 262 ++----- doc/package-specific-user-notes.xml | 175 +---- doc/platform-notes.xml | 34 +- doc/quick-start.xml | 144 +--- doc/release-notes.xml | 260 ++----- doc/reviewing-contributions.xml | 160 ++-- doc/stdenv.xml | 1299 ++++++--------------------------- doc/submitting-changes.xml | 171 +---- 45 files changed, 1105 insertions(+), 4349 deletions(-) diff --git a/doc/coding-conventions.xml b/doc/coding-conventions.xml index 48356247a49e..799f1479467a 100644 --- a/doc/coding-conventions.xml +++ b/doc/coding-conventions.xml @@ -8,24 +8,17 @@ - Use 2 spaces of indentation per indentation level in Nix expressions, 4 - spaces in shell scripts. + Use 2 spaces of indentation per indentation level in Nix expressions, 4 spaces in shell scripts. - Do not use tab characters, i.e. configure your editor to use soft tabs. - For instance, use (setq-default indent-tabs-mode nil) - in Emacs. Everybody has different tab settings so it’s asking for - trouble. + Do not use tab characters, i.e. configure your editor to use soft tabs. For instance, use (setq-default indent-tabs-mode nil) in Emacs. Everybody has different tab settings so it’s asking for trouble. - Use lowerCamelCase for variable names, not - UpperCamelCase. Note, this rule does not apply to - package attribute names, which instead follow the rules in - . + Use lowerCamelCase for variable names, not UpperCamelCase. Note, this rule does not apply to package attribute names, which instead follow the rules in . @@ -52,8 +45,7 @@ foo { arg = ...; } - In attribute sets or lists that span multiple lines, the attribute names - or list elements should be aligned: + In attribute sets or lists that span multiple lines, the attribute names or list elements should be aligned: # A long list. list = [ @@ -97,8 +89,7 @@ attrs = { x = 1280; y = 1024; }; - Breaking in the middle of a function argument can give hard-to-read code, - like + Breaking in the middle of a function argument can give hard-to-read code, like someFunction { x = 1280; y = 1024; } otherArg @@ -123,8 +114,7 @@ in someFunction res otherArg yetAnotherArg - The bodies of functions, asserts, and withs are not indented to prevent a - lot of superfluous indentation levels, i.e. + The bodies of functions, asserts, and withs are not indented to prevent a lot of superfluous indentation levels, i.e. { arg1, arg2 }: assert system == "i686-linux"; @@ -156,8 +146,7 @@ stdenv.mkDerivation { ... - Functions should list their expected arguments as precisely as possible. - That is, write + Functions should list their expected arguments as precisely as possible. That is, write { stdenv, fetchurl, perl }: ... @@ -171,9 +160,7 @@ args: with args; ... - For functions that are truly generic in the number of arguments (such as - wrappers around mkDerivation) that have some required - arguments, you should write them using an @-pattern: + For functions that are truly generic in the number of arguments (such as wrappers around mkDerivation) that have some required arguments, you should write them using an @-pattern: { stdenv, doCoverageAnalysis ? false, ... } @ args: @@ -197,35 +184,20 @@ args.stdenv.mkDerivation (args // { Package naming - The key words must, must not, - required, shall, shall - not, should, should - not, recommended, may, - and optional in this section are to be interpreted as - described in RFC - 2119. Only emphasized words are to be - interpreted in this way. + The key words must, must not, required, shall, shall not, should, should not, recommended, may, and optional in this section are to be interpreted as described in RFC 2119. Only emphasized words are to be interpreted in this way. - In Nixpkgs, there are generally three different names associated with a - package: + In Nixpkgs, there are generally three different names associated with a package: - The name attribute of the derivation (excluding the - version part). This is what most users see, in particular when using - nix-env. + The name attribute of the derivation (excluding the version part). This is what most users see, in particular when using nix-env. - The variable name used for the instantiated package in - all-packages.nix, and when passing it as a - dependency to other functions. Typically this is called the - package attribute name. This is what Nix expression - authors see. It can also be used when installing using nix-env - -iA. + The variable name used for the instantiated package in all-packages.nix, and when passing it as a dependency to other functions. Typically this is called the package attribute name. This is what Nix expression authors see. It can also be used when installing using nix-env -iA. @@ -234,12 +206,7 @@ args.stdenv.mkDerivation (args // { - Most of the time, these are the same. For instance, the package - e2fsprogs has a name attribute - "e2fsprogs-version", is bound - to the variable name e2fsprogs in - all-packages.nix, and the Nix expression is in - pkgs/os-specific/linux/e2fsprogs/default.nix. + Most of the time, these are the same. For instance, the package e2fsprogs has a name attribute "e2fsprogs-version", is bound to the variable name e2fsprogs in all-packages.nix, and the Nix expression is in pkgs/os-specific/linux/e2fsprogs/default.nix. @@ -247,51 +214,32 @@ args.stdenv.mkDerivation (args // { - The name attribute should be - identical to the upstream package name. + The name attribute should be identical to the upstream package name. - The name attribute must not - contain uppercase letters — e.g., "mplayer-1.0rc2" - instead of "MPlayer-1.0rc2". + The name attribute must not contain uppercase letters — e.g., "mplayer-1.0rc2" instead of "MPlayer-1.0rc2". - The version part of the name attribute - must start with a digit (following a dash) — e.g., - "hello-0.3.1rc2". + The version part of the name attribute must start with a digit (following a dash) — e.g., "hello-0.3.1rc2". - If a package is not a release but a commit from a repository, then the - version part of the name must be the date of that - (fetched) commit. The date must be in - "YYYY-MM-DD" format. Also append - "unstable" to the name - e.g., - "pkgname-unstable-2014-09-23". + If a package is not a release but a commit from a repository, then the version part of the name must be the date of that (fetched) commit. The date must be in "YYYY-MM-DD" format. Also append "unstable" to the name - e.g., "pkgname-unstable-2014-09-23". - Dashes in the package name should be preserved in - new variable names, rather than converted to underscores or camel cased - — e.g., http-parser instead of - http_parser or httpParser. The - hyphenated style is preferred in all three package names. + Dashes in the package name should be preserved in new variable names, rather than converted to underscores or camel cased — e.g., http-parser instead of http_parser or httpParser. The hyphenated style is preferred in all three package names. - If there are multiple versions of a package, this - should be reflected in the variable names in - all-packages.nix, e.g. json-c-0-9 - and json-c-0-11. If there is an obvious “default” - version, make an attribute like json-c = json-c-0-9;. - See also + If there are multiple versions of a package, this should be reflected in the variable names in all-packages.nix, e.g. json-c-0-9 and json-c-0-11. If there is an obvious “default” version, make an attribute like json-c = json-c-0-9;. See also @@ -301,31 +249,18 @@ args.stdenv.mkDerivation (args // { File naming and organisation - Names of files and directories should be in lowercase, with dashes between - words — not in camel case. For instance, it should be - all-packages.nix, not - allPackages.nix or - AllPackages.nix. + Names of files and directories should be in lowercase, with dashes between words — not in camel case. For instance, it should be all-packages.nix, not allPackages.nix or AllPackages.nix.
Hierarchy - Each package should be stored in its own directory somewhere in the - pkgs/ tree, i.e. in - pkgs/category/subcategory/.../pkgname. - Below are some rules for picking the right category for a package. Many - packages fall under several categories; what matters is the - primary purpose of a package. For example, the - libxml2 package builds both a library and some tools; - but it’s a library foremost, so it goes under - pkgs/development/libraries. + Each package should be stored in its own directory somewhere in the pkgs/ tree, i.e. in pkgs/category/subcategory/.../pkgname. Below are some rules for picking the right category for a package. Many packages fall under several categories; what matters is the primary purpose of a package. For example, the libxml2 package builds both a library and some tools; but it’s a library foremost, so it goes under pkgs/development/libraries. - When in doubt, consider refactoring the pkgs/ tree, - e.g. creating new categories or splitting up an existing category. + When in doubt, consider refactoring the pkgs/ tree, e.g. creating new categories or splitting up an existing category. @@ -341,8 +276,7 @@ args.stdenv.mkDerivation (args // { - development/libraries (e.g. - libxml2) + development/libraries (e.g. libxml2) @@ -352,8 +286,7 @@ args.stdenv.mkDerivation (args // { - development/compilers (e.g. - gcc) + development/compilers (e.g. gcc) @@ -363,8 +296,7 @@ args.stdenv.mkDerivation (args // { - development/interpreters (e.g. - guile) + development/interpreters (e.g. guile) @@ -380,8 +312,7 @@ args.stdenv.mkDerivation (args // { - development/tools/parsing (e.g. - bison, flex) + development/tools/parsing (e.g. bison, flex) @@ -391,8 +322,7 @@ args.stdenv.mkDerivation (args // { - development/tools/build-managers (e.g. - gnumake) + development/tools/build-managers (e.g. gnumake) @@ -402,8 +332,7 @@ args.stdenv.mkDerivation (args // { - development/tools/misc (e.g. - binutils) + development/tools/misc (e.g. binutils) @@ -429,8 +358,7 @@ args.stdenv.mkDerivation (args // { - (A tool is a relatively small program, especially one intended to be - used non-interactively.) + (A tool is a relatively small program, especially one intended to be used non-interactively.) @@ -439,8 +367,7 @@ args.stdenv.mkDerivation (args // { - tools/networking (e.g. - wget) + tools/networking (e.g. wget) @@ -470,8 +397,7 @@ args.stdenv.mkDerivation (args // { - tools/archivers (e.g. zip, - tar) + tools/archivers (e.g. zip, tar) @@ -481,8 +407,7 @@ args.stdenv.mkDerivation (args // { - tools/compression (e.g. - gzip, bzip2) + tools/compression (e.g. gzip, bzip2) @@ -492,8 +417,7 @@ args.stdenv.mkDerivation (args // { - tools/security (e.g. nmap, - gnupg) + tools/security (e.g. nmap, gnupg) @@ -532,8 +456,7 @@ args.stdenv.mkDerivation (args // { - servers/http (e.g. - apache-httpd) + servers/http (e.g. apache-httpd) @@ -543,8 +466,7 @@ args.stdenv.mkDerivation (args // { - servers/x11 (e.g. xorg — - this includes the client libraries and programs) + servers/x11 (e.g. xorg — this includes the client libraries and programs) @@ -567,8 +489,7 @@ args.stdenv.mkDerivation (args // { - desktops (e.g. kde, - gnome, enlightenment) + desktops (e.g. kde, gnome, enlightenment) @@ -578,8 +499,7 @@ args.stdenv.mkDerivation (args // { - applications/window-managers (e.g. - awesome, stumpwm) + applications/window-managers (e.g. awesome, stumpwm) @@ -589,8 +509,7 @@ args.stdenv.mkDerivation (args // { - A (typically large) program with a distinct user interface, primarily - used interactively. + A (typically large) program with a distinct user interface, primarily used interactively. @@ -599,8 +518,7 @@ args.stdenv.mkDerivation (args // { - applications/version-management (e.g. - subversion) + applications/version-management (e.g. subversion) @@ -610,8 +528,7 @@ args.stdenv.mkDerivation (args // { - applications/video (e.g. - vlc) + applications/video (e.g. vlc) @@ -621,8 +538,7 @@ args.stdenv.mkDerivation (args // { - applications/graphics (e.g. - gimp) + applications/graphics (e.g. gimp) @@ -638,8 +554,7 @@ args.stdenv.mkDerivation (args // { - applications/networking/mailreaders (e.g. - thunderbird) + applications/networking/mailreaders (e.g. thunderbird) @@ -649,8 +564,7 @@ args.stdenv.mkDerivation (args // { - applications/networking/newsreaders (e.g. - pan) + applications/networking/newsreaders (e.g. pan) @@ -660,8 +574,7 @@ args.stdenv.mkDerivation (args // { - applications/networking/browsers (e.g. - firefox) + applications/networking/browsers (e.g. firefox) @@ -719,8 +632,7 @@ args.stdenv.mkDerivation (args // { - data/sgml+xml/schemas/xml-dtd (e.g. - docbook) + data/sgml+xml/schemas/xml-dtd (e.g. docbook) @@ -733,8 +645,7 @@ args.stdenv.mkDerivation (args // { (Okay, these are executable...) - data/sgml+xml/stylesheets/xslt (e.g. - docbook-xsl) + data/sgml+xml/stylesheets/xslt (e.g. docbook-xsl) @@ -771,36 +682,15 @@ args.stdenv.mkDerivation (args // { Versioning - Because every version of a package in Nixpkgs creates a potential - maintenance burden, old versions of a package should not be kept unless - there is a good reason to do so. For instance, Nixpkgs contains several - versions of GCC because other packages don’t build with the latest - version of GCC. Other examples are having both the latest stable and latest - pre-release version of a package, or to keep several major releases of an - application that differ significantly in functionality. + Because every version of a package in Nixpkgs creates a potential maintenance burden, old versions of a package should not be kept unless there is a good reason to do so. For instance, Nixpkgs contains several versions of GCC because other packages don’t build with the latest version of GCC. Other examples are having both the latest stable and latest pre-release version of a package, or to keep several major releases of an application that differ significantly in functionality. - If there is only one version of a package, its Nix expression should be - named e2fsprogs/default.nix. If there are multiple - versions, this should be reflected in the filename, e.g. - e2fsprogs/1.41.8.nix and - e2fsprogs/1.41.9.nix. The version in the filename - should leave out unnecessary detail. For instance, if we keep the latest - Firefox 2.0.x and 3.5.x versions in Nixpkgs, they should be named - firefox/2.0.nix and - firefox/3.5.nix, respectively (which, at a given - point, might contain versions 2.0.0.20 and - 3.5.4). If a version requires many auxiliary files, you - can use a subdirectory for each version, e.g. - firefox/2.0/default.nix and - firefox/3.5/default.nix. + If there is only one version of a package, its Nix expression should be named e2fsprogs/default.nix. If there are multiple versions, this should be reflected in the filename, e.g. e2fsprogs/1.41.8.nix and e2fsprogs/1.41.9.nix. The version in the filename should leave out unnecessary detail. For instance, if we keep the latest Firefox 2.0.x and 3.5.x versions in Nixpkgs, they should be named firefox/2.0.nix and firefox/3.5.nix, respectively (which, at a given point, might contain versions 2.0.0.20 and 3.5.4). If a version requires many auxiliary files, you can use a subdirectory for each version, e.g. firefox/2.0/default.nix and firefox/3.5/default.nix. - All versions of a package must be included in - all-packages.nix to make sure that they evaluate - correctly. + All versions of a package must be included in all-packages.nix to make sure that they evaluate correctly.
@@ -808,25 +698,15 @@ args.stdenv.mkDerivation (args // { Fetching Sources - There are multiple ways to fetch a package source in nixpkgs. The general - guideline is that you should package reproducible sources with a high degree - of availability. Right now there is only one fetcher which has mirroring - support and that is fetchurl. Note that you should also - prefer protocols which have a corresponding proxy environment variable. + There are multiple ways to fetch a package source in nixpkgs. The general guideline is that you should package reproducible sources with a high degree of availability. Right now there is only one fetcher which has mirroring support and that is fetchurl. Note that you should also prefer protocols which have a corresponding proxy environment variable. - You can find many source fetch helpers in - pkgs/build-support/fetch*. + You can find many source fetch helpers in pkgs/build-support/fetch*. - In the file pkgs/top-level/all-packages.nix you can find - fetch helpers, these have names on the form fetchFrom*. - The intention of these are to provide snapshot fetches but using the same - api as some of the version controlled fetchers from - pkgs/build-support/. As an example going from bad to - good: + In the file pkgs/top-level/all-packages.nix you can find fetch helpers, these have names on the form fetchFrom*. The intention of these are to provide snapshot fetches but using the same api as some of the version controlled fetchers from pkgs/build-support/. As an example going from bad to good: @@ -863,11 +743,7 @@ src = fetchFromGitHub { sha256 = "1i2yxndxb6yc9l6c99pypbd92lfq5aac4klq7y2v93c9qvx2cgpc"; } - Find the value to put as sha256 by running - nix run -f '<nixpkgs>' nix-prefetch-github -c - nix-prefetch-github --rev 1f795f9f44607cc5bec70d1300150bfefcef2aae NixOS - nix or nix-prefetch-url --unpack - https://github.com/NixOS/nix/archive/1f795f9f44607cc5bec70d1300150bfefcef2aae.tar.gz. + Find the value to put as sha256 by running nix run -f '<nixpkgs>' nix-prefetch-github -c nix-prefetch-github --rev 1f795f9f44607cc5bec70d1300150bfefcef2aae NixOS nix or nix-prefetch-url --unpack https://github.com/NixOS/nix/archive/1f795f9f44607cc5bec70d1300150bfefcef2aae.tar.gz. @@ -883,40 +759,23 @@ src = fetchFromGitHub { - Prefetch URL (with nix-prefetch-XXX - URL, where - XXX is one of url, - git, hg, cvs, - bzr, svn). Hash is printed to - stdout. + Prefetch URL (with nix-prefetch-XXX URL, where XXX is one of url, git, hg, cvs, bzr, svn). Hash is printed to stdout. - Prefetch by package source (with nix-prefetch-url - '<nixpkgs>' -A PACKAGE.src, - where PACKAGE is package attribute name). Hash - is printed to stdout. + Prefetch by package source (with nix-prefetch-url '<nixpkgs>' -A PACKAGE.src, where PACKAGE is package attribute name). Hash is printed to stdout. - This works well when you've upgraded existing package version and want to - find out new hash, but is useless if package can't be accessed by - attribute or package has multiple sources (.srcs, - architecture-dependent sources, etc). + This works well when you've upgraded existing package version and want to find out new hash, but is useless if package can't be accessed by attribute or package has multiple sources (.srcs, architecture-dependent sources, etc). - Upstream provided hash: use it when upstream provides - sha256 or sha512 (when upstream - provides md5, don't use it, compute - sha256 instead). + Upstream provided hash: use it when upstream provides sha256 or sha512 (when upstream provides md5, don't use it, compute sha256 instead). - A little nuance is that nix-prefetch-* tools produce - hash encoded with base32, but upstream usually provides - hexadecimal (base16) encoding. Fetchers understand both - formats. Nixpkgs does not standardize on any one format. + A little nuance is that nix-prefetch-* tools produce hash encoded with base32, but upstream usually provides hexadecimal (base16) encoding. Fetchers understand both formats. Nixpkgs does not standardize on any one format. You can convert between formats with nix-hash, for example: @@ -927,28 +786,18 @@ src = fetchFromGitHub { - Extracting hash from local source tarball can be done with - sha256sum. Use nix-prefetch-url - file:///path/to/tarball if you want base32 hash. + Extracting hash from local source tarball can be done with sha256sum. Use nix-prefetch-url file:///path/to/tarball if you want base32 hash. - Fake hash: set fake hash in package expression, perform build and extract - correct hash from error Nix prints. + Fake hash: set fake hash in package expression, perform build and extract correct hash from error Nix prints. - For package updates it is enough to change one symbol to make hash fake. - For new packages, you can use lib.fakeSha256, - lib.fakeSha512 or any other fake hash. + For package updates it is enough to change one symbol to make hash fake. For new packages, you can use lib.fakeSha256, lib.fakeSha512 or any other fake hash. - This is last resort method when reconstructing source URL is non-trivial - and nix-prefetch-url -A isn't applicable (for example, - - one of kodi dependencies). The easiest way then - would be replace hash with a fake one and rebuild. Nix build will fail and - error message will contain desired hash. + This is last resort method when reconstructing source URL is non-trivial and nix-prefetch-url -A isn't applicable (for example, one of kodi dependencies). The easiest way then would be replace hash with a fake one and rebuild. Nix build will fail and error message will contain desired hash. @@ -962,9 +811,7 @@ src = fetchFromGitHub { Obtaining hashes securely - Let's say Man-in-the-Middle (MITM) sits close to your network. Then instead - of fetching source you can fetch malware, and instead of source hash you - get hash of malware. Here are security considerations for this scenario: + Let's say Man-in-the-Middle (MITM) sits close to your network. Then instead of fetching source you can fetch malware, and instead of source hash you get hash of malware. Here are security considerations for this scenario: @@ -975,8 +822,7 @@ src = fetchFromGitHub { - hashes from upstream (in method 3) should be obtained via secure - protocol; + hashes from upstream (in method 3) should be obtained via secure protocol; @@ -986,12 +832,7 @@ src = fetchFromGitHub { - https:// URLs are not secure in method 5. When - obtaining hashes with fake hash method, TLS checks are disabled. So - refetch source hash from several different networks to exclude MITM - scenario. Alternatively, use fake hash method to make Nix error, but - instead of extracting hash from error, extract - https:// URL and prefetch it with method 1. + https:// URLs are not secure in method 5. When obtaining hashes with fake hash method, TLS checks are disabled. So refetch source hash from several different networks to exclude MITM scenario. Alternatively, use fake hash method to make Nix error, but instead of extracting hash from error, extract https:// URL and prefetch it with method 1. @@ -1001,8 +842,7 @@ src = fetchFromGitHub { Patches - Patches available online should be retrieved using - fetchpatch. + Patches available online should be retrieved using fetchpatch. @@ -1018,10 +858,7 @@ patches = [ - Otherwise, you can add a .patch file to the - nixpkgs repository. In the interest of keeping our - maintenance burden to a minimum, only patches that are unique to - nixpkgs should be added in this way. + Otherwise, you can add a .patch file to the nixpkgs repository. In the interest of keeping our maintenance burden to a minimum, only patches that are unique to nixpkgs should be added in this way. @@ -1031,8 +868,7 @@ patches = [ ./0001-changes.patch ]; - If you do need to do create this sort of patch file, one way to do so is - with git: + If you do need to do create this sort of patch file, one way to do so is with git: @@ -1043,8 +879,7 @@ patches = [ ./0001-changes.patch ]; - If a git repository is not already present, create one and stage all of - the source files. + If a git repository is not already present, create one and stage all of the source files. $ git init $ git add . @@ -1052,8 +887,7 @@ patches = [ ./0001-changes.patch ]; - Edit some files to make whatever changes need to be included in the - patch. + Edit some files to make whatever changes need to be included in the patch. diff --git a/doc/configuration.xml b/doc/configuration.xml index b497fa4e2722..cb660452d828 100644 --- a/doc/configuration.xml +++ b/doc/configuration.xml @@ -3,49 +3,38 @@ xml:id="chap-packageconfig"> Global configuration - Nix comes with certain defaults about what packages can and cannot be - installed, based on a package's metadata. By default, Nix will prevent - installation if any of the following criteria are true: + Nix comes with certain defaults about what packages can and cannot be installed, based on a package's metadata. By default, Nix will prevent installation if any of the following criteria are true: - The package is thought to be broken, and has had its - meta.broken set to true. + The package is thought to be broken, and has had its meta.broken set to true. - The package isn't intended to run on the given system, as none of its - meta.platforms match the given system. + The package isn't intended to run on the given system, as none of its meta.platforms match the given system. - The package's meta.license is set to a license which is - considered to be unfree. + The package's meta.license is set to a license which is considered to be unfree. - The package has known security vulnerabilities but has not or can not be - updated for some reason, and a list of issues has been entered in to the - package's meta.knownVulnerabilities. + The package has known security vulnerabilities but has not or can not be updated for some reason, and a list of issues has been entered in to the package's meta.knownVulnerabilities. - Note that all this is checked during evaluation already, and the check - includes any package that is evaluated. In particular, all build-time - dependencies are checked. nix-env -qa will (attempt to) - hide any packages that would be refused. + Note that all this is checked during evaluation already, and the check includes any package that is evaluated. In particular, all build-time dependencies are checked. nix-env -qa will (attempt to) hide any packages that would be refused. Each of these criteria can be altered in the nixpkgs configuration. - The nixpkgs configuration for a NixOS system is set in the - configuration.nix, as in the following example: + The nixpkgs configuration for a NixOS system is set in the configuration.nix, as in the following example: { nixpkgs.config = { @@ -53,13 +42,10 @@ }; } - 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. - A user's of nixpkgs configuration is stored in a user-specific configuration - file located at ~/.config/nixpkgs/config.nix. For - example: + A user's of nixpkgs configuration is stored in a user-specific configuration file located at ~/.config/nixpkgs/config.nix. For example: { allowUnfree = true; @@ -67,31 +53,25 @@ - Note that we are not able to test or build unfree software on Hydra due to - policy. Most unfree licenses prohibit us from either executing or - distributing the software. + Note that we are not able to test or build unfree software on Hydra due to policy. Most unfree licenses prohibit us from either executing or distributing the software.
Installing broken packages - There are two ways to try compiling a package which has been marked as - broken. + There are two ways to try compiling a package which has been marked as broken. - For allowing the build of a broken package once, you can use an - environment variable for a single invocation of the nix tools: + For allowing the build of a broken package once, you can use an environment variable for a single invocation of the nix tools: $ export NIXPKGS_ALLOW_BROKEN=1 - For permanently allowing broken packages to be built, you may add - allowBroken = true; to your user's configuration file, - like this: + For permanently allowing broken packages to be built, you may add allowBroken = true; to your user's configuration file, like this: { allowBroken = true; @@ -105,23 +85,19 @@ Installing packages on unsupported systems - There are also two ways to try compiling a package which has been marked as - unsuported for the given system. + There are also two ways to try compiling a package which has been marked as unsuported for the given system. - For allowing the build of a broken package once, you can use an - environment variable for a single invocation of the nix tools: + For allowing the build of a broken package once, you can use an environment variable for a single invocation of the nix tools: $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 - For permanently allowing broken packages to be built, you may add - allowUnsupportedSystem = true; to your user's - configuration file, like this: + For permanently allowing broken packages to be built, you may add allowUnsupportedSystem = true; to your user's configuration file, like this: { allowUnsupportedSystem = true; @@ -132,42 +108,29 @@ - The difference between a package being unsupported on some system and being - broken is admittedly a bit fuzzy. If a program ought to - work on a certain platform, but doesn't, the platform should be included in - meta.platforms, but marked as broken with e.g. - meta.broken = !hostPlatform.isWindows. Of course, this - begs the question of what "ought" means exactly. That is left to the package - maintainer. + The difference between a package being unsupported on some system and being broken is admittedly a bit fuzzy. If a program ought to work on a certain platform, but doesn't, the platform should be included in meta.platforms, but marked as broken with e.g. meta.broken = !hostPlatform.isWindows. Of course, this begs the question of what "ought" means exactly. That is left to the package maintainer.
Installing unfree packages - There are several ways to tweak how Nix handles a package which has been - marked as unfree. + There are several ways to tweak how Nix handles a package which has been marked as unfree. - To temporarily allow all unfree packages, you can use an environment - variable for a single invocation of the nix tools: + To temporarily allow all unfree packages, you can use an environment variable for a single invocation of the nix tools: $ export NIXPKGS_ALLOW_UNFREE=1 - It is possible to permanently allow individual unfree packages, while - still blocking unfree packages by default using the - allowUnfreePredicate configuration option in the user - configuration file. + It is possible to permanently allow individual unfree packages, while still blocking unfree packages by default using the allowUnfreePredicate configuration option in the user configuration file. - This option is a function which accepts a package as a parameter, and - returns a boolean. The following example configuration accepts a package - and always returns false: + This option is a function which accepts a package as a parameter, and returns a boolean. The following example configuration accepts a package and always returns false: { allowUnfreePredicate = (pkg: false); @@ -175,8 +138,7 @@ - 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: { allowUnfreePredicate = (pkg: builtins.elem @@ -190,14 +152,10 @@ - It is also possible to whitelist and blacklist licenses that are - specifically acceptable or not acceptable, using - whitelistedLicenses and - blacklistedLicenses, respectively. + It is also possible to whitelist and blacklist licenses that are specifically acceptable or not acceptable, using whitelistedLicenses and blacklistedLicenses, respectively. - The following example configuration whitelists the licenses - amd and wtfpl: + The following example configuration whitelists the licenses amd and wtfpl: { whitelistedLicenses = with stdenv.lib.licenses; [ amd wtfpl ]; @@ -205,8 +163,7 @@ - The following example configuration blacklists the gpl3 - and agpl3 licenses: + The following example configuration blacklists the gpl3 and agpl3 licenses: { blacklistedLicenses = with stdenv.lib.licenses; [ agpl3 gpl3 ]; @@ -217,37 +174,29 @@ - A complete list of licenses can be found in the file - lib/licenses.nix of the nixpkgs tree. + A complete list of licenses can be found in the file lib/licenses.nix of the nixpkgs tree.
Installing insecure packages - There are several ways to tweak how Nix handles a package which has been - marked as insecure. + There are several ways to tweak how Nix handles a package which has been marked as insecure. - To temporarily allow all insecure packages, you can use an environment - variable for a single invocation of the nix tools: + To temporarily allow all insecure packages, you can use an environment variable for a single invocation of the nix tools: $ export NIXPKGS_ALLOW_INSECURE=1 - It is possible to permanently allow individual insecure packages, while - still blocking other insecure packages by default using the - permittedInsecurePackages configuration option in the - user configuration file. + It is possible to permanently allow individual insecure packages, while still blocking other insecure packages by default using the permittedInsecurePackages configuration option in the user configuration file. - The following example configuration permits the installation of the - hypothetically insecure package hello, version - 1.2.3: + The following example configuration permits the installation of the hypothetically insecure package hello, version 1.2.3: { permittedInsecurePackages = [ @@ -259,18 +208,13 @@ - It is also possible to create a custom policy around which insecure - packages to allow and deny, by overriding the - allowInsecurePredicate configuration option. + It is also possible to create a custom policy around which insecure packages to allow and deny, by overriding the allowInsecurePredicate configuration option. - The allowInsecurePredicate option is a function which - accepts a package and returns a boolean, much like - allowUnfreePredicate. + The allowInsecurePredicate option is a function which accepts a package and returns a boolean, much like allowUnfreePredicate. - The following configuration example only allows insecure packages with - very short names: + The following configuration example only allows insecure packages with very short names: { allowInsecurePredicate = (pkg: (builtins.stringLength (builtins.parseDrvName pkg.name).name) <= 5); @@ -278,8 +222,7 @@ - Note that permittedInsecurePackages is only checked if - allowInsecurePredicate is not specified. + Note that permittedInsecurePackages is only checked if allowInsecurePredicate is not specified. @@ -289,10 +232,7 @@ Modify packages via <literal>packageOverrides</literal> - You can define a function called packageOverrides in your - local ~/.config/nixpkgs/config.nix to override Nix - packages. It must be a function that takes pkgs as an argument and returns a - modified set of packages. + You can define a function called packageOverrides in your local ~/.config/nixpkgs/config.nix to override Nix packages. It must be a function that takes pkgs as an argument and returns a modified set of packages. { packageOverrides = pkgs: rec { @@ -309,15 +249,7 @@ Build an environment - Using packageOverrides, it is possible to manage - packages declaratively. This means that we can list all of our desired - packages within a declarative Nix expression. For example, to have - aspell, bc, - ffmpeg, coreutils, - gdb, nixUnstable, - emscripten, jq, - nox, and silver-searcher, we could - use the following in ~/.config/nixpkgs/config.nix: + Using packageOverrides, it is possible to manage packages declaratively. This means that we can list all of our desired packages within a declarative Nix expression. For example, to have aspell, bc, ffmpeg, coreutils, gdb, nixUnstable, emscripten, jq, nox, and silver-searcher, we could use the following in ~/.config/nixpkgs/config.nix: @@ -343,13 +275,7 @@ - To install it into our environment, you can just run nix-env -iA - nixpkgs.myPackages. If you want to load the packages to be built - from a working copy of nixpkgs you just run - nix-env -f. -iA myPackages. To explore what's been - installed, just look through ~/.nix-profile/. You can - see that a lot of stuff has been installed. Some of this stuff is useful - some of it isn't. Let's tell Nixpkgs to only link the stuff that we want: + To install it into our environment, you can just run nix-env -iA nixpkgs.myPackages. If you want to load the packages to be built from a working copy of nixpkgs you just run nix-env -f. -iA myPackages. To explore what's been installed, just look through ~/.nix-profile/. You can see that a lot of stuff has been installed. Some of this stuff is useful some of it isn't. Let's tell Nixpkgs to only link the stuff that we want: @@ -376,12 +302,7 @@ - pathsToLink tells Nixpkgs to only link the paths listed - which gets rid of the extra stuff in the profile. /bin - and /share are good defaults for a user environment, - getting rid of the clutter. If you are running on Nix on MacOS, you may - want to add another path as well, /Applications, that - makes GUI apps available. + pathsToLink tells Nixpkgs to only link the paths listed which gets rid of the extra stuff in the profile. /bin and /share are good defaults for a user environment, getting rid of the clutter. If you are running on Nix on MacOS, you may want to add another path as well, /Applications, that makes GUI apps available.
@@ -389,13 +310,7 @@ Getting documentation - After building that new environment, look through - ~/.nix-profile to make sure everything is there that - we wanted. Discerning readers will note that some files are missing. Look - inside ~/.nix-profile/share/man/man1/ to verify this. - There are no man pages for any of the Nix tools! This is because some - packages like Nix have multiple outputs for things like documentation (see - section 4). Let's make Nix install those as well. + After building that new environment, look through ~/.nix-profile to make sure everything is there that we wanted. Discerning readers will note that some files are missing. Look inside ~/.nix-profile/share/man/man1/ to verify this. There are no man pages for any of the Nix tools! This is because some packages like Nix have multiple outputs for things like documentation (see section 4). Let's make Nix install those as well. @@ -422,9 +337,7 @@ - This provides us with some useful documentation for using our packages. - However, if we actually want those manpages to be detected by man, we need - to set up our environment. This can also be managed within Nix expressions. + This provides us with some useful documentation for using our packages. However, if we actually want those manpages to be detected by man, we need to set up our environment. This can also be managed within Nix expressions. @@ -460,9 +373,7 @@ - For this to work fully, you must also have this script sourced when you are - logged in. Try adding something like this to your - ~/.profile file: + For this to work fully, you must also have this script sourced when you are logged in. Try adding something like this to your ~/.profile file: @@ -477,8 +388,7 @@ fi - Now just run source $HOME/.profile and you can starting - loading man pages from your environent. + Now just run source $HOME/.profile and you can starting loading man pages from your environent. @@ -486,9 +396,7 @@ fi GNU info setup - Configuring GNU info is a little bit trickier than man pages. To work - correctly, info needs a database to be generated. This can be done with - some small modifications to our environment scripts. + Configuring GNU info is a little bit trickier than man pages. To work correctly, info needs a database to be generated. This can be done with some small modifications to our environment scripts. @@ -534,11 +442,7 @@ fi - postBuild tells Nixpkgs to run a command after building - the environment. In this case, install-info adds the - installed info pages to dir which is GNU info's default - root node. Note that texinfoInteractive is added to the - environment to give the install-info command. + postBuild tells Nixpkgs to run a command after building the environment. In this case, install-info adds the installed info pages to dir which is GNU info's default root node. Note that texinfoInteractive is added to the environment to give the install-info command. diff --git a/doc/contributing.xml b/doc/contributing.xml index 523c1c9c8f03..b0266043775f 100644 --- a/doc/contributing.xml +++ b/doc/contributing.xml @@ -3,10 +3,8 @@ xml:id="chap-contributing"> Contributing to this documentation - The DocBook sources of the Nixpkgs manual are in the - doc - subdirectory of the Nixpkgs repository. + The DocBook sources of the Nixpkgs manual are in the doc subdirectory of the Nixpkgs repository. You can quickly check your edits with make: @@ -17,19 +15,16 @@ xlink:href="https://github.com/NixOS/nixpkgs/tree/master/doc">doc [nix-shell]$ make - If you experience problems, run make debug to help - understand the docbook errors. + If you experience problems, run make debug to help understand the docbook errors. - After making modifications to the manual, it's important to build it before - committing. You can do that as follows: + After making modifications to the manual, it's important to build it before committing. You can do that as follows: $ cd /path/to/nixpkgs/doc $ nix-shell [nix-shell]$ make clean [nix-shell]$ nix-build . - If the build succeeds, the manual will be in - ./result/share/doc/nixpkgs/manual.html. + If the build succeeds, the manual will be in ./result/share/doc/nixpkgs/manual.html. diff --git a/doc/cross-compilation.xml b/doc/cross-compilation.xml index d212706e1713..f496fa3f8967 100644 --- a/doc/cross-compilation.xml +++ b/doc/cross-compilation.xml @@ -6,25 +6,11 @@ Introduction - "Cross-compilation" means compiling a program on one machine for another - type of machine. For example, a typical use of cross-compilation is to - compile programs for embedded devices. These devices often don't have the - computing power and memory to compile their own programs. One might think - that cross-compilation is a fairly niche concern. However, there are - significant advantages to rigorously distinguishing between build-time and - run-time environments! Significant, because the benefits apply even when one - is developing and deploying on the same machine. Nixpkgs is increasingly - adopting the opinion that packages should be written with cross-compilation - in mind, and nixpkgs should evaluate in a similar way (by minimizing - cross-compilation-specific special cases) whether or not one is - cross-compiling. + "Cross-compilation" means compiling a program on one machine for another type of machine. For example, a typical use of cross-compilation is to compile programs for embedded devices. These devices often don't have the computing power and memory to compile their own programs. One might think that cross-compilation is a fairly niche concern. However, there are significant advantages to rigorously distinguishing between build-time and run-time environments! Significant, because the benefits apply even when one is developing and deploying on the same machine. Nixpkgs is increasingly adopting the opinion that packages should be written with cross-compilation in mind, and nixpkgs should evaluate in a similar way (by minimizing cross-compilation-specific special cases) whether or not one is cross-compiling. - This chapter will be organized in three parts. First, it will describe the - basics of how to package software in a way that supports cross-compilation. - Second, it will describe how to use Nixpkgs when cross-compiling. Third, it - will describe the internal infrastructure supporting cross-compilation. + This chapter will be organized in three parts. First, it will describe the basics of how to package software in a way that supports cross-compilation. Second, it will describe how to use Nixpkgs when cross-compiling. Third, it will describe the internal infrastructure supporting cross-compilation. @@ -35,24 +21,12 @@ Platform parameters - Nixpkgs follows the - conventions - of GNU autoconf. We distinguish between 3 types of platforms when - building a derivation: build, - host, and target. In - summary, build is the platform on which a package - is being built, host is the platform on which it - will run. The third attribute, target, is relevant - only for certain specific compilers and build tools. + Nixpkgs follows the conventions of GNU autoconf. We distinguish between 3 types of platforms when building a derivation: build, host, and target. In summary, build is the platform on which a package is being built, host is the platform on which it will run. The third attribute, target, is relevant only for certain specific compilers and build tools. - In Nixpkgs, these three platforms are defined as attribute sets under the - names buildPlatform, hostPlatform, - and targetPlatform. They are always defined as - attributes in the standard environment. That means one can access them - like: + In Nixpkgs, these three platforms are defined as attribute sets under the names buildPlatform, hostPlatform, and targetPlatform. They are always defined as attributes in the standard environment. That means one can access them like: { stdenv, fooDep, barDep, .. }: ...stdenv.buildPlatform... . @@ -64,9 +38,7 @@ - The "build platform" is the platform on which a package is built. Once - someone has a built package, or pre-built binary package, the build - platform should not matter and can be ignored. + The "build platform" is the platform on which a package is built. Once someone has a built package, or pre-built binary package, the build platform should not matter and can be ignored. @@ -76,9 +48,7 @@ - The "host platform" is the platform on which a package will be run. This - is the simplest platform to understand, but also the one with the worst - name. + The "host platform" is the platform on which a package will be run. This is the simplest platform to understand, but also the one with the worst name. @@ -88,44 +58,23 @@ - The "target platform" attribute is, unlike the other two attributes, not - actually fundamental to the process of building software. Instead, it is - only relevant for compatibility with building certain specific compilers - and build tools. It can be safely ignored for all other packages. + The "target platform" attribute is, unlike the other two attributes, not actually fundamental to the process of building software. Instead, it is only relevant for compatibility with building certain specific compilers and build tools. It can be safely ignored for all other packages. - The build process of certain compilers is written in such a way that the - compiler resulting from a single build can itself only produce binaries - for a single platform. The task of specifying this single "target - platform" is thus pushed to build time of the compiler. The root cause - of this is that the compiler (which will be run on the host) and the - standard library/runtime (which will be run on the target) are built by - a single build process. + The build process of certain compilers is written in such a way that the compiler resulting from a single build can itself only produce binaries for a single platform. The task of specifying this single "target platform" is thus pushed to build time of the compiler. The root cause of this is that the compiler (which will be run on the host) and the standard library/runtime (which will be run on the target) are built by a single build process. - There is no fundamental need to think about a single target ahead of - time like this. If the tool supports modular or pluggable backends, both - the need to specify the target at build time and the constraint of - having only a single target disappear. An example of such a tool is - LLVM. + There is no fundamental need to think about a single target ahead of time like this. If the tool supports modular or pluggable backends, both the need to specify the target at build time and the constraint of having only a single target disappear. An example of such a tool is LLVM. - Although the existence of a "target platfom" is arguably a historical - mistake, it is a common one: examples of tools that suffer from it are - GCC, Binutils, GHC and Autoconf. Nixpkgs tries to avoid sharing in the - mistake where possible. Still, because the concept of a target platform - is so ingrained, it is best to support it as is. + Although the existence of a "target platfom" is arguably a historical mistake, it is a common one: examples of tools that suffer from it are GCC, Binutils, GHC and Autoconf. Nixpkgs tries to avoid sharing in the mistake where possible. Still, because the concept of a target platform is so ingrained, it is best to support it as is. - The exact schema these fields follow is a bit ill-defined due to a long and - convoluted evolution, but this is slowly being cleaned up. You can see - examples of ones used in practice in - lib.systems.examples; note how they are not all very - consistent. For now, here are few fields can count on them containing: + The exact schema these fields follow is a bit ill-defined due to a long and convoluted evolution, but this is slowly being cleaned up. You can see examples of ones used in practice in lib.systems.examples; note how they are not all very consistent. For now, here are few fields can count on them containing: @@ -135,13 +84,7 @@ - This is a two-component shorthand for the platform. Examples of this - would be "x86_64-darwin" and "i686-linux"; see - lib.systems.doubles for more. The first component - corresponds to the CPU architecture of the platform and the second to - the operating system of the platform ([cpu]-[os]). - This format has built-in support in Nix, such as the - builtins.currentSystem impure string. + This is a two-component shorthand for the platform. Examples of this would be "x86_64-darwin" and "i686-linux"; see lib.systems.doubles for more. The first component corresponds to the CPU architecture of the platform and the second to the operating system of the platform ([cpu]-[os]). This format has built-in support in Nix, such as the builtins.currentSystem impure string. @@ -151,15 +94,7 @@ - This is a 3- or 4- component shorthand for the platform. Examples of - this would be x86_64-unknown-linux-gnu and - aarch64-apple-darwin14. This is a standard format - called the "LLVM target triple", as they are pioneered by LLVM. In the - 4-part form, this corresponds to - [cpu]-[vendor]-[os]-[abi]. This format is strictly - more informative than the "Nix host double", as the previous format - could analogously be termed. This needs a better name than - config! + This is a 3- or 4- component shorthand for the platform. Examples of this would be x86_64-unknown-linux-gnu and aarch64-apple-darwin14. This is a standard format called the "LLVM target triple", as they are pioneered by LLVM. In the 4-part form, this corresponds to [cpu]-[vendor]-[os]-[abi]. This format is strictly more informative than the "Nix host double", as the previous format could analogously be termed. This needs a better name than config! @@ -169,10 +104,7 @@ - This is a Nix representation of a parsed LLVM target triple with - white-listed components. This can be specified directly, or actually - parsed from the config. See - lib.systems.parse for the exact representation. + This is a Nix representation of a parsed LLVM target triple with white-listed components. This can be specified directly, or actually parsed from the config. See lib.systems.parse for the exact representation. @@ -182,10 +114,7 @@ - This is a string identifying the standard C library used. Valid - identifiers include "glibc" for GNU libc, "libSystem" for Darwin's - Libsystem, and "uclibc" for µClibc. It should probably be refactored to - use the module system, like parse. + This is a string identifying the standard C library used. Valid identifiers include "glibc" for GNU libc, "libSystem" for Darwin's Libsystem, and "uclibc" for µClibc. It should probably be refactored to use the module system, like parse. @@ -195,10 +124,7 @@ - These predicates are defined in lib.systems.inspect, - and slapped onto every platform. They are superior to the ones in - stdenv as they force the user to be explicit about - which platform they are inspecting. Please use these instead of those. + These predicates are defined in lib.systems.inspect, and slapped onto every platform. They are superior to the ones in stdenv as they force the user to be explicit about which platform they are inspecting. Please use these instead of those. @@ -208,11 +134,7 @@ - This is, quite frankly, a dumping ground of ad-hoc settings (it's an - attribute set). See lib.systems.platforms for - examples—there's hopefully one in there that will work verbatim for - each platform that is working. Please help us triage these flags and - give them better homes! + This is, quite frankly, a dumping ground of ad-hoc settings (it's an attribute set). See lib.systems.platforms for examples—there's hopefully one in there that will work verbatim for each platform that is working. Please help us triage these flags and give them better homes! @@ -224,62 +146,33 @@ - This is a rather philosophical description that isn't very - Nixpkgs-specific. For an overview of all the relevant attributes given to - mkDerivation, see - . For a description of how - everything is implemented, see - . + This is a rather philosophical description that isn't very Nixpkgs-specific. For an overview of all the relevant attributes given to mkDerivation, see . For a description of how everything is implemented, see . - In this section we explore the relationship between both runtime and - build-time dependencies and the 3 Autoconf platforms. + In this section we explore the relationship between both runtime and build-time dependencies and the 3 Autoconf platforms. - A run time dependency between two packages requires that their host - platforms match. This is directly implied by the meaning of "host platform" - and "runtime dependency": The package dependency exists while both packages - are running on a single host platform. + A run time dependency between two packages requires that their host platforms match. This is directly implied by the meaning of "host platform" and "runtime dependency": The package dependency exists while both packages are running on a single host platform. - A build time dependency, however, has a shift in platforms between the - depending package and the depended-on package. "build time dependency" - means that to build the depending package we need to be able to run the - depended-on's package. The depending package's build platform is therefore - equal to the depended-on package's host platform. + A build time dependency, however, has a shift in platforms between the depending package and the depended-on package. "build time dependency" means that to build the depending package we need to be able to run the depended-on's package. The depending package's build platform is therefore equal to the depended-on package's host platform. - If both the dependency and depending packages aren't compilers or other - machine-code-producing tools, we're done. And indeed - buildInputs and nativeBuildInputs - have covered these simpler build-time and run-time (respectively) changes - for many years. But if the dependency does produce machine code, we might - need to worry about its target platform too. In principle, that target - platform might be any of the depending package's build, host, or target - platforms, but we prohibit dependencies from a "later" platform to an - earlier platform to limit confusion because we've never seen a legitimate - use for them. + If both the dependency and depending packages aren't compilers or other machine-code-producing tools, we're done. And indeed buildInputs and nativeBuildInputs have covered these simpler build-time and run-time (respectively) changes for many years. But if the dependency does produce machine code, we might need to worry about its target platform too. In principle, that target platform might be any of the depending package's build, host, or target platforms, but we prohibit dependencies from a "later" platform to an earlier platform to limit confusion because we've never seen a legitimate use for them. - Finally, if the depending package is a compiler or other - machine-code-producing tool, it might need dependencies that run at "emit - time". This is for compilers that (regrettably) insist on being built - together with their source langauges' standard libraries. Assuming build != - host != target, a run-time dependency of the standard library cannot be run - at the compiler's build time or run time, but only at the run time of code - emitted by the compiler. + Finally, if the depending package is a compiler or other machine-code-producing tool, it might need dependencies that run at "emit time". This is for compilers that (regrettably) insist on being built together with their source langauges' standard libraries. Assuming build != host != target, a run-time dependency of the standard library cannot be run at the compiler's build time or run time, but only at the run time of code emitted by the compiler. - Putting this all together, that means we have dependencies in the form - "host → target", in at most the following six combinations: + Putting this all together, that means we have dependencies in the form "host → target", in at most the following six combinations: @@ -318,16 +211,7 @@ - Some examples will make this table clearer. Suppose there's some package - that is being built with a (build, host, target) - platform triple of (foo, bar, baz). If it has a - build-time library dependency, that would be a "host → build" dependency - with a triple of (foo, foo, *) (the target platform is - irrelevant). If it needs a compiler to be built, that would be a "build → - host" dependency with a triple of (foo, foo, *) (the - target platform is irrelevant). That compiler, would be built with another - compiler, also "build → host" dependency, with a triple of (foo, - foo, foo). + Some examples will make this table clearer. Suppose there's some package that is being built with a (build, host, target) platform triple of (foo, bar, baz). If it has a build-time library dependency, that would be a "host → build" dependency with a triple of (foo, foo, *) (the target platform is irrelevant). If it needs a compiler to be built, that would be a "build → host" dependency with a triple of (foo, foo, *) (the target platform is irrelevant). That compiler, would be built with another compiler, also "build → host" dependency, with a triple of (foo, foo, foo). @@ -335,20 +219,14 @@ Cross packaging cookbook - Some frequently encountered problems when packaging for cross-compilation - should be answered here. Ideally, the information above is exhaustive, so - this section cannot provide any new information, but it is ludicrous and - cruel to expect everyone to spend effort working through the interaction of - many features just to figure out the same answer to the same common - problem. Feel free to add to this list! + Some frequently encountered problems when packaging for cross-compilation should be answered here. Ideally, the information above is exhaustive, so this section cannot provide any new information, but it is ludicrous and cruel to expect everyone to spend effort working through the interaction of many features just to figure out the same answer to the same common problem. Feel free to add to this list! - What if my package's build system needs to build a C program to be run - under the build environment? + What if my package's build system needs to build a C program to be run under the build environment? @@ -366,11 +244,7 @@ - Many packages assume that an unprefixed ar 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 ar 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`. @@ -395,82 +269,32 @@ Cross-building packages - Nixpkgs can be instantiated with localSystem alone, in - which case there is no cross-compiling and everything is built by and for - that system, or also with crossSystem, in which case - packages run on the latter, but all building happens on the former. Both - parameters take the same schema as the 3 (build, host, and target) platforms - defined in the previous section. As mentioned above, - lib.systems.examples has some platforms which are used as - arguments for these parameters in practice. You can use them - programmatically, or on the command line: + Nixpkgs can be instantiated with localSystem alone, in which case there is no cross-compiling and everything is built by and for that system, or also with crossSystem, in which case packages run on the latter, but all building happens on the former. Both parameters take the same schema as the 3 (build, host, and target) platforms defined in the previous section. As mentioned above, lib.systems.examples has some platforms which are used as arguments for these parameters in practice. You can use them programmatically, or on the command line: nix-build <nixpkgs> --arg crossSystem '(import <nixpkgs/lib>).systems.examples.fooBarBaz' -A whatever - Eventually we would like to make these platform examples an unnecessary - convenience so that + Eventually we would like to make these platform examples an unnecessary convenience so that nix-build <nixpkgs> --arg crossSystem '{ config = "<arch>-<os>-<vendor>-<abi>"; }' -A whatever - works in the vast majority of cases. The problem today is dependencies on - other sorts of configuration which aren't given proper defaults. We rely on - the examples to crudely to set those configuration parameters in some - vaguely sane manner on the users behalf. Issue - #34274 - tracks this inconvenience along with its root cause in crufty configuration - options. + works in the vast majority of cases. The problem today is dependencies on other sorts of configuration which aren't given proper defaults. We rely on the examples to crudely to set those configuration parameters in some vaguely sane manner on the users behalf. Issue #34274 tracks this inconvenience along with its root cause in crufty configuration options. - While one is free to pass both parameters in full, there's a lot of logic to - fill in missing fields. As discussed in the previous section, only one of - system, config, and - parsed is needed to infer the other two. Additionally, - libc will be inferred from parse. - Finally, localSystem.system is also - impurely inferred based on the platform evaluation - occurs. This means it is often not necessary to pass - localSystem at all, as in the command-line example in the - previous paragraph. + While one is free to pass both parameters in full, there's a lot of logic to fill in missing fields. As discussed in the previous section, only one of system, config, and parsed is needed to infer the other two. Additionally, libc will be inferred from parse. Finally, localSystem.system is also impurely inferred based on the platform evaluation occurs. This means it is often not necessary to pass localSystem at all, as in the command-line example in the previous paragraph. - Many sources (manual, wiki, etc) probably mention passing - system, platform, along with the - optional crossSystem to nixpkgs: import - <nixpkgs> { system = ..; platform = ..; crossSystem = ..; - }. Passing those two instead of localSystem is - still supported for compatibility, but is discouraged. Indeed, much of the - inference we do for these parameters is motivated by compatibility as much - as convenience. + Many sources (manual, wiki, etc) probably mention passing system, platform, along with the optional crossSystem to nixpkgs: import <nixpkgs> { system = ..; platform = ..; crossSystem = ..; }. Passing those two instead of localSystem is still supported for compatibility, but is discouraged. Indeed, much of the inference we do for these parameters is motivated by compatibility as much as convenience. - One would think that localSystem and - crossSystem overlap horribly with the three - *Platforms (buildPlatform, - hostPlatform, and targetPlatform; see - stage.nix or the manual). Actually, those identifiers are - purposefully not used here to draw a subtle but important distinction: While - the granularity of having 3 platforms is necessary to properly *build* - packages, it is overkill for specifying the user's *intent* when making a - build plan or package set. A simple "build vs deploy" dichotomy is adequate: - the sliding window principle described in the previous section shows how to - interpolate between the these two "end points" to get the 3 platform triple - for each bootstrapping stage. That means for any package a given package - set, even those not bound on the top level but only reachable via - dependencies or buildPackages, the three platforms will - be defined as one of localSystem or - crossSystem, with the former replacing the latter as one - traverses build-time dependencies. A last simple difference is that - crossSystem should be null when one doesn't want to - cross-compile, while the *Platforms are always non-null. - localSystem is always non-null. + One would think that localSystem and crossSystem overlap horribly with the three *Platforms (buildPlatform, hostPlatform, and targetPlatform; see stage.nix or the manual). Actually, those identifiers are purposefully not used here to draw a subtle but important distinction: While the granularity of having 3 platforms is necessary to properly *build* packages, it is overkill for specifying the user's *intent* when making a build plan or package set. A simple "build vs deploy" dichotomy is adequate: the sliding window principle described in the previous section shows how to interpolate between the these two "end points" to get the 3 platform triple for each bootstrapping stage. That means for any package a given package set, even those not bound on the top level but only reachable via dependencies or buildPackages, the three platforms will be defined as one of localSystem or crossSystem, with the former replacing the latter as one traverses build-time dependencies. A last simple difference is that crossSystem should be null when one doesn't want to cross-compile, while the *Platforms are always non-null. localSystem is always non-null. @@ -481,61 +305,20 @@ nix-build <nixpkgs> --arg crossSystem '{ config = "<arch>-<os> Implementation of dependencies - The categorizes of dependencies developed in - are specified as - lists of derivations given to mkDerivation, as - documented in . In short, each - list of dependencies for "host → target" of "foo → bar" is called - depsFooBar, with exceptions for backwards compatibility - that depsBuildHost is instead called - nativeBuildInputs and depsHostTarget - is instead called buildInputs. Nixpkgs is now structured - so that each depsFooBar is automatically taken from - pkgsFooBar. (These pkgsFooBars are - quite new, so there is no special case for - nativeBuildInputs and buildInputs.) - For example, pkgsBuildHost.gcc should be used at - build-time, while pkgsHostTarget.gcc should be used at - run-time. + The categorizes of dependencies developed in are specified as lists of derivations given to mkDerivation, as documented in . In short, each list of dependencies for "host → target" of "foo → bar" is called depsFooBar, with exceptions for backwards compatibility that depsBuildHost is instead called nativeBuildInputs and depsHostTarget is instead called buildInputs. Nixpkgs is now structured so that each depsFooBar is automatically taken from pkgsFooBar. (These pkgsFooBars are quite new, so there is no special case for nativeBuildInputs and buildInputs.) For example, pkgsBuildHost.gcc should be used at build-time, while pkgsHostTarget.gcc should be used at run-time. - Now, for most of Nixpkgs's history, there were no - pkgsFooBar attributes, and most packages have not been - refactored to use it explicitly. Prior to those, there were just - buildPackages, pkgs, and - targetPackages. Those are now redefined as aliases to - pkgsBuildHost, pkgsHostTarget, and - pkgsTargetTarget. It is acceptable, even recommended, to - use them for libraries to show that the host platform is irrelevant. + Now, for most of Nixpkgs's history, there were no pkgsFooBar attributes, and most packages have not been refactored to use it explicitly. Prior to those, there were just buildPackages, pkgs, and targetPackages. Those are now redefined as aliases to pkgsBuildHost, pkgsHostTarget, and pkgsTargetTarget. It is acceptable, even recommended, to use them for libraries to show that the host platform is irrelevant. - But before that, there was just pkgs, even though both - buildInputs and nativeBuildInputs - existed. [Cross barely worked, and those were implemented with some hacks - on mkDerivation to override dependencies.] What this - means is the vast majority of packages do not use any explicit package set - to populate their dependencies, just using whatever - callPackage gives them even if they do correctly sort - their dependencies into the multiple lists described above. And indeed, - asking that users both sort their dependencies, and - take them from the right attribute set, is both too onerous and redundant, - so the recommended approach (for now) is to continue just categorizing by - list and not using an explicit package set. + But before that, there was just pkgs, even though both buildInputs and nativeBuildInputs existed. [Cross barely worked, and those were implemented with some hacks on mkDerivation to override dependencies.] What this means is the vast majority of packages do not use any explicit package set to populate their dependencies, just using whatever callPackage gives them even if they do correctly sort their dependencies into the multiple lists described above. And indeed, asking that users both sort their dependencies, and take them from the right attribute set, is both too onerous and redundant, so the recommended approach (for now) is to continue just categorizing by list and not using an explicit package set. - To make this work, we "splice" together the six - pkgsFooBar package sets and have - callPackage actually take its arguments from that. This - is currently implemented in pkgs/top-level/splice.nix. - mkDerivation then, for each dependency attribute, pulls - the right derivation out from the splice. This splicing can be skipped when - not cross-compiling as the package sets are the same, but still is a bit - slow for cross-compiling. We'd like to do something better, but haven't - come up with anything yet. + To make this work, we "splice" together the six pkgsFooBar package sets and have callPackage actually take its arguments from that. This is currently implemented in pkgs/top-level/splice.nix. mkDerivation then, for each dependency attribute, pulls the right derivation out from the splice. This splicing can be skipped when not cross-compiling as the package sets are the same, but still is a bit slow for cross-compiling. We'd like to do something better, but haven't come up with anything yet. @@ -543,21 +326,11 @@ nix-build <nixpkgs> --arg crossSystem '{ config = "<arch>-<os> Bootstrapping - Each of the package sets described above come from a single bootstrapping - stage. While pkgs/top-level/default.nix, coordinates - the composition of stages at a high level, - pkgs/top-level/stage.nix "ties the knot" (creates the - fixed point) of each stage. The package sets are defined per-stage however, - so they can be thought of as edges between stages (the nodes) in a graph. - Compositions like pkgsBuildTarget.targetPackages can be - thought of as paths to this graph. + Each of the package sets described above come from a single bootstrapping stage. While pkgs/top-level/default.nix, coordinates the composition of stages at a high level, pkgs/top-level/stage.nix "ties the knot" (creates the fixed point) of each stage. The package sets are defined per-stage however, so they can be thought of as edges between stages (the nodes) in a graph. Compositions like pkgsBuildTarget.targetPackages can be thought of as paths to this graph. - While there are many package sets, and thus many edges, the stages can also - be arranged in a linear chain. In other words, many of the edges are - redundant as far as connectivity is concerned. This hinges on the type of - bootstrapping we do. Currently for cross it is: + While there are many package sets, and thus many edges, the stages can also be arranged in a linear chain. In other words, many of the edges are redundant as far as connectivity is concerned. This hinges on the type of bootstrapping we do. Currently for cross it is: @@ -575,102 +348,45 @@ nix-build <nixpkgs> --arg crossSystem '{ config = "<arch>-<os> - In each stage, pkgsBuildHost refers the the previous - stage, pkgsBuildBuild refers to the one before that, and - pkgsHostTarget refers to the current one, and - pkgsTargetTarget 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. - pkgsBuildTarget and pkgsHostHost 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 - pkgs/stdenv/booter.nix, and secondarily aliases in - pkgs/top-level/stage.nix. + In each stage, pkgsBuildHost refers the the previous stage, pkgsBuildBuild refers to the one before that, and pkgsHostTarget refers to the current one, and pkgsTargetTarget 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. pkgsBuildTarget and pkgsHostHost 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 pkgs/stdenv/booter.nix, and secondarily aliases in pkgs/top-level/stage.nix. - 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 the bootstrapping stages leading up to the final stages are ignored inthe previous paragraph. - If one looks at the 3 platform triples, one can see that they overlap such - that one could put them together into a chain like: + If one looks at the 3 platform triples, one can see that they overlap such that one could put them together into a chain like: (native, native, native, foreign, foreign) - If one imagines the saturating self references at the end being replaced - with infinite stages, and then overlays those platform triples, one ends up - with the infinite tuple: + If one imagines the saturating self references at the end being replaced with infinite stages, and then overlays those platform triples, one ends up with the infinite tuple: (native..., native, native, native, foreign, foreign, foreign...) - On can then imagine any sequence of platforms such that there are bootstrap - stages with their 3 platforms determined by "sliding a window" that is the - 3 tuple through the sequence. This was the original model for - bootstrapping. Without a target platform (assume a better world where all - compilers are multi-target and all standard libraries are built in their - own derivation), this is sufficient. Conversely if one wishes to cross - compile "faster", with a "Canadian Cross" bootstraping stage where - build != host != target, more bootstrapping stages are - needed since no sliding window providess the pesky - pkgsBuildTarget package set since it skips the Canadian - cross stage's "host". + On can then imagine any sequence of platforms such that there are bootstrap stages with their 3 platforms determined by "sliding a window" that is the 3 tuple through the sequence. This was the original model for bootstrapping. Without a target platform (assume a better world where all compilers are multi-target and all standard libraries are built in their own derivation), this is sufficient. Conversely if one wishes to cross compile "faster", with a "Canadian Cross" bootstraping stage where build != host != target, more bootstrapping stages are needed since no sliding window providess the pesky pkgsBuildTarget package set since it skips the Canadian cross stage's "host". - It is much better to refer to buildPackages than - targetPackages, or more broadly package sets that do - not mention "target". There are three reasons for this. + It is much better to refer to buildPackages than targetPackages, or more broadly package sets that do not mention "target". There are three reasons for this. - First, it is because bootstrapping stages do not have a unique - targetPackages. For example a (x86-linux, - x86-linux, arm-linux) and (x86-linux, x86-linux, - x86-windows) package set both have a (x86-linux, - x86-linux, x86-linux) package set. Because there is no canonical - targetPackages for such a native (build == - host == target) package set, we set their - targetPackages + First, it is because bootstrapping stages do not have a unique targetPackages. For example a (x86-linux, x86-linux, arm-linux) and (x86-linux, x86-linux, x86-windows) package set both have a (x86-linux, x86-linux, x86-linux) package set. Because there is no canonical targetPackages for such a native (build == host == target) package set, we set their targetPackages - Second, it is because this is a frequent source of hard-to-follow - "infinite recursions" / cycles. When only package sets that don't mention - target are used, the package set forms a directed acyclic graph. This - means that all cycles that exist are confined to one stage. This means - they are a lot smaller, and easier to follow in the code or a backtrace. - It also means they are present in native and cross builds alike, and so - more likely to be caught by CI and other users. + Second, it is because this is a frequent source of hard-to-follow "infinite recursions" / cycles. When only package sets that don't mention target are used, the package set forms a directed acyclic graph. This means that all cycles that exist are confined to one stage. This means they are a lot smaller, and easier to follow in the code or a backtrace. It also means they are present in native and cross builds alike, and so more likely to be caught by CI and other users. - Thirdly, it is because everything target-mentioning only exists to - accommodate compilers with lousy build systems that insist on the compiler - itself and standard library being built together. Of course that is bad - because bigger derivations means longer rebuilds. It is also problematic - because it tends to make the standard libraries less like other libraries - than they could be, complicating code and build systems alike. Because of - the other problems, and because of these innate disadvantages, compilers - ought to be packaged another way where possible. + Thirdly, it is because everything target-mentioning only exists to accommodate compilers with lousy build systems that insist on the compiler itself and standard library being built together. Of course that is bad because bigger derivations means longer rebuilds. It is also problematic because it tends to make the standard libraries less like other libraries than they could be, complicating code and build systems alike. Because of the other problems, and because of these innate disadvantages, compilers ought to be packaged another way where possible. - If one explores Nixpkgs, they will see derivations with names like - gccCross. Such *Cross derivations is - a holdover from before we properly distinguished between the host and - target platforms—the derivation with "Cross" in the name covered the - build = host != target case, while the other covered - the host = target, with build platform the same or not - based on whether one was using its .nativeDrv or - .crossDrv. This ugliness will disappear soon. + If one explores Nixpkgs, they will see derivations with names like gccCross. Such *Cross derivations is a holdover from before we properly distinguished between the host and target platforms—the derivation with "Cross" in the name covered the build = host != target case, while the other covered the host = target, with build platform the same or not based on whether one was using its .nativeDrv or .crossDrv. This ugliness will disappear soon. diff --git a/doc/functions.xml b/doc/functions.xml index 96bd95958eae..3e126e6b1397 100644 --- a/doc/functions.xml +++ b/doc/functions.xml @@ -4,8 +4,7 @@ xml:id="chap-functions"> Functions reference - The nixpkgs repository has several utility functions to manipulate Nix - expressions. + The nixpkgs repository has several utility functions to manipulate Nix expressions. diff --git a/doc/functions/appimagetools.xml b/doc/functions/appimagetools.xml index e6dbc22f48dd..37e4251cda2e 100644 --- a/doc/functions/appimagetools.xml +++ b/doc/functions/appimagetools.xml @@ -5,17 +5,12 @@ pkgs.appimageTools - pkgs.appimageTools is a set of functions for extracting - and wrapping AppImage files. - They are meant to be used if traditional packaging from source is infeasible, - or it would take too long. To quickly run an AppImage file, - pkgs.appimage-run can be used as well. + pkgs.appimageTools is a set of functions for extracting and wrapping AppImage files. They are meant to be used if traditional packaging from source is infeasible, or it would take too long. To quickly run an AppImage file, pkgs.appimage-run can be used as well. - The appimageTools API is unstable and may be subject to - backwards-incompatible changes in the future. + The appimageTools API is unstable and may be subject to backwards-incompatible changes in the future. @@ -23,9 +18,7 @@ AppImage formats - There are different formats for AppImages, see - the - specification for details. + There are different formats for AppImages, see the specification for details. @@ -55,8 +48,7 @@ type2.AppImage: ELF 64-bit LSB executable, x86-64, version 1 (SYSV) (Lepton 3.x) - Note how the type 1 AppImage is described as an ISO 9660 CD-ROM - filesystem, and the type 2 AppImage is not. + Note how the type 1 AppImage is described as an ISO 9660 CD-ROM filesystem, and the type 2 AppImage is not. @@ -64,8 +56,7 @@ type2.AppImage: ELF 64-bit LSB executable, x86-64, version 1 (SYSV) (Lepton 3.x) Wrapping - Depending on the type of AppImage you're wrapping, you'll have to use - wrapType1 or wrapType2. + Depending on the type of AppImage you're wrapping, you'll have to use wrapType1 or wrapType2. @@ -91,23 +82,16 @@ appimageTools.wrapType2 { # or wrapType1 - extraPkgs allows you to pass a function to include - additional packages inside the FHS environment your AppImage is going to - run in. There are a few ways to learn which dependencies an application - needs: + extraPkgs allows you to pass a function to include additional packages inside the FHS environment your AppImage is going to run in. There are a few ways to learn which dependencies an application needs: - Looking through the extracted AppImage files, reading its scripts and - running patchelf and ldd on its - executables. This can also be done in appimage-run, - by setting APPIMAGE_DEBUG_EXEC=bash. + Looking through the extracted AppImage files, reading its scripts and running patchelf and ldd on its executables. This can also be done in appimage-run, by setting APPIMAGE_DEBUG_EXEC=bash. - Running strace -vfefile on the wrapped executable, - looking for libraries that can't be found. + Running strace -vfefile on the wrapped executable, looking for libraries that can't be found. diff --git a/doc/functions/debug.xml b/doc/functions/debug.xml index c6b3611eea53..c27421f12e76 100644 --- a/doc/functions/debug.xml +++ b/doc/functions/debug.xml @@ -5,17 +5,10 @@ Debugging Nix Expressions - Nix is a unityped, dynamic language, this means every value can potentially - appear anywhere. Since it is also non-strict, evaluation order and what - ultimately is evaluated might surprise you. Therefore it is important to be - able to debug nix expressions. + Nix is a unityped, dynamic language, this means every value can potentially appear anywhere. Since it is also non-strict, evaluation order and what ultimately is evaluated might surprise you. Therefore it is important to be able to debug nix expressions. - In the lib/debug.nix file you will find a number of - functions that help (pretty-)printing values while evaluation is runnnig. You - can even specify how deep these values should be printed recursively, and - transform them on the fly. Please consult the docstrings in - lib/debug.nix for usage information. + In the lib/debug.nix file you will find a number of functions that help (pretty-)printing values while evaluation is runnnig. You can even specify how deep these values should be printed recursively, and transform them on the fly. Please consult the docstrings in lib/debug.nix for usage information. diff --git a/doc/functions/dockertools.xml b/doc/functions/dockertools.xml index 6b293a2e7787..2243453c3e97 100644 --- a/doc/functions/dockertools.xml +++ b/doc/functions/dockertools.xml @@ -5,17 +5,12 @@ pkgs.dockerTools - pkgs.dockerTools is a set of functions for creating and - manipulating Docker images according to the - - Docker Image Specification v1.2.0 . Docker itself is not used to - perform any of the operations done by these functions. + pkgs.dockerTools is a set of functions for creating and manipulating Docker images according to the Docker Image Specification v1.2.0 . Docker itself is not used to perform any of the operations done by these functions. - The dockerTools API is unstable and may be subject to - backwards-incompatible changes in the future. + The dockerTools API is unstable and may be subject to backwards-incompatible changes in the future. @@ -23,15 +18,11 @@ buildImage - This function is analogous to the docker build command, - in that it can be used to build a Docker-compatible repository tarball - containing a single image with one or multiple layers. As such, the result - is suitable for being loaded in Docker with docker load. + This function is analogous to the docker build command, in that it can be used to build a Docker-compatible repository tarball containing a single image with one or multiple layers. As such, the result is suitable for being loaded in Docker with docker load. - The parameters of buildImage with relative example values - are described below: + The parameters of buildImage with relative example values are described below: @@ -63,135 +54,89 @@ buildImage { - The above example will build a Docker image redis/latest - from the given base image. Loading and running this image in Docker results - in redis-server being started automatically. + The above example will build a Docker image redis/latest from the given base image. Loading and running this image in Docker results in redis-server being started automatically. - name specifies the name of the resulting image. This is - the only required argument for buildImage. + name specifies the name of the resulting image. This is the only required argument for buildImage. - tag specifies the tag of the resulting image. By - default it's null, which indicates that the nix output - hash will be used as tag. + tag specifies the tag of the resulting image. By default it's null, which indicates that the nix output hash will be used as tag. - fromImage is the repository tarball containing the base - image. It must be a valid Docker image, such as exported by - docker save. By default it's null, - which can be seen as equivalent to FROM scratch of a - Dockerfile. + fromImage is the repository tarball containing the base image. It must be a valid Docker image, such as exported by docker save. By default it's null, which can be seen as equivalent to FROM scratch of a Dockerfile. - fromImageName can be used to further specify the base - image within the repository, in case it contains multiple images. By - default it's null, in which case - buildImage will peek the first image available in the - repository. + fromImageName can be used to further specify the base image within the repository, in case it contains multiple images. By default it's null, in which case buildImage will peek the first image available in the repository. - fromImageTag can be used to further specify the tag of - the base image within the repository, in case an image contains multiple - tags. By default it's null, in which case - buildImage will peek the first tag available for the - base image. + fromImageTag can be used to further specify the tag of the base image within the repository, in case an image contains multiple tags. By default it's null, in which case buildImage will peek the first tag available for the base image. - contents is a derivation that will be copied in the new - layer of the resulting image. This can be similarly seen as ADD - contents/ / in a Dockerfile. By default - it's null. + contents is a derivation that will be copied in the new layer of the resulting image. This can be similarly seen as ADD contents/ / in a Dockerfile. By default it's null. - runAsRoot is a bash script that will run as root in an - environment that overlays the existing layers of the base image with the - new resulting layer, including the previously copied - contents derivation. This can be similarly seen as - RUN ... in a Dockerfile. + runAsRoot is a bash script that will run as root in an environment that overlays the existing layers of the base image with the new resulting layer, including the previously copied contents derivation. This can be similarly seen as RUN ... in a Dockerfile. - Using this parameter requires the kvm device to be - available. + Using this parameter requires the kvm device to be available. - config is used to specify the configuration of the - containers that will be started off the built image in Docker. The - available options are listed in the - - Docker Image Specification v1.2.0 . + config is used to specify the configuration of the containers that will be started off the built image in Docker. The available options are listed in the Docker Image Specification v1.2.0 . - After the new layer has been created, its closure (to which - contents, config and - runAsRoot contribute) will be copied in the layer itself. - Only new dependencies that are not already in the existing layers will be - copied. + After the new layer has been created, its closure (to which contents, config and runAsRoot contribute) will be copied in the layer itself. Only new dependencies that are not already in the existing layers will be copied. - At the end of the process, only one new single layer will be produced and - added to the resulting image. + At the end of the process, only one new single layer will be produced and added to the resulting image. - The resulting repository will only list the single image - image/tag. In the case of - it would be - redis/latest. + The resulting repository will only list the single image image/tag. In the case of it would be redis/latest. - It is possible to inspect the arguments with which an image was built using - its buildArgs attribute. + It is possible to inspect the arguments with which an image was built using its buildArgs attribute. - If you see errors similar to getProtocolByName: does not exist (no - such protocol name: tcp) you may need to add - pkgs.iana-etc to contents. + If you see errors similar to getProtocolByName: does not exist (no such protocol name: tcp) you may need to add pkgs.iana-etc to contents. - If you see errors similar to Error_Protocol ("certificate has - unknown CA",True,UnknownCa) you may need to add - pkgs.cacert to contents. + If you see errors similar to Error_Protocol ("certificate has unknown CA",True,UnknownCa) you may need to add pkgs.cacert to contents. Impurely Defining a Docker Layer's Creation Date - By default buildImage will use a static date of one - second past the UNIX Epoch. This allows buildImage to - produce binary reproducible images. When listing images with - docker images, the newly created images will be listed - like this: + By default buildImage will use a static date of one second past the UNIX Epoch. This allows buildImage to produce binary reproducible images. When listing images with docker images, the newly created images will be listed like this: - You can break binary reproducibility but have a sorted, meaningful - CREATED column by setting created to - now. + You can break binary reproducibility but have a sorted, meaningful CREATED column by setting created to now. - and now the Docker CLI will display a reasonable date and sort the images - as expected: + and now the Docker CLI will display a reasonable date and sort the images as expected: buildLayeredImage - Create a Docker image with many of the store paths being on their own layer - to improve sharing between images. + Create a Docker image with many of the store paths being on their own layer to improve sharing between images. @@ -264,8 +205,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB - Top level paths in the container. Either a single derivation, or a list - of derivations. + Top level paths in the container. Either a single derivation, or a list of derivations. Default: [] @@ -278,10 +218,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB - Run-time configuration of the container. A full list of the options are - available at in the - - Docker Image Specification v1.2.0 . + Run-time configuration of the container. A full list of the options are available at in the Docker Image Specification v1.2.0 . Default: {} @@ -294,9 +231,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB - Date and time the layers were created. Follows the same - now exception supported by - buildImage. + Date and time the layers were created. Follows the same now exception supported by buildImage. Default: 1970-01-01T00:00:01Z @@ -325,9 +260,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB - Shell commands to run while building the final layer, without access to - most of the layer contents. Changes to this layer are "on top" of all the - other layers, so can create additional directories and files. + Shell commands to run while building the final layer, without access to most of the layer contents. Changes to this layer are "on top" of all the other layers, so can create additional directories and files. @@ -337,8 +270,7 @@ hello latest de2bf4786de6 About a minute ago 25.2MB Behavior of <varname>contents</varname> in the final image - Each path directly listed in contents will have a - symlink in the root of the image. + Each path directly listed in contents will have a symlink in the root of the image. @@ -349,8 +281,7 @@ pkgs.dockerTools.buildLayeredImage { contents = [ pkgs.hello ]; } ]]> - will create symlinks for all the paths in the hello - package: + will create symlinks for all the paths in the hello package: /nix/store/h1zb1padqbbb7jicsvkmrym3r6snphxg-hello-2.10/bin/hello /share/info/hello.info -> /nix/store/h1zb1padqbbb7jicsvkmrym3r6snphxg-hello-2.10/share/info/hello.info @@ -363,13 +294,11 @@ pkgs.dockerTools.buildLayeredImage { Automatic inclusion of <varname>config</varname> references - The closure of config is automatically included in the - closure of the final image. + The closure of config is automatically included in the closure of the final image. - This allows you to make very simple Docker images with very little code. - This container will start up and run hello: + This allows you to make very simple Docker images with very little code. This container will start up and run hello: Adjusting maxLayers - Increasing the maxLayers increases the number of layers - which have a chance to be shared between different images. + Increasing the maxLayers increases the number of layers which have a chance to be shared between different images. - Modern Docker installations support up to 128 layers, however older - versions support as few as 42. + Modern Docker installations support up to 128 layers, however older versions support as few as 42. - If the produced image will not be extended by other Docker builds, it is - safe to set maxLayers to 128. However - it will be impossible to extend the image further. + If the produced image will not be extended by other Docker builds, it is safe to set maxLayers to 128. However it will be impossible to extend the image further. - The first (maxLayers-2) most "popular" paths will have - their own individual layers, then layer #maxLayers-1 - will contain all the remaining "unpopular" paths, and finally layer - #maxLayers will contain the Image configuration. + The first (maxLayers-2) most "popular" paths will have their own individual layers, then layer #maxLayers-1 will contain all the remaining "unpopular" paths, and finally layer #maxLayers will contain the Image configuration. - Docker's Layers are not inherently ordered, they are content-addressable - and are not explicitly layered until they are composed in to an Image. + Docker's Layers are not inherently ordered, they are content-addressable and are not explicitly layered until they are composed in to an Image. @@ -416,10 +337,7 @@ pkgs.dockerTools.buildLayeredImage { pullImage - This function is analogous to the docker pull command, in - that it can be used to pull a Docker image from a Docker registry. By - default Docker Hub is used - to pull images. + This function is analogous to the docker pull command, in that it can be used to pull a Docker image from a Docker registry. By default Docker Hub is used to pull images. @@ -444,71 +362,51 @@ pullImage { - imageName specifies the name of the image to be - downloaded, which can also include the registry namespace (e.g. - nixos). This argument is required. + imageName specifies the name of the image to be downloaded, which can also include the registry namespace (e.g. nixos). This argument is required. - imageDigest specifies the digest of the image to be - downloaded. This argument is required. + imageDigest specifies the digest of the image to be downloaded. This argument is required. - finalImageName, if specified, this is the name of the - image to be created. Note it is never used to fetch the image since we - prefer to rely on the immutable digest ID. By default it's equal to - imageName. + finalImageName, if specified, this is the name of the image to be created. Note it is never used to fetch the image since we prefer to rely on the immutable digest ID. By default it's equal to imageName. - finalImageTag, if specified, this is the tag of the - image to be created. Note it is never used to fetch the image since we - prefer to rely on the immutable digest ID. By default it's - latest. + finalImageTag, if specified, this is the tag of the image to be created. Note it is never used to fetch the image since we prefer to rely on the immutable digest ID. By default it's latest. - sha256 is the checksum of the whole fetched image. This - argument is required. + sha256 is the checksum of the whole fetched image. This argument is required. - os, if specified, is the operating system of the - fetched image. By default it's linux. + os, if specified, is the operating system of the fetched image. By default it's linux. - arch, if specified, is the cpu architecture of the - fetched image. By default it's x86_64. + arch, if specified, is the cpu architecture of the fetched image. By default it's x86_64. - nix-prefetch-docker command can be used to get required - image parameters: + nix-prefetch-docker command can be used to get required image parameters: $ nix run nixpkgs.nix-prefetch-docker -c nix-prefetch-docker --image-name mysql --image-tag 5 - Since a given imageName may transparently refer to a - manifest list of images which support multiple architectures and/or - operating systems, you can supply the and - arguments to specify exactly which image you want. - By default it will match the OS and architecture of the host the command is - run on. + Since a given imageName may transparently refer to a manifest list of images which support multiple architectures and/or operating systems, you can supply the and arguments to specify exactly which image you want. By default it will match the OS and architecture of the host the command is run on. $ nix-prefetch-docker --image-name mysql --image-tag 5 --arch x86_64 --os linux - Desired image name and tag can be set using - and - arguments: + Desired image name and tag can be set using and arguments: $ nix-prefetch-docker --image-name mysql --image-tag 5 --final-image-name eu.gcr.io/my-project/mysql --final-image-tag prod @@ -519,17 +417,12 @@ pullImage { exportImage - This function is analogous to the docker export command, - in that it can be used to flatten a Docker image that contains multiple - layers. It is in fact the result of the merge of all the layers of the - image. As such, the result is suitable for being imported in Docker with - docker import. + This function is analogous to the docker export command, in that it can be used to flatten a Docker image that contains multiple layers. It is in fact the result of the merge of all the layers of the image. As such, the result is suitable for being imported in Docker with docker import. - Using this function requires the kvm device to be - available. + Using this function requires the kvm device to be available. @@ -551,14 +444,11 @@ exportImage { - The parameters relative to the base image have the same synopsis as - described in , except that - fromImage is the only required argument in this case. + The parameters relative to the base image have the same synopsis as described in , except that fromImage is the only required argument in this case. - The name argument is the name of the derivation output, - which defaults to fromImage.name. + The name argument is the name of the derivation output, which defaults to fromImage.name. @@ -566,11 +456,7 @@ exportImage { shadowSetup - This constant string is a helper for setting up the base files for managing - users and groups, only if such files don't exist already. It is suitable for - being used in a runAsRoot - script for cases like - in the example below: + This constant string is a helper for setting up the base files for managing users and groups, only if such files don't exist already. It is suitable for being used in a runAsRoot script for cases like in the example below: @@ -592,9 +478,7 @@ buildImage { - Creating base files like /etc/passwd or - /etc/login.defs is necessary for shadow-utils to - manipulate users and groups. + Creating base files like /etc/passwd or /etc/login.defs is necessary for shadow-utils to manipulate users and groups. diff --git a/doc/functions/fetchers.xml b/doc/functions/fetchers.xml index a736008c9d41..369c1fb153eb 100644 --- a/doc/functions/fetchers.xml +++ b/doc/functions/fetchers.xml @@ -5,18 +5,11 @@ Fetcher functions - 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. - The two fetcher primitives are fetchurl and - fetchzip. Both of these have two required arguments, a - URL and a hash. The hash is typically sha256, although - many more hash algorithms are supported. Nixpkgs contributors are currently - recommended to use sha256. This hash will be used by Nix - to identify your source. A typical usage of fetchurl is provided below. + The two fetcher primitives are fetchurl and fetchzip. Both of these have two required arguments, a URL and a hash. The hash is typically sha256, although many more hash algorithms are supported. Nixpkgs contributors are currently recommended to use sha256. This hash will be used by Nix to identify your source. A typical usage of fetchurl is provided below. - The main difference between fetchurl and - fetchzip is in how they store the contents. - fetchurl will store the unaltered contents of the URL - within the Nix store. fetchzip on the other hand will - decompress the archive for you, making files and directories directly - accessible in the future. fetchzip can only be used with - archives. Despite the name, fetchzip is not limited to - .zip files and can also be used with any tarball. + The main difference between fetchurl and fetchzip is in how they store the contents. fetchurl will store the unaltered contents of the URL within the Nix store. fetchzip on the other hand will decompress the archive for you, making files and directories directly accessible in the future. fetchzip can only be used with archives. Despite the name, fetchzip is not limited to .zip files and can also be used with any tarball. - fetchpatch works very similarly to - fetchurl 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. + fetchpatch works very similarly to fetchurl 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. - 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 fetchzip. + 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 fetchzip. @@ -65,8 +43,7 @@ stdenv.mkDerivation { - Used with Subversion. Expects url to a Subversion - directory, rev, and sha256. + Used with Subversion. Expects url to a Subversion directory, rev, and sha256. @@ -76,10 +53,7 @@ stdenv.mkDerivation { - Used with Git. Expects url to a Git repo, - rev, and sha256. - rev in this case can be full the git commit id (SHA1 - hash) or a tag name like refs/tags/v1.0. + Used with Git. Expects url to a Git repo, rev, and sha256. rev in this case can be full the git commit id (SHA1 hash) or a tag name like refs/tags/v1.0. @@ -89,8 +63,7 @@ stdenv.mkDerivation { - Used with Fossil. Expects url to a Fossil archive, - rev, and sha256. + Used with Fossil. Expects url to a Fossil archive, rev, and sha256. @@ -100,8 +73,7 @@ stdenv.mkDerivation { - Used with CVS. Expects cvsRoot, tag, - and sha256. + Used with CVS. Expects cvsRoot, tag, and sha256. @@ -111,18 +83,14 @@ stdenv.mkDerivation { - Used with Mercurial. Expects url, - rev, and sha256. + Used with Mercurial. Expects url, rev, and sha256. - A number of fetcher functions wrap part of fetchurl and - fetchzip. 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 fetchurl and fetchzip. They are mainly convenience functions intended for commonly used destinations of source code in Nixpkgs. These wrapper fetchers are listed below. @@ -132,17 +100,7 @@ stdenv.mkDerivation { - fetchFromGitHub expects four arguments. - owner is a string corresponding to the GitHub user or - organization that controls this repository. repo - corresponds to the name of the software repository. These are located at - the top of every GitHub HTML page as - owner/repo. rev - corresponds to the Git commit hash or tag (e.g v1.0) - that will be downloaded from Git. Finally, sha256 - corresponds to the hash of the extracted directory. Again, other hash - algorithms are also available but sha256 is currently - preferred. + fetchFromGitHub expects four arguments. owner is a string corresponding to the GitHub user or organization that controls this repository. repo corresponds to the name of the software repository. These are located at the top of every GitHub HTML page as owner/repo. rev corresponds to the Git commit hash or tag (e.g v1.0) that will be downloaded from Git. Finally, sha256 corresponds to the hash of the extracted directory. Again, other hash algorithms are also available but sha256 is currently preferred. @@ -152,8 +110,7 @@ stdenv.mkDerivation { - This is used with GitLab repositories. The arguments expected are very - similar to fetchFromGitHub above. + This is used with GitLab repositories. The arguments expected are very similar to fetchFromGitHub above. @@ -163,8 +120,7 @@ stdenv.mkDerivation { - This is used with BitBucket repositories. The arguments expected are very - similar to fetchFromGitHub above. + This is used with BitBucket repositories. The arguments expected are very similar to fetchFromGitHub above. @@ -174,8 +130,7 @@ stdenv.mkDerivation { - This is used with Savannah repositories. The arguments expected are very - similar to fetchFromGitHub above. + This is used with Savannah repositories. The arguments expected are very similar to fetchFromGitHub above. @@ -185,8 +140,7 @@ stdenv.mkDerivation { - This is used with repo.or.cz repositories. The arguments expected are very - similar to fetchFromGitHub above. + This is used with repo.or.cz repositories. The arguments expected are very similar to fetchFromGitHub above. diff --git a/doc/functions/fhs-environments.xml b/doc/functions/fhs-environments.xml index 79682080be31..e7b81e97a23f 100644 --- a/doc/functions/fhs-environments.xml +++ b/doc/functions/fhs-environments.xml @@ -5,15 +5,7 @@ buildFHSUserEnv - buildFHSUserEnv provides a way to build and run - FHS-compatible lightweight sandboxes. It creates an isolated root with bound - /nix/store, so its footprint in terms of disk space - needed is quite small. This allows one to run software which is hard or - unfeasible to patch for NixOS -- 3rd-party source trees with FHS assumptions, - games distributed as tarballs, software with integrity checking and/or - external self-updated binaries. It uses Linux namespaces feature to create - temporary lightweight environments which are destroyed after all child - processes exit, without root user rights requirement. Accepted arguments are: + buildFHSUserEnv provides a way to build and run FHS-compatible lightweight sandboxes. It creates an isolated root with bound /nix/store, so its footprint in terms of disk space needed is quite small. This allows one to run software which is hard or unfeasible to patch for NixOS -- 3rd-party source trees with FHS assumptions, games distributed as tarballs, software with integrity checking and/or external self-updated binaries. It uses Linux namespaces feature to create temporary lightweight environments which are destroyed after all child processes exit, without root user rights requirement. Accepted arguments are: @@ -33,8 +25,7 @@ - Packages to be installed for the main host's architecture (i.e. x86_64 on - x86_64 installations). Along with libraries binaries are also installed. + Packages to be installed for the main host's architecture (i.e. x86_64 on x86_64 installations). Along with libraries binaries are also installed. @@ -44,9 +35,7 @@ - Packages to be installed for all architectures supported by a host (i.e. - i686 and x86_64 on x86_64 installations). Only libraries are installed by - default. + Packages to be installed for all architectures supported by a host (i.e. i686 and x86_64 on x86_64 installations). Only libraries are installed by default. @@ -66,8 +55,7 @@ - Like extraBuildCommands, but executed only on multilib - architectures. + Like extraBuildCommands, but executed only on multilib architectures. @@ -77,8 +65,7 @@ - Additional derivation outputs to be linked for both target and - multi-architecture packages. + Additional derivation outputs to be linked for both target and multi-architecture packages. @@ -88,8 +75,7 @@ - Additional commands to be executed for finalizing the derivation with - runner script. + Additional commands to be executed for finalizing the derivation with runner script. @@ -99,16 +85,14 @@ - A command that would be executed inside the sandbox and passed all the - command line arguments. It defaults to bash. + A command that would be executed inside the sandbox and passed all the command line arguments. It defaults to bash. - One can create a simple environment using a shell.nix like - that: + One can create a simple environment using a shell.nix like that: - Running nix-shell would then drop you into a shell with - these libraries and binaries available. You can use this to run closed-source - applications which expect FHS structure without hassles: simply change - runScript to the application path, e.g. - ./bin/start.sh -- relative paths are supported. + Running nix-shell would then drop you into a shell with these libraries and binaries available. You can use this to run closed-source applications which expect FHS structure without hassles: simply change runScript to the application path, e.g. ./bin/start.sh -- relative paths are supported. diff --git a/doc/functions/generators.xml b/doc/functions/generators.xml index e860b10e8979..9ce1f85eb173 100644 --- a/doc/functions/generators.xml +++ b/doc/functions/generators.xml @@ -5,28 +5,15 @@ Generators - Generators are functions that create file formats from nix data structures, - e. g. for configuration files. There are generators available for: - INI, JSON and YAML + Generators are functions that create file formats from nix data structures, e. g. for configuration files. There are generators available for: INI, JSON and YAML - All generators follow a similar call interface: generatorName - configFunctions data, where configFunctions is an - attrset of user-defined functions that format nested parts of the content. - They each have common defaults, so often they do not need to be set manually. - An example is mkSectionName ? (name: libStr.escape [ "[" "]" ] - name) from the INI generator. It receives the name - of a section and sanitizes it. The default mkSectionName - escapes [ and ] with a backslash. + All generators follow a similar call interface: generatorName configFunctions data, where configFunctions is an attrset of user-defined functions that format nested parts of the content. They each have common defaults, so often they do not need to be set manually. An example is mkSectionName ? (name: libStr.escape [ "[" "]" ] name) from the INI generator. It receives the name of a section and sanitizes it. The default mkSectionName escapes [ and ] with a backslash. - Generators can be fine-tuned to produce exactly the file format required by - your application/service. One example is an INI-file format which uses - : as separator, the strings - "yes"/"no" as boolean values and - requires all string values to be quoted: + Generators can be fine-tuned to produce exactly the file format required by your application/service. One example is an INI-file format which uses : as separator, the strings "yes"/"no" as boolean values and requires all string values to be quoted: @@ -77,13 +64,11 @@ merge:"diff3" - Nix store paths can be converted to strings by enclosing a derivation - attribute like so: "${drv}". + Nix store paths can be converted to strings by enclosing a derivation attribute like so: "${drv}". - Detailed documentation for each generator can be found in - lib/generators.nix. + Detailed documentation for each generator can be found in lib/generators.nix. diff --git a/doc/functions/library.xml b/doc/functions/library.xml index e6aedaa6efdd..6ffb944b5a60 100644 --- a/doc/functions/library.xml +++ b/doc/functions/library.xml @@ -5,8 +5,7 @@ Nixpkgs Library Functions - Nixpkgs provides a standard library at pkgs.lib, or - through import <nixpkgs/lib>. + Nixpkgs provides a standard library at pkgs.lib, or through import <nixpkgs/lib>. diff --git a/doc/functions/library/asserts.xml b/doc/functions/library/asserts.xml index 437850e408bc..10891039e869 100644 --- a/doc/functions/library/asserts.xml +++ b/doc/functions/library/asserts.xml @@ -27,8 +27,7 @@ - Condition under which the msg should - not be printed. + Condition under which the msg should not be printed. @@ -64,9 +63,7 @@ stderr> assert failed - Specialized asserts.assertMsg for checking if - val is one of the elements of xs. - Useful for checking enums. + Specialized asserts.assertMsg for checking if val is one of the elements of xs. Useful for checking enums. @@ -76,8 +73,7 @@ stderr> assert failed - The name of the variable the user entered val into, - for inclusion in the error message. + The name of the variable the user entered val into, for inclusion in the error message. @@ -87,8 +83,7 @@ stderr> assert failed - The value of what the user provided, to be compared against the values in - xs. + The value of what the user provided, to be compared against the values in xs. diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index 65d0b40e2e82..f9234069392e 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -23,8 +23,7 @@ - A list of strings representing the path through the nested attribute set - set. + A list of strings representing the path through the nested attribute set set. @@ -34,8 +33,7 @@ - Default value if attrPath does not resolve to an - existing value. + Default value if attrPath does not resolve to an existing value. @@ -88,8 +86,7 @@ lib.attrsets.attrByPath [ "a" "b" ] 0 {} - A list of strings representing the path through the nested attribute set - set. + A list of strings representing the path through the nested attribute set set. @@ -125,8 +122,7 @@ lib.attrsets.hasAttrByPath - Create a new attribute set with value set at the nested - attribute location specified in attrPath. + Create a new attribute set with value set at the nested attribute location specified in attrPath. @@ -146,8 +142,7 @@ lib.attrsets.hasAttrByPath - The value to set at the location described by - attrPath. + The value to set at the location described by attrPath. @@ -171,8 +166,7 @@ lib.attrsets.setAttrByPath [ "a" "b" ] 3 - Like except - without a default, and it will throw if the value doesn't exist. + Like except without a default, and it will throw if the value doesn't exist. @@ -182,8 +176,7 @@ lib.attrsets.setAttrByPath [ "a" "b" ] 3 - A list of strings representing the path through the nested attribute set - set. + A list of strings representing the path through the nested attribute set set. @@ -235,8 +228,7 @@ lib.attrsets.getAttrFromPath [ "x" "y" ] { } - The list of attributes to fetch from set. Each - attribute name must exist on the attrbitue set. + The list of attributes to fetch from set. Each attribute name must exist on the attrbitue set. @@ -282,8 +274,7 @@ error: attribute 'd' missing - Provides a backwards-compatible interface of - builtins.attrValues for Nix version older than 1.8. + Provides a backwards-compatible interface of builtins.attrValues for Nix version older than 1.8. @@ -317,14 +308,11 @@ lib.attrsets.attrValues { a = 1; b = 2; c = 3; } - Collect each attribute named `attr' from the list of attribute sets, - sets. Sets that don't contain the named attribute are - ignored. + Collect each attribute named `attr' from the list of attribute sets, sets. Sets that don't contain the named attribute are ignored. - Provides a backwards-compatible interface of - builtins.catAttrs for Nix version older than 1.9. + Provides a backwards-compatible interface of builtins.catAttrs for Nix version older than 1.9. @@ -334,8 +322,7 @@ lib.attrsets.attrValues { a = 1; b = 2; c = 3; } - Attribute name to select from each attribute set in - sets. + Attribute name to select from each attribute set in sets. @@ -372,8 +359,7 @@ catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}] - Filter an attribute set by removing all attributes for which the given - predicate return false. + Filter an attribute set by removing all attributes for which the given predicate return false. @@ -386,8 +372,7 @@ catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}] String -> Any -> Bool - Predicate which returns true to include an attribute, or returns false to - exclude it. + Predicate which returns true to include an attribute, or returns false to exclude it. @@ -412,8 +397,7 @@ catAttrs "a" [{a = 1;} {b = 0;} {a = 2;}] - Returns true to include the attribute, - false to exclude the attribute. + Returns true to include the attribute, false to exclude the attribute. @@ -447,8 +431,7 @@ filterAttrs (n: v: n == "foo") { foo = 1; bar = 2; } - Filter an attribute set recursively by removing all attributes for which the - given predicate return false. + Filter an attribute set recursively by removing all attributes for which the given predicate return false. @@ -461,8 +444,7 @@ filterAttrs (n: v: n == "foo") { foo = 1; bar = 2; } String -> Any -> Bool - Predicate which returns true to include an attribute, or returns false to - exclude it. + Predicate which returns true to include an attribute, or returns false to exclude it. @@ -487,8 +469,7 @@ filterAttrs (n: v: n == "foo") { foo = 1; bar = 2; } - Returns true to include the attribute, - false to exclude the attribute. + Returns true to include the attribute, false to exclude the attribute. @@ -557,8 +538,7 @@ lib.attrsets.filterAttrsRecursive Any -> Any -> Any - Given a value val and a collector - col, combine the two. + Given a value val and a collector col, combine the two. @@ -578,8 +558,7 @@ lib.attrsets.filterAttrsRecursive - The result of previous op calls with other values - and nul. + The result of previous op calls with other values and nul. @@ -632,9 +611,7 @@ lib.attrsets.foldAttrs - Recursively collect sets that verify a given predicate named - pred from the set attrs. The recursion - stops when pred returns true. + Recursively collect sets that verify a given predicate named pred from the set attrs. The recursion stops when pred returns true. @@ -702,8 +679,7 @@ collect (x: x ? outPath) - Utility function that creates a {name, value} pair as - expected by builtins.listToAttrs. + Utility function that creates a {name, value} pair as expected by builtins.listToAttrs. @@ -747,13 +723,11 @@ nameValuePair "some" 6 - Apply a function to each element in an attribute set, creating a new - attribute set. + Apply a function to each element in an attribute set, creating a new attribute set. - Provides a backwards-compatible interface of - builtins.mapAttrs for Nix version older than 2.1. + Provides a backwards-compatible interface of builtins.mapAttrs for Nix version older than 2.1. @@ -814,9 +788,7 @@ lib.attrsets.mapAttrs - Like mapAttrs, but allows the name of each attribute to - be changed in addition to the value. The applied function should return both - the new name and value as a nameValuePair. + Like mapAttrs, but allows the name of each attribute to be changed in addition to the value. The applied function should return both the new name and value as a nameValuePair. @@ -829,10 +801,8 @@ lib.attrsets.mapAttrs String -> Any -> { name = String; value = Any } - Given an attribute's name and value, return a new - name - value pair. + Given an attribute's name and value, return a new name value pair. @@ -891,8 +861,7 @@ lib.attrsets.mapAttrs' (name: value: lib.attrsets.nameValuePair ("foo_" + name) - Call fn for each attribute in the given - set and return the result in a list. + Call fn for each attribute in the given set and return the result in a list. @@ -962,9 +931,7 @@ lib.attrsets.mapAttrsToList (name: value: "${name}=${value}") - Like mapAttrs, except that it recursively applies - itself to attribute sets. Also, the first argument of the argument function - is a list of the names of the containing attributes. + Like mapAttrs, except that it recursively applies itself to attribute sets. Also, the first argument of the argument function is a list of the names of the containing attributes. @@ -989,10 +956,7 @@ lib.attrsets.mapAttrsToList (name: value: "${name}=${value}") The list of attribute names to this value. - For example, the name_path for the - example string in the attribute set { foo - = { bar = "example"; }; } is [ "foo" "bar" - ]. + For example, the name_path for the example string in the attribute set { foo = { bar = "example"; }; } is [ "foo" "bar" ]. @@ -1059,11 +1023,7 @@ mapAttrsRecursive - Like mapAttrsRecursive, but it takes an additional - predicate function that tells it whether to recursive into an attribute set. - If it returns false, mapAttrsRecursiveCond does not - recurse, but does apply the map function. It is returns true, it does - recurse, and does not apply the map function. + Like mapAttrsRecursive, but it takes an additional predicate function that tells it whether to recursive into an attribute set. If it returns false, mapAttrsRecursiveCond does not recurse, but does apply the map function. It is returns true, it does recurse, and does not apply the map function. @@ -1076,8 +1036,7 @@ mapAttrsRecursive (AttrSet -> Bool) - Determine if mapAttrsRecursive should recurse deeper - in to the attribute set. + Determine if mapAttrsRecursive should recurse deeper in to the attribute set. @@ -1114,10 +1073,7 @@ mapAttrsRecursive The list of attribute names to this value. - For example, the name_path for the - example string in the attribute set { foo - = { bar = "example"; }; } is [ "foo" "bar" - ]. + For example, the name_path for the example string in the attribute set { foo = { bar = "example"; }; } is [ "foo" "bar" ]. @@ -1181,8 +1137,7 @@ lib.attrsets.mapAttrsRecursiveCond - Generate an attribute set by mapping a function over a list of attribute - names. + Generate an attribute set by mapping a function over a list of attribute names. @@ -1241,8 +1196,7 @@ lib.attrsets.genAttrs [ "foo" "bar" ] (name: "x_${name}") - Check whether the argument is a derivation. Any set with { type = - "derivation"; } counts as a derivation. + Check whether the argument is a derivation. Any set with { type = "derivation"; } counts as a derivation. @@ -1320,8 +1274,7 @@ lib.attrsets.isDerivation "foobar" - Condition under which the as attribute set is - returned. + Condition under which the as attribute set is returned. @@ -1363,8 +1316,7 @@ lib.attrsets.optionalAttrs false { my = "set"; } - Merge sets of attributes and use the function f to merge - attribute values where the attribute name is in names. + Merge sets of attributes and use the function f to merge attribute values where the attribute name is in names. @@ -1451,11 +1403,8 @@ lib.attrsets.zipAttrsWithNames - Merge sets of attributes and use the function f to merge - attribute values. Similar to - where - all key names are passed for names. + Merge sets of attributes and use the function f to merge attribute values. Similar to where all key names are passed for names. @@ -1531,9 +1480,7 @@ lib.attrsets.zipAttrsWith - Merge sets of attributes and combine each attribute value in to a list. - Similar to - where the merge function returns a list of all values. + Merge sets of attributes and combine each attribute value in to a list. Similar to where the merge function returns a list of all values. @@ -1573,12 +1520,7 @@ lib.attrsets.zipAttrs - Does the same as the update operator // except that - attributes are merged until the given predicate is verified. The predicate - should accept 3 arguments which are the path to reach the attribute, a part - of the first attribute set and a part of the second attribute set. When the - predicate is verified, the value of the first attribute set is replaced by - the value of the second attribute set. + Does the same as the update operator // except that attributes are merged until the given predicate is verified. The predicate should accept 3 arguments which are the path to reach the attribute, a part of the first attribute set and a part of the second attribute set. When the predicate is verified, the value of the first attribute set is replaced by the value of the second attribute set. @@ -1681,10 +1623,7 @@ lib.attrsets.recursiveUpdateUntil (path: l: r: path == ["foo"]) - A recursive variant of the update operator //. The - recursion stops when one of the attribute values is not an attribute set, in - which case the right hand side value takes precedence over the left hand - side value. + A recursive variant of the update operator //. The recursion stops when one of the attribute values is not an attribute set, in which case the right hand side value takes precedence over the left hand side value. diff --git a/doc/functions/nix-gitignore.xml b/doc/functions/nix-gitignore.xml index 9011570d1eae..37a82b196ccf 100644 --- a/doc/functions/nix-gitignore.xml +++ b/doc/functions/nix-gitignore.xml @@ -5,21 +5,14 @@ pkgs.nix-gitignore - pkgs.nix-gitignore is a function that acts similarly to - builtins.filterSource but also allows filtering with the - help of the gitignore format. + pkgs.nix-gitignore is a function that acts similarly to builtins.filterSource but also allows filtering with the help of the gitignore format.
Usage - pkgs.nix-gitignore exports a number of functions, but - you'll most likely need either gitignoreSource or - gitignoreSourcePure. As their first argument, they both - accept either 1. a file with gitignore lines or 2. a string with gitignore - lines, or 3. a list of either of the two. They will be concatenated into a - single big string. + pkgs.nix-gitignore exports a number of functions, but you'll most likely need either gitignoreSource or gitignoreSourcePure. As their first argument, they both accept either 1. a file with gitignore lines or 2. a string with gitignore lines, or 3. a list of either of the two. They will be concatenated into a single big string. - These functions are derived from the Filter functions by - setting the first filter argument to (_: _: true): + These functions are derived from the Filter functions by setting the first filter argument to (_: _: true): - Those filter functions accept the same arguments the - builtins.filterSource function would pass to its filters, - thus fn: gitignoreFilterSourcePure fn "" should be - extensionally equivalent to filterSource. The file is - blacklisted iff it's blacklisted by either your filter or the - gitignoreFilter. + Those filter functions accept the same arguments the builtins.filterSource function would pass to its filters, thus fn: gitignoreFilterSourcePure fn "" should be extensionally equivalent to filterSource. The file is blacklisted iff it's blacklisted by either your filter or the gitignoreFilter. @@ -71,8 +58,7 @@ gitignoreFilter = ign: root: filterPattern (gitignoreToPatterns ign) root; gitignore files in subdirectories - If you wish to use a filter that would search for .gitignore files in - subdirectories, just like git does by default, use this function: + If you wish to use a filter that would search for .gitignore files in subdirectories, just like git does by default, use this function: pkgs.ociTools - pkgs.ociTools is a set of functions for creating - containers according to the - OCI - container specification v1.0.0. Beyond that it makes no assumptions - about the container runner you choose to use to run the created container. + pkgs.ociTools is a set of functions for creating containers according to the OCI container specification v1.0.0. Beyond that it makes no assumptions about the container runner you choose to use to run the created container.
buildContainer - This function creates a simple OCI container that runs a single command - inside of it. An OCI container consists of a config.json - and a rootfs directory.The nix store of the container will contain all - referenced dependencies of the given command. + This function creates a simple OCI container that runs a single command inside of it. An OCI container consists of a config.json and a rootfs directory.The nix store of the container will contain all referenced dependencies of the given command. - The parameters of buildContainer with an example value - are described below: + The parameters of buildContainer with an example value are described below: @@ -51,23 +43,17 @@ buildContainer { - args specifies a set of arguments to run inside the - container. This is the only required argument for - buildContainer. All referenced packages inside the - derivation will be made available inside the container + args specifies a set of arguments to run inside the container. This is the only required argument for buildContainer. All referenced packages inside the derivation will be made available inside the container - mounts specifies additional mount points chosen by the - user. By default only a minimal set of necessary filesystems are mounted - into the container (e.g procfs, cgroupfs) + mounts specifies additional mount points chosen by the user. By default only a minimal set of necessary filesystems are mounted into the container (e.g procfs, cgroupfs) - readonly makes the container's rootfs read-only if it - is set to true. The default value is false false. + readonly makes the container's rootfs read-only if it is set to true. The default value is false false. diff --git a/doc/functions/overrides.xml b/doc/functions/overrides.xml index 1bd90d2a0c76..4ba4283c6094 100644 --- a/doc/functions/overrides.xml +++ b/doc/functions/overrides.xml @@ -5,23 +5,18 @@ Overriding - Sometimes one wants to override parts of nixpkgs, e.g. - derivation attributes, the results of derivations. + Sometimes one wants to override parts of nixpkgs, e.g. derivation attributes, the results of derivations. - These functions are used to make changes to packages, returning only single - packages. Overlays, 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. Overlays, on the other hand, can be used to combine the overridden packages across the entire package set of Nixpkgs.
<pkg>.override - The function override is usually available for all the - derivations in the nixpkgs expression (pkgs). + The function override is usually available for all the derivations in the nixpkgs expression (pkgs). @@ -47,10 +42,7 @@ mypkg = pkgs.callPackage ./mypkg.nix { - In the first example, pkgs.foo is the result of a - function call with some default arguments, usually a derivation. Using - pkgs.foo.override will call the same function with the - given new arguments. + In the first example, pkgs.foo is the result of a function call with some default arguments, usually a derivation. Using pkgs.foo.override will call the same function with the given new arguments.
@@ -58,12 +50,7 @@ mypkg = pkgs.callPackage ./mypkg.nix { <pkg>.overrideAttrs - The function overrideAttrs allows overriding the - attribute set passed to a stdenv.mkDerivation call, - producing a new derivation based on the original one. This function is - available on all derivations produced by the - stdenv.mkDerivation function, which is most packages in - the nixpkgs expression pkgs. + The function overrideAttrs allows overriding the attribute set passed to a stdenv.mkDerivation call, producing a new derivation based on the original one. This function is available on all derivations produced by the stdenv.mkDerivation function, which is most packages in the nixpkgs expression pkgs. @@ -76,30 +63,16 @@ helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec { - In the above example, the separateDebugInfo attribute is - overridden to be true, thus building debug info for - helloWithDebug, while all other attributes will be - retained from the original hello package. + In the above example, the separateDebugInfo attribute is overridden to be true, thus building debug info for helloWithDebug, while all other attributes will be retained from the original hello package. - The argument oldAttrs is conventionally used to refer to - the attr set originally passed to stdenv.mkDerivation. + The argument oldAttrs is conventionally used to refer to the attr set originally passed to stdenv.mkDerivation. - Note that separateDebugInfo is processed only by the - stdenv.mkDerivation function, not the generated, raw Nix - derivation. Thus, using overrideDerivation will not work - in this case, as it overrides only the attributes of the final derivation. - It is for this reason that overrideAttrs should be - preferred in (almost) all cases to overrideDerivation, - i.e. to allow using stdenv.mkDerivation to process input - arguments, as well as the fact that it is easier to use (you can use the - same attribute names you see in your Nix code, instead of the ones - generated (e.g. buildInputs vs - nativeBuildInputs), and it involves less typing). + Note that separateDebugInfo is processed only by the stdenv.mkDerivation function, not the generated, raw Nix derivation. Thus, using overrideDerivation will not work in this case, as it overrides only the attributes of the final derivation. It is for this reason that overrideAttrs should be preferred in (almost) all cases to overrideDerivation, i.e. to allow using stdenv.mkDerivation to process input arguments, as well as the fact that it is easier to use (you can use the same attribute names you see in your Nix code, instead of the ones generated (e.g. buildInputs vs nativeBuildInputs), and it involves less typing).
@@ -109,34 +82,18 @@ helloWithDebug = pkgs.hello.overrideAttrs (oldAttrs: rec { - You should prefer overrideAttrs in almost all cases, see - its documentation for the reasons why. - overrideDerivation is not deprecated and will continue - to work, but is less nice to use and does not have as many abilities as - overrideAttrs. + You should prefer overrideAttrs in almost all cases, see its documentation for the reasons why. overrideDerivation is not deprecated and will continue to work, but is less nice to use and does not have as many abilities as overrideAttrs. - Do not use this function in Nixpkgs as it evaluates a Derivation before - modifying it, which breaks package abstraction and removes error-checking - of function arguments. In addition, this evaluation-per-function - application incurs a performance penalty, which can become a problem if - many overrides are used. It is only intended for ad-hoc customisation, such - as in ~/.config/nixpkgs/config.nix. + Do not use this function in Nixpkgs as it evaluates a Derivation before modifying it, which breaks package abstraction and removes error-checking of function arguments. In addition, this evaluation-per-function application incurs a performance penalty, which can become a problem if many overrides are used. It is only intended for ad-hoc customisation, such as in ~/.config/nixpkgs/config.nix. - The function overrideDerivation creates a new derivation - based on an existing one by overriding the original's attributes with the - attribute set produced by the specified function. This function is available - on all derivations defined using the makeOverridable - function. Most standard derivation-producing functions, such as - stdenv.mkDerivation, are defined using this function, - which means most packages in the nixpkgs expression, - pkgs, have this function. + The function overrideDerivation creates a new derivation based on an existing one by overriding the original's attributes with the attribute set produced by the specified function. This function is available on all derivations defined using the makeOverridable function. Most standard derivation-producing functions, such as stdenv.mkDerivation, are defined using this function, which means most packages in the nixpkgs expression, pkgs, have this function. @@ -154,27 +111,16 @@ mySed = pkgs.gnused.overrideDerivation (oldAttrs: { - In the above example, the name, src, - and patches of the derivation will be overridden, while - all other attributes will be retained from the original derivation. + In the above example, the name, src, and patches of the derivation will be overridden, while all other attributes will be retained from the original derivation. - The argument oldAttrs is used to refer to the attribute - set of the original derivation. + The argument oldAttrs is used to refer to the attribute set of the original derivation. - A package's attributes are evaluated *before* being modified by the - overrideDerivation function. For example, the - name attribute reference in url = - "mirror://gnu/hello/${name}.tar.gz"; is filled-in *before* the - overrideDerivation function modifies the attribute set. - This means that overriding the name attribute, in this - example, *will not* change the value of the url - attribute. Instead, we need to override both the name - *and* url attributes. + A package's attributes are evaluated *before* being modified by the overrideDerivation function. For example, the name attribute reference in url = "mirror://gnu/hello/${name}.tar.gz"; is filled-in *before* the overrideDerivation function modifies the attribute set. This means that overriding the name attribute, in this example, *will not* change the value of the url attribute. Instead, we need to override both the name *and* url attributes.
@@ -183,9 +129,7 @@ mySed = pkgs.gnused.overrideDerivation (oldAttrs: { lib.makeOverridable - The function lib.makeOverridable is used to make the - result of a function easily customizable. This utility only makes sense for - functions that accept an argument set and return an attribute set. + The function lib.makeOverridable is used to make the result of a function easily customizable. This utility only makes sense for functions that accept an argument set and return an attribute set. @@ -197,16 +141,11 @@ c = lib.makeOverridable f { a = 1; b = 2; }; - The variable c is the value of the f - function applied with some default arguments. Hence the value of - c.result is 3, in this example. + The variable c is the value of the f function applied with some default arguments. Hence the value of c.result is 3, in this example. - The variable c however also has some additional - functions, like c.override which can - be used to override the default arguments. In this example the value of - (c.override { a = 4; }).result is 6. + The variable c however also has some additional functions, like c.override which can be used to override the default arguments. In this example the value of (c.override { a = 4; }).result is 6. diff --git a/doc/functions/prefer-remote-fetch.xml b/doc/functions/prefer-remote-fetch.xml index 3e43fd28ade8..94d25d3d3aeb 100644 --- a/doc/functions/prefer-remote-fetch.xml +++ b/doc/functions/prefer-remote-fetch.xml @@ -5,16 +5,12 @@ prefer-remote-fetch overlay - prefer-remote-fetch is an overlay that download sources - on remote builder. This is useful when the evaluating machine has a slow - upload while the builder can fetch faster directly from the source. To use - it, put the following snippet as a new overlay: + prefer-remote-fetch is an overlay that download sources on remote builder. This is useful when the evaluating machine has a slow upload while the builder can fetch faster directly from the source. To use it, put the following snippet as a new overlay: self: super: (super.prefer-remote-fetch self super) - A full configuration example for that sets the overlay up for your own - account, could look like this + A full configuration example for that sets the overlay up for your own account, could look like this $ mkdir ~/.config/nixpkgs/overlays/ $ cat > ~/.config/nixpkgs/overlays/prefer-remote-fetch.nix <<EOF diff --git a/doc/functions/shell.xml b/doc/functions/shell.xml index e5031c9463c0..cef65d06b882 100644 --- a/doc/functions/shell.xml +++ b/doc/functions/shell.xml @@ -5,9 +5,7 @@ pkgs.mkShell - pkgs.mkShell is a special kind of derivation that is - only useful when using it combined with nix-shell. It will - in fact fail to instantiate when invoked with nix-build. + pkgs.mkShell is a special kind of derivation that is only useful when using it combined with nix-shell. It will in fact fail to instantiate when invoked with nix-build.
diff --git a/doc/functions/snaptools.xml b/doc/functions/snaptools.xml index d0e3efdf6c67..422fcfa37d88 100644 --- a/doc/functions/snaptools.xml +++ b/doc/functions/snaptools.xml @@ -5,28 +5,22 @@ pkgs.snapTools - pkgs.snapTools is a set of functions for creating - Snapcraft images. Snap and Snapcraft is not used to perform these operations. + pkgs.snapTools is a set of functions for creating Snapcraft images. Snap and Snapcraft is not used to perform these operations.
The makeSnap Function - makeSnap takes a single named argument, - meta. This argument mirrors - the upstream - snap.yaml format exactly. + makeSnap takes a single named argument, meta. This argument mirrors the upstream snap.yaml format exactly. - The base should not be be specified, as - makeSnap will force set it. + The base should not be be specified, as makeSnap will force set it. - Currently, makeSnap does not support creating GUI - stubs. + Currently, makeSnap does not support creating GUI stubs.
@@ -40,9 +34,7 @@ - nix-build this expression and install it with - snap install ./result --dangerous. - hello will now be the Snapcraft version of the package. + nix-build this expression and install it with snap install ./result --dangerous. hello will now be the Snapcraft version of the package.
@@ -53,21 +45,14 @@ Making a Graphical Snap - Graphical programs require many more integrations with the host. This - example uses Firefox as an example, because it is one of the most - complicated programs we could package. + Graphical programs require many more integrations with the host. This example uses Firefox as an example, because it is one of the most complicated programs we could package. - nix-build this expression and install it with - snap install ./result --dangerous. - nix-example-firefox will now be the Snapcraft version of - the Firefox package. + nix-build this expression and install it with snap install ./result --dangerous. nix-example-firefox will now be the Snapcraft version of the Firefox package. - The specific meaning behind plugs can be looked up in the - Snapcraft - interface documentation. + The specific meaning behind plugs can be looked up in the Snapcraft interface documentation. diff --git a/doc/functions/trivial-builders.xml b/doc/functions/trivial-builders.xml index 0211a4f31728..ae9f3a1b255d 100644 --- a/doc/functions/trivial-builders.xml +++ b/doc/functions/trivial-builders.xml @@ -5,11 +5,7 @@ Trivial builders - Nixpkgs provides a couple of functions that help with building derivations. - The most important one, stdenv.mkDerivation, has already - been documented above. The following functions wrap - stdenv.mkDerivation, making it easier to use in certain - cases. + Nixpkgs provides a couple of functions that help with building derivations. The most important one, stdenv.mkDerivation, has already been documented above. The following functions wrap stdenv.mkDerivation, making it easier to use in certain cases. @@ -19,17 +15,7 @@ - This takes three arguments, name, - env, and buildCommand. - name is just the name that Nix will append to the store - path in the same way that stdenv.mkDerivation uses its - name attribute. env is an attribute - set specifying environment variables that will be set for this derivation. - These attributes are then passed to the wrapped - stdenv.mkDerivation. buildCommand - specifies the commands that will be run to create this derivation. Note - that you will need to create $out for Nix to register - the command as successful. + This takes three arguments, name, env, and buildCommand. name is just the name that Nix will append to the store path in the same way that stdenv.mkDerivation uses its name attribute. env is an attribute set specifying environment variables that will be set for this derivation. These attributes are then passed to the wrapped stdenv.mkDerivation. buildCommand specifies the commands that will be run to create this derivation. Note that you will need to create $out for Nix to register the command as successful. An example of using runCommand is provided below. @@ -62,10 +48,7 @@ - This works just like runCommand. The only difference is - that it also provides a C compiler in buildCommand’s - environment. To minimize your dependencies, you should only use this if - you are sure you will need a C compiler as part of running your command. + This works just like runCommand. The only difference is that it also provides a C compiler in buildCommand’s environment. To minimize your dependencies, you should only use this if you are sure you will need a C compiler as part of running your command. @@ -75,20 +58,10 @@ - These functions write text to the Nix store. This is - useful for creating scripts from Nix expressions. - writeTextFile takes an attribute set and expects two - arguments, name and text. - name corresponds to the name used in the Nix store - path. text will be the contents of the file. You can - also set executable to true to make this file have the - executable bit set. + These functions write text to the Nix store. This is useful for creating scripts from Nix expressions. writeTextFile takes an attribute set and expects two arguments, name and text. name corresponds to the name used in the Nix store path. text will be the contents of the file. You can also set executable to true to make this file have the executable bit set. - Many more commands wrap writeTextFile including - writeText, writeTextDir, - writeScript, and writeScriptBin. - These are convenience functions over writeTextFile. + Many more commands wrap writeTextFile including writeText, writeTextDir, writeScript, and writeScriptBin. These are convenience functions over writeTextFile. @@ -98,14 +71,7 @@ - This can be used to put many derivations into the same directory - structure. It works by creating a new derivation and adding symlinks to - each of the paths listed. It expects two arguments, - name, and paths. - name is the name used in the Nix store path for the - created derivation. paths is a list of paths that will - be symlinked. These paths can be to Nix store derivations or any other - subdirectory contained within. + This can be used to put many derivations into the same directory structure. It works by creating a new derivation and adding symlinks to each of the paths listed. It expects two arguments, name, and paths. name is the name used in the Nix store path for the created derivation. paths is a list of paths that will be symlinked. These paths can be to Nix store derivations or any other subdirectory contained within. diff --git a/doc/languages-frameworks/beam.xml b/doc/languages-frameworks/beam.xml index dee7f2d74191..65f28d0a2d3b 100644 --- a/doc/languages-frameworks/beam.xml +++ b/doc/languages-frameworks/beam.xml @@ -7,12 +7,7 @@ Introduction - In this document and related Nix expressions, we use the term, - BEAM, to describe the environment. BEAM is the name of - the Erlang Virtual Machine and, as far as we're concerned, from a packaging - perspective, all languages that run on the BEAM are interchangeable. That - which varies, like the build system, is transparent to users of any given - BEAM package, so we make no distinction. + In this document and related Nix expressions, we use the term, BEAM, to describe the environment. BEAM is the name of the Erlang Virtual Machine and, as far as we're concerned, from a packaging perspective, all languages that run on the BEAM are interchangeable. That which varies, like the build system, is transparent to users of any given BEAM package, so we make no distinction. @@ -20,57 +15,36 @@ Structure - All BEAM-related expressions are available via the top-level - beam attribute, which includes: + All BEAM-related expressions are available via the top-level beam attribute, which includes: - interpreters: a set of compilers running on the BEAM, - including multiple Erlang/OTP versions - (beam.interpreters.erlangR19, etc), Elixir - (beam.interpreters.elixir) and LFE - (beam.interpreters.lfe). + interpreters: a set of compilers running on the BEAM, including multiple Erlang/OTP versions (beam.interpreters.erlangR19, etc), Elixir (beam.interpreters.elixir) and LFE (beam.interpreters.lfe). - packages: a set of package sets, each compiled with a - specific Erlang/OTP version, e.g. - beam.packages.erlangR19. + packages: a set of package sets, each compiled with a specific Erlang/OTP version, e.g. beam.packages.erlangR19. - The default Erlang compiler, defined by - beam.interpreters.erlang, is aliased as - erlang. The default BEAM package set is defined by - beam.packages.erlang and aliased at the top level as - beamPackages. + The default Erlang compiler, defined by beam.interpreters.erlang, is aliased as erlang. The default BEAM package set is defined by beam.packages.erlang and aliased at the top level as beamPackages. - To create a package set built with a custom Erlang version, use the lambda, - beam.packagesWith, which accepts an Erlang/OTP derivation - and produces a package set similar to - beam.packages.erlang. + To create a package set built with a custom Erlang version, use the lambda, beam.packagesWith, which accepts an Erlang/OTP derivation and produces a package set similar to beam.packages.erlang. - Many Erlang/OTP distributions available in - beam.interpreters have versions with ODBC and/or Java - enabled. For example, there's - beam.interpreters.erlangR19_odbc_javac, which corresponds - to beam.interpreters.erlangR19. + Many Erlang/OTP distributions available in beam.interpreters have versions with ODBC and/or Java enabled. For example, there's beam.interpreters.erlangR19_odbc_javac, which corresponds to beam.interpreters.erlangR19. - We also provide the lambda, - beam.packages.erlang.callPackage, which simplifies - writing BEAM package definitions by injecting all packages from - beam.packages.erlang into the top-level context. + We also provide the lambda, beam.packages.erlang.callPackage, which simplifies writing BEAM package definitions by injecting all packages from beam.packages.erlang into the top-level context. @@ -81,24 +55,16 @@ Rebar3 - By default, Rebar3 wants to manage its own dependencies. This is perfectly - acceptable in the normal, non-Nix setup, but in the Nix world, it is not. - To rectify this, we provide two versions of Rebar3: + By default, Rebar3 wants to manage its own dependencies. This is perfectly acceptable in the normal, non-Nix setup, but in the Nix world, it is not. To rectify this, we provide two versions of Rebar3: - rebar3: patched to remove the ability to download - anything. When not running it via nix-shell or - nix-build, it's probably not going to work as - desired. + rebar3: patched to remove the ability to download anything. When not running it via nix-shell or nix-build, it's probably not going to work as desired. - rebar3-open: the normal, unmodified Rebar3. It should - work exactly as would any other version of Rebar3. Any Erlang package - should rely on rebar3 instead. See - rebar3-open: the normal, unmodified Rebar3. It should work exactly as would any other version of Rebar3. Any Erlang package should rely on rebar3 instead. See . @@ -110,10 +76,7 @@ Mix & Erlang.mk - Both Mix and Erlang.mk work exactly as expected. There is a bootstrap - process that needs to be run for both, however, which is supported by the - buildMix and buildErlangMk - derivations, respectively. + Both Mix and Erlang.mk work exactly as expected. There is a bootstrap process that needs to be run for both, however, which is supported by the buildMix and buildErlangMk derivations, respectively. @@ -122,13 +85,7 @@ How to Install BEAM Packages - 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 beam.packages.erlang attribute set (aliased as - beamPackages), which points to packages built by the - default Erlang/OTP version in Nixpkgs, as defined by - beam.interpreters.erlang. To list the available packages - in beamPackages, use the following command: + 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 beam.packages.erlang attribute set (aliased as beamPackages), which points to packages built by the default Erlang/OTP version in Nixpkgs, as defined by beam.interpreters.erlang. To list the available packages in beamPackages, use the following command: @@ -143,8 +100,7 @@ beamPackages.rebar3-pc pc-1.1.0 - To install any of those packages into your profile, refer to them by their - attribute path (first column): + To install any of those packages into your profile, refer to them by their attribute path (first column): @@ -152,9 +108,7 @@ beamPackages.rebar3-pc pc-1.1.0 - The attribute path of any BEAM package corresponds to the name of that - particular package in Hex or its - OTP Application/Release name. + The attribute path of any BEAM package corresponds to the name of that particular package in Hex or its OTP Application/Release name. @@ -168,13 +122,8 @@ beamPackages.rebar3-pc pc-1.1.0 Rebar3 Packages - The Nix function, buildRebar3, defined in - beam.packages.erlang.buildRebar3 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 - hex2nix - as follows: + The Nix function, buildRebar3, defined in beam.packages.erlang.buildRebar3 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 hex2nix as follows: @@ -196,25 +145,16 @@ buildRebar3 rec { - Such derivations are callable with - beam.packages.erlang.callPackage (see - ). To call this package using - the normal callPackage, refer to dependency packages - via beamPackages, e.g. - beamPackages.ibrowse. + Such derivations are callable with beam.packages.erlang.callPackage (see ). To call this package using the normal callPackage, refer to dependency packages via beamPackages, e.g. beamPackages.ibrowse. - Notably, buildRebar3 includes - beamDeps, while stdenv.mkDerivation - does not. BEAM dependencies added there will be correctly handled by the - system. + Notably, buildRebar3 includes beamDeps, while stdenv.mkDerivation does not. BEAM dependencies added there will be correctly handled by the system. - If a package needs to compile native code via Rebar3's port compilation - mechanism, add compilePort = true; to the derivation. + If a package needs to compile native code via Rebar3's port compilation mechanism, add compilePort = true; to the derivation. @@ -222,9 +162,7 @@ buildRebar3 rec { Erlang.mk Packages - Erlang.mk functions similarly to Rebar3, except we use - buildErlangMk instead of - buildRebar3. + Erlang.mk functions similarly to Rebar3, except we use buildErlangMk instead of buildRebar3. @@ -257,8 +195,7 @@ buildErlangMk { Mix Packages - Mix functions similarly to Rebar3, except we use - buildMix instead of buildRebar3. + Mix functions similarly to Rebar3, except we use buildMix instead of buildRebar3. @@ -323,11 +260,7 @@ buildHex { Accessing an Environment - Often, we simply want to access a valid environment that contains a - specific package and its dependencies. We can accomplish that with the - env attribute of a derivation. For example, let's say we - want to access an Erlang REPL with ibrowse loaded up. We - could do the following: + Often, we simply want to access a valid environment that contains a specific package and its dependencies. We can accomplish that with the env attribute of a derivation. For example, let's say we want to access an Erlang REPL with ibrowse loaded up. We could do the following: @@ -373,8 +306,7 @@ ok - Notice the -A beamPackages.ibrowse.env. That is the key - to this functionality. + Notice the -A beamPackages.ibrowse.env. That is the key to this functionality. @@ -382,11 +314,7 @@ ok Creating a Shell - Getting access to an environment often isn't enough to do real development. - Usually, we need to create a shell.nix file and do our - development inside of the environment specified therein. This file looks a - lot like the packaging described above, except that src - points to the project root and we call the package directly. + Getting access to an environment often isn't enough to do real development. Usually, we need to create a shell.nix file and do our development inside of the environment specified therein. This file looks a lot like the packaging described above, except that src points to the project root and we call the package directly. @@ -414,8 +342,7 @@ in Building in a Shell (for Mix Projects) - We can leverage the support of the derivation, irrespective of the build - derivation, by calling the commands themselves. + We can leverage the support of the derivation, irrespective of the build derivation, by calling the commands themselves. @@ -477,12 +404,8 @@ analyze: build plt - Using a shell.nix as described (see - ) should just work. Aside from - test, plt, and - analyze, the Make targets work just fine for all of the - build derivations. + Using a shell.nix as described (see ) should just work. Aside from test, plt, and analyze, the Make targets work just fine for all of the build derivations. @@ -492,25 +415,14 @@ analyze: build plt Generating Packages from Hex with <literal>hex2nix</literal> - Updating the Hex package set - requires - hex2nix. - Given the path to the Erlang modules (usually - pkgs/development/erlang-modules), it will dump a file - called hex-packages.nix, containing all the packages that - use a recognized build system in - Hex. It can't be determined, - however, whether every package is buildable. + Updating the Hex package set requires hex2nix. Given the path to the Erlang modules (usually pkgs/development/erlang-modules), it will dump a file called hex-packages.nix, containing all the packages that use a recognized build system in Hex. It can't be determined, however, whether every package is buildable. - To make life easier for our users, try to build every - Hex package and remove those - that fail. To do that, simply run the following command in the root of your - nixpkgs repository: + To make life easier for our users, try to build every Hex package and remove those that fail. To do that, simply run the following command in the root of your nixpkgs repository: @@ -518,11 +430,8 @@ analyze: build plt - That will attempt to build every package in beamPackages. - Then manually remove those that fail. Hopefully, someone will improve - hex2nix - in the future to automate the process. + That will attempt to build every package in beamPackages. Then manually remove those that fail. Hopefully, someone will improve hex2nix in the future to automate the process. diff --git a/doc/languages-frameworks/bower.xml b/doc/languages-frameworks/bower.xml index 118f6e10473a..b0738cad293b 100644 --- a/doc/languages-frameworks/bower.xml +++ b/doc/languages-frameworks/bower.xml @@ -4,32 +4,22 @@ Bower - Bower is a package manager for web - site front-end components. Bower packages (comprising of build artefacts and - sometimes sources) are stored in git repositories, - typically on Github. The package registry is run by the Bower team with - package metadata coming from the bower.json file within - each package. + Bower is a package manager for web site front-end components. Bower packages (comprising of build artefacts and sometimes sources) are stored in git repositories, typically on Github. The package registry is run by the Bower team with package metadata coming from the bower.json file within each package. - The end result of running Bower is a bower_components - directory which can be included in the web app's build process. + The end result of running Bower is a bower_components directory which can be included in the web app's build process. - Bower can be run interactively, by installing - nodePackages.bower. More interestingly, the Bower - components can be declared in a Nix derivation, with the help of - nodePackages.bower2nix. + Bower can be run interactively, by installing nodePackages.bower. More interestingly, the Bower components can be declared in a Nix derivation, with the help of nodePackages.bower2nix.
<command>bower2nix</command> usage - Suppose you have a bower.json with the following - contents: + Suppose you have a bower.json with the following contents: <filename>bower.json</filename> @@ -45,8 +35,7 @@ - Running bower2nix will produce something like the - following output: + Running bower2nix will produce something like the following output: - Using the bower2nix command line arguments, the output - can be redirected to a file. A name like - bower-packages.nix would be fine. + Using the bower2nix command line arguments, the output can be redirected to a file. A name like bower-packages.nix would be fine. - The resulting derivation is a union of all the downloaded Bower packages - (and their dependencies). To use it, they still need to be linked together - by Bower, which is where buildBowerComponents is useful. + The resulting derivation is a union of all the downloaded Bower packages (and their dependencies). To use it, they still need to be linked together by Bower, which is where buildBowerComponents is useful.
@@ -74,10 +59,7 @@ buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [ <varname>buildBowerComponents</varname> function - The function is implemented in - - pkgs/development/bower-modules/generic/default.nix. - Example usage: + The function is implemented in pkgs/development/bower-modules/generic/default.nix. Example usage: buildBowerComponents @@ -91,34 +73,27 @@ bowerComponents = buildBowerComponents { - In , the following arguments are - of special significance to the function: + In , the following arguments are of special significance to the function: - generated specifies the file which was created by - bower2nix. + generated specifies the file which was created by bower2nix. - src is your project's sources. It needs to contain a - bower.json file. + src is your project's sources. It needs to contain a bower.json file. - buildBowerComponents will run Bower to link together the - output of bower2nix, resulting in a - bower_components directory which can be used. + buildBowerComponents will run Bower to link together the output of bower2nix, resulting in a bower_components directory which can be used. - Here is an example of a web frontend build process using - gulp. You might use grunt, or anything - else. + Here is an example of a web frontend build process using gulp. You might use grunt, or anything else. @@ -174,21 +149,17 @@ pkgs.stdenv.mkDerivation { - The result of buildBowerComponents is an input to the - frontend build. + The result of buildBowerComponents is an input to the frontend build. - Whether to symlink or copy the bower_components - directory depends on the build tool in use. In this case a copy is used - to avoid gulp silliness with permissions. + Whether to symlink or copy the bower_components directory depends on the build tool in use. In this case a copy is used to avoid gulp silliness with permissions. - gulp requires HOME to refer to a - writeable directory. + gulp requires HOME to refer to a writeable directory. @@ -210,17 +181,13 @@ pkgs.stdenv.mkDerivation { - This means that Bower was looking for a package version which doesn't - exist in the generated bower-packages.nix. + This means that Bower was looking for a package version which doesn't exist in the generated bower-packages.nix. - If bower.json has been updated, then run - bower2nix again. + If bower.json has been updated, then run bower2nix again. - It could also be a bug in bower2nix or - fetchbower. If possible, try reformulating the version - specification in bower.json. + It could also be a bug in bower2nix or fetchbower. If possible, try reformulating the version specification in bower.json. diff --git a/doc/languages-frameworks/coq.xml b/doc/languages-frameworks/coq.xml index 4314df5c9df2..86d9226166f5 100644 --- a/doc/languages-frameworks/coq.xml +++ b/doc/languages-frameworks/coq.xml @@ -4,31 +4,19 @@ Coq - Coq libraries should be installed in - $(out)/lib/coq/${coq.coq-version}/user-contrib/. Such - directories are automatically added to the $COQPATH - environment variable by the hook defined in the Coq derivation. + Coq libraries should be installed in $(out)/lib/coq/${coq.coq-version}/user-contrib/. Such directories are automatically added to the $COQPATH environment variable by the hook defined in the Coq derivation. - Some extensions (plugins) might require OCaml and sometimes other OCaml - packages. The coq.ocamlPackages attribute can be used to - depend on the same package set Coq was built against. + Some extensions (plugins) might require OCaml and sometimes other OCaml packages. The coq.ocamlPackages attribute can be used to depend on the same package set Coq was built against. - Coq libraries may be compatible with some specific versions of Coq only. The - compatibleCoqVersions attribute is used to precisely - select those versions of Coq that are compatible with this derivation. + Coq libraries may be compatible with some specific versions of Coq only. The compatibleCoqVersions attribute is used to precisely select those versions of Coq that are compatible with this derivation. - Here is a simple package example. It is a pure Coq library, thus it depends - on Coq. It builds on the Mathematical Components library, thus it also takes - mathcomp as buildInputs. Its - Makefile has been generated using - coq_makefile so we only have to set the - $COQLIB variable at install time. + Here is a simple package example. It is a pure Coq library, thus it depends on Coq. It builds on the Mathematical Components library, thus it also takes mathcomp as buildInputs. Its Makefile has been generated using coq_makefile so we only have to set the $COQLIB variable at install time. diff --git a/doc/languages-frameworks/gnome.xml b/doc/languages-frameworks/gnome.xml index 42b4ae04322f..9e0f21a6c74f 100644 --- a/doc/languages-frameworks/gnome.xml +++ b/doc/languages-frameworks/gnome.xml @@ -5,53 +5,26 @@ Packaging GNOME applications - Programs in the GNOME universe are written in various languages but they all - use GObject-based libraries like GLib, GTK or GStreamer. These libraries are - often modular, relying on looking into certain directories to find their - modules. However, due to Nix’s specific file system organization, this - will fail without our intervention. Fortunately, the libraries usually allow - overriding the directories through environment variables, either natively or - thanks to a patch in nixpkgs. - Wrapping the executables to - ensure correct paths are available to the application constitutes a - significant part of packaging a modern desktop application. In this section, - we will describe various modules needed by such applications, environment - variables needed to make the modules load, and finally a script that will do - the work for us. + Programs in the GNOME universe are written in various languages but they all use GObject-based libraries like GLib, GTK or GStreamer. These libraries are often modular, relying on looking into certain directories to find their modules. However, due to Nix’s specific file system organization, this will fail without our intervention. Fortunately, the libraries usually allow overriding the directories through environment variables, either natively or thanks to a patch in nixpkgs. Wrapping the executables to ensure correct paths are available to the application constitutes a significant part of packaging a modern desktop application. In this section, we will describe various modules needed by such applications, environment variables needed to make the modules load, and finally a script that will do the work for us.
Settings - GSettings - API is often used for storing settings. GSettings schemas are required, to - know the type and other metadata of the stored values. GLib looks for - glib-2.0/schemas/gschemas.compiled files inside the - directories of XDG_DATA_DIRS. + GSettings API is often used for storing settings. GSettings schemas are required, to know the type and other metadata of the stored values. GLib looks for glib-2.0/schemas/gschemas.compiled files inside the directories of XDG_DATA_DIRS. - On Linux, GSettings API is implemented using - dconf - backend. You will need to add dconf GIO module to - GIO_EXTRA_MODULES variable, otherwise the - memory backend will be used and the saved settings will - not be persistent. + On Linux, GSettings API is implemented using dconf backend. You will need to add dconf GIO module to GIO_EXTRA_MODULES variable, otherwise the memory backend will be used and the saved settings will not be persistent. - Last you will need the dconf database D-Bus service itself. You can enable - it using . + Last you will need the dconf database D-Bus service itself. You can enable it using . - Some applications will also require - gsettings-desktop-schemas for things like reading proxy - configuration or user interface customization. This dependency is often not - mentioned by upstream, you should grep for - org.gnome.desktop and - org.gnome.system to see if the schemas are needed. + Some applications will also require gsettings-desktop-schemas for things like reading proxy configuration or user interface customization. This dependency is often not mentioned by upstream, you should grep for org.gnome.desktop and org.gnome.system to see if the schemas are needed.
@@ -59,16 +32,7 @@ Icons - When an application uses icons, an icon theme should be available in - XDG_DATA_DIRS. The package for the default, icon-less - hicolor-icon-theme - contains a setup - hook that will pick up icon themes from - buildInputs 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 XDG_DATA_DIRS. The package for the default, icon-less hicolor-icon-theme contains a setup hook that will pick up icon themes from buildInputs 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. @@ -76,12 +40,7 @@ GTK Themes - Previously, a GTK theme needed to be in XDG_DATA_DIRS. This - is no longer necessary for most programs since GTK incorporated Adwaita - theme. Some programs (for example, those designed for - elementary - HIG) might require a special theme like - pantheon.elementary-gtk-theme. + Previously, a GTK theme needed to be in XDG_DATA_DIRS. This is no longer necessary for most programs since GTK incorporated Adwaita theme. Some programs (for example, those designed for elementary HIG) might require a special theme like pantheon.elementary-gtk-theme. @@ -89,10 +48,7 @@ GObject introspection typelibs - GObject - introspection allows applications to use C libraries in other - languages easily. It does this through typelib files - searched in GI_TYPELIB_PATH. + GObject introspection allows applications to use C libraries in other languages easily. It does this through typelib files searched in GI_TYPELIB_PATH. @@ -100,11 +56,7 @@ Various plug-ins - If your application uses - GStreamer or - Grilo, you - should set GST_PLUGIN_SYSTEM_PATH_1_0 and - GRL_PLUGIN_PATH, respectively. + If your application uses GStreamer or Grilo, you should set GST_PLUGIN_SYSTEM_PATH_1_0 and GRL_PLUGIN_PATH, respectively. @@ -113,8 +65,7 @@ Onto <package>wrapGAppsHook</package> - Given the requirements above, the package expression would become messy - quickly: + Given the requirements above, the package expression would become messy quickly: preFixup = '' for f in $(find $out/bin/ $out/libexec/ -type f -executable); do @@ -128,76 +79,48 @@ preFixup = '' done ''; - Fortunately, there is wrapGAppsHook, that does the - wrapping for us. In particular, it works in conjunction with other setup - hooks that will populate the variable: + Fortunately, there is wrapGAppsHook, that does the wrapping for us. In particular, it works in conjunction with other setup hooks that will populate the variable: - wrapGAppsHook itself will add the package’s - share directory to XDG_DATA_DIRS. + wrapGAppsHook itself will add the package’s share directory to XDG_DATA_DIRS. - glib setup hook will populate - GSETTINGS_SCHEMAS_PATH and then - wrapGAppsHook will prepend it to - XDG_DATA_DIRS. + glib setup hook will populate GSETTINGS_SCHEMAS_PATH and then wrapGAppsHook will prepend it to XDG_DATA_DIRS. - gnome3.dconf.lib is a dependency of - wrapGAppsHook, which then also adds it to the - GIO_EXTRA_MODULES variable. + gnome3.dconf.lib is a dependency of wrapGAppsHook, which then also adds it to the GIO_EXTRA_MODULES variable. - hicolor-icon-theme’s setup hook will add icon themes - to XDG_ICON_DIRS which is prepended to - XDG_DATA_DIRS by wrapGAppsHook. + hicolor-icon-theme’s setup hook will add icon themes to XDG_ICON_DIRS which is prepended to XDG_DATA_DIRS by wrapGAppsHook. - gobject-introspection setup hook populates - GI_TYPELIB_PATH variable with - lib/girepository-1.0 directories of dependencies, - which is then added to wrapper by wrapGAppsHook. It - also adds share directories of dependencies to - XDG_DATA_DIRS, which is intended to promote GIR files but - it also - pollutes - the closures of packages using wrapGAppsHook. + gobject-introspection setup hook populates GI_TYPELIB_PATH variable with lib/girepository-1.0 directories of dependencies, which is then added to wrapper by wrapGAppsHook. It also adds share directories of dependencies to XDG_DATA_DIRS, which is intended to promote GIR files but it also pollutes the closures of packages using wrapGAppsHook. - The setup hook - currently - does not work in expressions with strictDeps enabled, - like Python packages. In those cases, you will need to disable it with - strictDeps = false;. + The setup hook currently does not work in expressions with strictDeps enabled, like Python packages. In those cases, you will need to disable it with strictDeps = false;. - Setup hooks of gst_all_1.gstreamer and - gnome3.grilo will populate the - GST_PLUGIN_SYSTEM_PATH_1_0 and - GRL_PLUGIN_PATH variables, respectively, which will then - be added to the wrapper by wrapGAppsHook. + Setup hooks of gst_all_1.gstreamer and gnome3.grilo will populate the GST_PLUGIN_SYSTEM_PATH_1_0 and GRL_PLUGIN_PATH variables, respectively, which will then be added to the wrapper by wrapGAppsHook. - You can also pass additional arguments to makeWrapper - using gappsWrapperArgs in preFixup - hook: + You can also pass additional arguments to makeWrapper using gappsWrapperArgs in preFixup hook: preFixup = '' gappsWrapperArgs+=( @@ -215,13 +138,7 @@ preFixup = '' Updating GNOME packages - Most GNOME package offer - updateScript, - it is therefore possible to update to latest source tarball by running - nix-shell maintainers/scripts/update.nix --argstr package - gnome3.nautilus or even en masse with nix-shell - maintainers/scripts/update.nix --argstr path gnome3. Read the - package’s NEWS file to see what changed. + Most GNOME package offer updateScript, it is therefore possible to update to latest source tarball by running nix-shell maintainers/scripts/update.nix --argstr package gnome3.nautilus or even en masse with nix-shell maintainers/scripts/update.nix --argstr path gnome3. Read the package’s NEWS file to see what changed. @@ -235,17 +152,7 @@ preFixup = '' - There are no schemas avalable in XDG_DATA_DIRS. - Temporarily add a random package containing schemas like - gsettings-desktop-schemas to - buildInputs. - glib and - wrapGAppsHook - setup hooks will take care of making the schemas available to application - and you will see the actual missing schemas with the - next - error. Or you can try looking through the source code for the - actual schemas used. + There are no schemas avalable in XDG_DATA_DIRS. Temporarily add a random package containing schemas like gsettings-desktop-schemas to buildInputs. glib and wrapGAppsHook setup hooks will take care of making the schemas available to application and you will see the actual missing schemas with the next error. Or you can try looking through the source code for the actual schemas used. @@ -255,11 +162,7 @@ preFixup = '' - Package is missing some GSettings schemas. You can find out the package - containing the schema with nix-locate - org.gnome.foo.gschema.xml and let - the hooks handle the wrapping as - above. + Package is missing some GSettings schemas. You can find out the package containing the schema with nix-locate org.gnome.foo.gschema.xml and let the hooks handle the wrapping as above. @@ -269,14 +172,7 @@ preFixup = '' - This is because derivers like - python.pkgs.buildPythonApplication or - qt5.mkDerivation have setup-hooks automatically - added that produce wrappers with makeWrapper. The - simplest way to workaround that is to disable the - wrapGAppsHook automatic wrapping with - dontWrapGApps = true; and pass the arguments it intended to - pass to makeWrapper to another. + This is because derivers like python.pkgs.buildPythonApplication or qt5.mkDerivation have setup-hooks automatically added that produce wrappers with makeWrapper. The simplest way to workaround that is to disable the wrapGAppsHook automatic wrapping with dontWrapGApps = true; and pass the arguments it intended to pass to makeWrapper to another. In the case of a Python application it could look like: @@ -328,55 +224,34 @@ mkDerivation { - You can rely on applications depending on the library set the necessary - environment variables but that it often easy to miss. Instead we - recommend to patch the paths in the source code whenever possible. Here - are some examples: + You can rely on applications depending on the library set the necessary environment variables but that it often easy to miss. Instead we recommend to patch the paths in the source code whenever possible. Here are some examples: - Replacing - a GI_TYPELIB_PATH in GNOME Shell extension – - we are using substituteAll to include the path to - a typelib into a patch. + Replacing a GI_TYPELIB_PATH in GNOME Shell extension – we are using substituteAll to include the path to a typelib into a patch. - The following examples are hardcoding GSettings schema paths. To get - the schema paths we use the functions + The following examples are hardcoding GSettings schema paths. To get the schema paths we use the functions - glib.getSchemaPath Takes a nix package - attribute as an argument. + glib.getSchemaPath Takes a nix package attribute as an argument. - glib.makeSchemaPath Takes a package output - like $out and a derivation name. You should use - this if the schemas you need to hardcode are in the same - derivation. + glib.makeSchemaPath Takes a package output like $out and a derivation name. You should use this if the schemas you need to hardcode are in the same derivation. - Hard-coding - GSettings schema path in Vala plug-in (dynamically loaded - library) – here, substituteAll cannot be - used since the schema comes from the same package preventing us from - pass its path to the function, probably due to a - Nix - bug. + Hard-coding GSettings schema path in Vala plug-in (dynamically loaded library) – here, substituteAll cannot be used since the schema comes from the same package preventing us from pass its path to the function, probably due to a Nix bug. - Hard-coding - GSettings schema path in C library – nothing special other - than using - Coccinelle - patch to generate the patch itself. + Hard-coding GSettings schema path in C library – nothing special other than using Coccinelle patch to generate the patch itself. diff --git a/doc/languages-frameworks/go.xml b/doc/languages-frameworks/go.xml index b2b4962cb5f6..288a90298631 100644 --- a/doc/languages-frameworks/go.xml +++ b/doc/languages-frameworks/go.xml @@ -7,21 +7,16 @@ Go modules - The function buildGoModule builds Go programs managed - with Go modules. It builds a - Go - modules through a two phase build: + The function buildGoModule builds Go programs managed with Go modules. It builds a Go modules through a two phase build: - An intermediate fetcher derivation. This derivation will be used to fetch - all of the dependencies of the Go module. + An intermediate fetcher derivation. This derivation will be used to fetch all of the dependencies of the Go module. - A final derivation will use the output of the intermediate derivation to - build the binaries and produce the final output. + A final derivation will use the output of the intermediate derivation to build the binaries and produce the final output. @@ -57,21 +52,16 @@ pet = buildGoModule rec {
- is an example expression using - buildGoModule, the following arguments are of special significance to the - function: + is an example expression using buildGoModule, the following arguments are of special significance to the function: - modSha256 is the hash of the output of the - intermediate fetcher derivation. + modSha256 is the hash of the output of the intermediate fetcher derivation. - subPackages limits the builder from building child - packages that have not been listed. If subPackages is - not specified, all child packages will be built. + subPackages limits the builder from building child packages that have not been listed. If subPackages is not specified, all child packages will be built. @@ -82,8 +72,7 @@ pet = buildGoModule rec { Go legacy - The function buildGoPackage builds legacy Go programs, - not supporting Go modules. + The function buildGoPackage builds legacy Go programs, not supporting Go modules. @@ -111,49 +100,36 @@ deis = buildGoPackage rec { - is an example expression using - buildGoPackage, the following arguments are of special significance to the - function: + is an example expression using buildGoPackage, the following arguments are of special significance to the function: - goPackagePath specifies the package's canonical Go - import path. + goPackagePath specifies the package's canonical Go import path. - subPackages limits the builder from building child - packages that have not been listed. If subPackages is - not specified, all child packages will be built. + subPackages limits the builder from building child packages that have not been listed. If subPackages is not specified, all child packages will be built. - In this example only github.com/deis/deis/client will - be built. + In this example only github.com/deis/deis/client will be built. - goDeps is where the Go dependencies of a Go program - are listed as a list of package source identified by Go import path. It - could be imported as a separate deps.nix file for - readability. The dependency data structure is described below. + goDeps is where the Go dependencies of a Go program are listed as a list of package source identified by Go import path. It could be imported as a separate deps.nix file for readability. The dependency data structure is described below. - buildFlags is a list of flags passed to the go build - command. + buildFlags is a list of flags passed to the go build command. - The goDeps attribute can be imported from a separate - nix file that defines which Go libraries are needed and - should be included in GOPATH for - buildPhase. + The goDeps attribute can be imported from a separate nix file that defines which Go libraries are needed and should be included in GOPATH for buildPhase. @@ -196,27 +172,18 @@ deis = buildGoPackage rec { - fetch type that needs to be used to get package - source. If git is used there should be - url, rev and - sha256 defined next to it. + fetch type that needs to be used to get package source. If git is used there should be url, rev and sha256 defined next to it. - To extract dependency information from a Go package in automated way use - go2nix. It can - produce complete derivation and goDeps file for Go - programs. + To extract dependency information from a Go package in automated way use go2nix. It can produce complete derivation and goDeps file for Go programs. - buildGoPackage produces - where - bin includes program binaries. You can test build a Go - binary as follows: + buildGoPackage produces where bin includes program binaries. You can test build a Go binary as follows: $ nix-build -A deis.bin @@ -224,13 +191,11 @@ deis = buildGoPackage rec { $ nix-build -A deis.all - bin output will be installed by default with - nix-env -i or systemPackages. + bin output will be installed by default with nix-env -i or systemPackages. - You may use Go packages installed into the active Nix profiles by adding the - following to your ~/.bashrc: + You may use Go packages installed into the active Nix profiles by adding the following to your ~/.bashrc: for p in $NIX_PROFILES; do GOPATH="$p/share/go:$GOPATH" diff --git a/doc/languages-frameworks/index.xml b/doc/languages-frameworks/index.xml index 5836294b7748..cd0b48adb14a 100644 --- a/doc/languages-frameworks/index.xml +++ b/doc/languages-frameworks/index.xml @@ -3,12 +3,7 @@ xml:id="chap-language-support"> Support for specific programming languages and frameworks - The standard build environment 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 stdenv. 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 standard build environment 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 stdenv. 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. diff --git a/doc/languages-frameworks/java.xml b/doc/languages-frameworks/java.xml index 68a1a097984d..bf0fc4883922 100644 --- a/doc/languages-frameworks/java.xml +++ b/doc/languages-frameworks/java.xml @@ -15,37 +15,24 @@ stdenv.mkDerivation { buildPhase = "ant"; }
- Note that jdk is an alias for the OpenJDK (self-built - where available, or pre-built via Zulu). Platforms with OpenJDK not (yet) in - Nixpkgs (Aarch32, Aarch64) point to the - (unfree) oraclejdk. + Note that jdk is an alias for the OpenJDK (self-built where available, or pre-built via Zulu). Platforms with OpenJDK not (yet) in Nixpkgs (Aarch32, Aarch64) point to the (unfree) oraclejdk.
- JAR files that are intended to be used by other packages should be installed - in $out/share/java. JDKs have a stdenv setup hook that - add any JARs in the share/java directories of the build - inputs to the CLASSPATH environment variable. For instance, if - the package libfoo installs a JAR named - foo.jar in its share/java - directory, and another package declares the attribute + JAR files that are intended to be used by other packages should be installed in $out/share/java. JDKs have a stdenv setup hook that add any JARs in the share/java directories of the build inputs to the CLASSPATH environment variable. For instance, if the package libfoo installs a JAR named foo.jar in its share/java directory, and another package declares the attribute buildInputs = [ libfoo ]; nativeBuildInputs = [ jdk ]; - then CLASSPATH will be set to - /nix/store/...-libfoo/share/java/foo.jar. + then CLASSPATH will be set to /nix/store/...-libfoo/share/java/foo.jar. - Private JARs should be installed in a location like - $out/share/package-name. + Private JARs should be installed in a location like $out/share/package-name. - If your Java package provides a program, you need to generate a wrapper - script to run it using the OpenJRE. You can use - makeWrapper for this: + If your Java package provides a program, you need to generate a wrapper script to run it using the OpenJRE. You can use makeWrapper for this: nativeBuildInputs = [ makeWrapper ]; @@ -56,30 +43,21 @@ installPhase = --add-flags "-cp $out/share/java/foo.jar org.foo.Main" ''; - Note the use of jre, which is the part of the OpenJDK - package that contains the Java Runtime Environment. By using - ${jre}/bin/java instead of - ${jdk}/bin/java, you prevent your package from depending - on the JDK at runtime. + Note the use of jre, which is the part of the OpenJDK package that contains the Java Runtime Environment. By using ${jre}/bin/java instead of ${jdk}/bin/java, you prevent your package from depending on the JDK at runtime. - Note all JDKs passthru home, so if your application - requires environment variables like JAVA_HOME being set, that - can be done in a generic fashion with the --set argument - of makeWrapper: + Note all JDKs passthru home, so if your application requires environment variables like JAVA_HOME being set, that can be done in a generic fashion with the --set argument of makeWrapper: --set JAVA_HOME ${jdk.home} - It is possible to use a different Java compiler than javac - from the OpenJDK. For instance, to use the GNU Java Compiler: + It is possible to use a different Java compiler than javac from the OpenJDK. For instance, to use the GNU Java Compiler: nativeBuildInputs = [ gcj ant ]; - Here, Ant will automatically use gij (the GNU Java - Runtime) instead of the OpenJRE. + Here, Ant will automatically use gij (the GNU Java Runtime) instead of the OpenJRE. diff --git a/doc/languages-frameworks/lua.xml b/doc/languages-frameworks/lua.xml index 5144bb24ff6e..bcca6b737539 100644 --- a/doc/languages-frameworks/lua.xml +++ b/doc/languages-frameworks/lua.xml @@ -4,18 +4,11 @@ Lua - Lua packages are built by the buildLuaPackage function. - This function is implemented in - - pkgs/development/lua-modules/generic/default.nix - and works similarly to buildPerlPackage. (See - for details.) + Lua packages are built by the buildLuaPackage function. This function is implemented in pkgs/development/lua-modules/generic/default.nix and works similarly to buildPerlPackage. (See for details.) - Lua packages are defined in - pkgs/top-level/lua-packages.nix. - Most of them are simple. For example: + Lua packages are defined in pkgs/top-level/lua-packages.nix. Most of them are simple. For example: fileSystem = buildLuaPackage { name = "filesystem-1.6.2"; @@ -33,16 +26,11 @@ fileSystem = buildLuaPackage { - Though, more complicated package should be placed in a seperate file in - pkgs/development/lua-modules. - Lua packages accept additional parameter disabled, which - defines the condition of disabling package from luaPackages. For example, if - package has disabled assigned to lua.luaversion - != "5.1", it will not be included in any luaPackages except - lua51Packages, making it only be built for lua 5.1. + Lua packages accept additional parameter disabled, which defines the condition of disabling package from luaPackages. For example, if package has disabled assigned to lua.luaversion != "5.1", it will not be included in any luaPackages except lua51Packages, making it only be built for lua 5.1. diff --git a/doc/languages-frameworks/ocaml.xml b/doc/languages-frameworks/ocaml.xml index b7006ecba998..a0ea209b493c 100644 --- a/doc/languages-frameworks/ocaml.xml +++ b/doc/languages-frameworks/ocaml.xml @@ -4,35 +4,15 @@ OCaml - OCaml libraries should be installed in - $(out)/lib/ocaml/${ocaml.version}/site-lib/. Such - directories are automatically added to the $OCAMLPATH - environment variable when building another package that depends on them or - when opening a nix-shell. + OCaml libraries should be installed in $(out)/lib/ocaml/${ocaml.version}/site-lib/. Such directories are automatically added to the $OCAMLPATH environment variable when building another package that depends on them or when opening a nix-shell. - Given that most of the OCaml ecosystem is now built with dune, nixpkgs - includes a convenience build support function called - buildDunePackage that will build an OCaml package using - dune, OCaml and findlib and any additional dependencies provided as - buildInputs or propagatedBuildInputs. + Given that most of the OCaml ecosystem is now built with dune, nixpkgs includes a convenience build support function called buildDunePackage that will build an OCaml package using dune, OCaml and findlib and any additional dependencies provided as buildInputs or propagatedBuildInputs. - Here is a simple package example. It defines an (optional) attribute - minimumOCamlVersion that will be used to throw a - descriptive evaluation error if building with an older OCaml is attempted. It - uses the fetchFromGitHub fetcher to get its source. It - sets the doCheck (optional) attribute to - true which means that tests will be run with dune - runtest -p angstrom after the build (dune build -p - angstrom) is complete. It uses alcotest as a - build input (because it is needed to run the tests) and - bigstringaf and result as propagated - build inputs (thus they will also be available to libraries depending on this - library). The library will be installed using the - angstrom.install file that dune generates. + Here is a simple package example. It defines an (optional) attribute minimumOCamlVersion that will be used to throw a descriptive evaluation error if building with an older OCaml is attempted. It uses the fetchFromGitHub fetcher to get its source. It sets the doCheck (optional) attribute to true which means that tests will be run with dune runtest -p angstrom after the build (dune build -p angstrom) is complete. It uses alcotest as a build input (because it is needed to run the tests) and bigstringaf and result as propagated build inputs (thus they will also be available to libraries depending on this library). The library will be installed using the angstrom.install file that dune generates. @@ -65,11 +45,7 @@ buildDunePackage rec { - Here is a second example, this time using a source archive generated with - dune-release. It is a good idea to use this archive when - it is available as it will usually contain substituted variables such as a - %%VERSION%% field. This library does not depend on any - other OCaml library and no tests are run after building it. + Here is a second example, this time using a source archive generated with dune-release. It is a good idea to use this archive when it is available as it will usually contain substituted variables such as a %%VERSION%% field. This library does not depend on any other OCaml library and no tests are run after building it. diff --git a/doc/languages-frameworks/perl.xml b/doc/languages-frameworks/perl.xml index d5911cf67fd7..d9b6b2721c67 100644 --- a/doc/languages-frameworks/perl.xml +++ b/doc/languages-frameworks/perl.xml @@ -4,24 +4,13 @@ Perl - Nixpkgs provides a function buildPerlPackage, a generic - package builder function for any Perl package that has a standard - Makefile.PL. It’s implemented in - buildPerlPackage, a generic package builder function for any Perl package that has a standard Makefile.PL. It’s implemented in pkgs/development/perl-modules/generic. - Perl packages from CPAN are defined in - pkgs/top-level/perl-packages.nix, - rather than pkgs/all-packages.nix. Most Perl packages - are so straight-forward to build that they are defined here directly, rather - than having a separate function for each package called from - perl-packages.nix. However, more complicated packages - should be put in a separate file, typically in - pkgs/development/perl-modules. Here is an example of the - former: + Perl packages from CPAN are defined in pkgs/top-level/perl-packages.nix, rather than pkgs/all-packages.nix. Most Perl packages are so straight-forward to build that they are defined here directly, rather than having a separate function for each package called from perl-packages.nix. However, more complicated packages should be put in a separate file, typically in pkgs/development/perl-modules. Here is an example of the former: ClassC3 = buildPerlPackage rec { name = "Class-C3-0.21"; @@ -31,32 +20,22 @@ ClassC3 = buildPerlPackage rec { }; }; - Note the use of mirror://cpan/, and the - ${name} in the URL definition to ensure that the name - attribute is consistent with the source that we’re actually downloading. - Perl packages are made available in all-packages.nix - through the variable perlPackages. For instance, if you - have a package that needs ClassC3, you would typically - write + Note the use of mirror://cpan/, and the ${name} in the URL definition to ensure that the name attribute is consistent with the source that we’re actually downloading. Perl packages are made available in all-packages.nix through the variable perlPackages. For instance, if you have a package that needs ClassC3, you would typically write foo = import ../path/to/foo.nix { inherit stdenv fetchurl ...; inherit (perlPackages) ClassC3; }; - in all-packages.nix. You can test building a Perl - package as follows: + in all-packages.nix. You can test building a Perl package as follows: $ nix-build -A perlPackages.ClassC3 - buildPerlPackage adds perl- to the - start of the name attribute, so the package above is actually called - perl-Class-C3-0.21. So to install it, you can say: + buildPerlPackage adds perl- to the start of the name attribute, so the package above is actually called perl-Class-C3-0.21. So to install it, you can say: $ nix-env -i perl-Class-C3 - (Of course you can also install using the attribute name: nix-env -i - -A perlPackages.ClassC3.) + (Of course you can also install using the attribute name: nix-env -i -A perlPackages.ClassC3.) @@ -64,40 +43,24 @@ foo = import ../path/to/foo.nix { - In the configure phase, it calls perl Makefile.PL to - generate a Makefile. You can set the variable - makeMakerFlags to pass flags to - Makefile.PL + In the configure phase, it calls perl Makefile.PL to generate a Makefile. You can set the variable makeMakerFlags to pass flags to Makefile.PL - It adds the contents of the PERL5LIB environment variable - to #! .../bin/perl line of Perl scripts as - -Idir flags. This ensures - that a script can find its dependencies. (This can cause this shebang line - to become too long for Darwin to handle; see the note below.) + It adds the contents of the PERL5LIB environment variable to #! .../bin/perl line of Perl scripts as -Idir flags. This ensures that a script can find its dependencies. (This can cause this shebang line to become too long for Darwin to handle; see the note below.) - In the fixup phase, it writes the propagated build inputs - (propagatedBuildInputs) to the file - $out/nix-support/propagated-user-env-packages. - nix-env recursively installs all packages listed in - this file when you install a package that has it. This ensures that a Perl - package can find its dependencies. + In the fixup phase, it writes the propagated build inputs (propagatedBuildInputs) to the file $out/nix-support/propagated-user-env-packages. nix-env recursively installs all packages listed in this file when you install a package that has it. This ensures that a Perl package can find its dependencies. - buildPerlPackage is built on top of - stdenv, so everything can be customised in the usual way. - For instance, the BerkeleyDB module has a - preConfigure hook to generate a configuration file used by - Makefile.PL: + buildPerlPackage is built on top of stdenv, so everything can be customised in the usual way. For instance, the BerkeleyDB module has a preConfigure hook to generate a configuration file used by Makefile.PL: { buildPerlPackage, fetchurl, db }: @@ -118,12 +81,7 @@ buildPerlPackage rec { - Dependencies on other Perl packages can be specified in the - buildInputs and propagatedBuildInputs - attributes. If something is exclusively a build-time dependency, use - buildInputs; if it’s (also) a runtime dependency, use - propagatedBuildInputs. For instance, this builds a Perl - module that has runtime dependencies on a bunch of other modules: + Dependencies on other Perl packages can be specified in the buildInputs and propagatedBuildInputs attributes. If something is exclusively a build-time dependency, use buildInputs; if it’s (also) a runtime dependency, use propagatedBuildInputs. For instance, this builds a Perl module that has runtime dependencies on a bunch of other modules: ClassC3Componentised = buildPerlPackage rec { name = "Class-C3-Componentised-1.0004"; @@ -139,11 +97,7 @@ ClassC3Componentised = buildPerlPackage rec { - On Darwin, if a script has too many - -Idir flags in its first line - (its “shebang line”), it will not run. This can be worked around by - calling the shortenPerlShebang function from the - postInstall phase: + On Darwin, if a script has too many -Idir flags in its first line (its “shebang line”), it will not run. This can be worked around by calling the shortenPerlShebang function from the postInstall phase: { stdenv, buildPerlPackage, fetchurl, shortenPerlShebang }: @@ -162,20 +116,14 @@ ImageExifTool = buildPerlPackage { ''; }; - This will remove the -I flags from the shebang line, - rewrite them in the use lib form, and put them on the next - line instead. This function can be given any number of Perl scripts as - arguments; it will modify them in-place. + This will remove the -I flags from the shebang line, rewrite them in the use lib form, and put them on the next line instead. This function can be given any number of Perl scripts as arguments; it will modify them in-place.
Generation from CPAN - Nix expressions for Perl packages can be generated (almost) automatically - from CPAN. This is done by the program - nix-generate-from-cpan, which can be installed as - follows: + Nix expressions for Perl packages can be generated (almost) automatically from CPAN. This is done by the program nix-generate-from-cpan, which can be installed as follows: @@ -183,9 +131,7 @@ ImageExifTool = buildPerlPackage { - This program takes a Perl module name, looks it up on CPAN, fetches and - unpacks the corresponding package, and prints a Nix expression on standard - output. For example: + This program takes a Perl module name, looks it up on CPAN, fetches and unpacks the corresponding package, and prints a Nix expression on standard output. For example: $ nix-generate-from-cpan XML::Simple XMLSimple = buildPerlPackage rec { @@ -201,9 +147,7 @@ ImageExifTool = buildPerlPackage { }; }; - The output can be pasted into - pkgs/top-level/perl-packages.nix or wherever else you - need it. + The output can be pasted into pkgs/top-level/perl-packages.nix or wherever else you need it.
@@ -211,13 +155,7 @@ ImageExifTool = buildPerlPackage { Cross-compiling modules - Nixpkgs has experimental support for cross-compiling Perl modules. In many - cases, it will just work out of the box, even for modules with native - extensions. Sometimes, however, the Makefile.PL for a module may - (indirectly) import a native module. In that case, you will need to make a - stub for that module that will satisfy the Makefile.PL and install it into - lib/perl5/site_perl/cross_perl/${perl.version}. See the - postInstall for DBI for an example. + Nixpkgs has experimental support for cross-compiling Perl modules. In many cases, it will just work out of the box, even for modules with native extensions. Sometimes, however, the Makefile.PL for a module may (indirectly) import a native module. In that case, you will need to make a stub for that module that will satisfy the Makefile.PL and install it into lib/perl5/site_perl/cross_perl/${perl.version}. See the postInstall for DBI for an example. diff --git a/doc/languages-frameworks/qt.xml b/doc/languages-frameworks/qt.xml index d6f3314ab08d..8d97de504ad3 100644 --- a/doc/languages-frameworks/qt.xml +++ b/doc/languages-frameworks/qt.xml @@ -4,11 +4,7 @@ Qt - This section describes the differences between Nix expressions for Qt - libraries and applications and Nix expressions for other C++ software. Some - knowledge of the latter is assumed. There are primarily two problems which - the Qt infrastructure is designed to address: ensuring consistent versioning - of all dependencies and finding dependencies at runtime. + This section describes the differences between Nix expressions for Qt libraries and applications and Nix expressions for other C++ software. Some knowledge of the latter is assumed. There are primarily two problems which the Qt infrastructure is designed to address: ensuring consistent versioning of all dependencies and finding dependencies at runtime. @@ -28,38 +24,26 @@ mkDerivation { - Import mkDerivation and Qt (such as - qtbase modules directly. Do not - import Qt package sets; the Qt versions of dependencies may not be - coherent, causing build and runtime failures. + Import mkDerivation and Qt (such as qtbase modules directly. Do not import Qt package sets; the Qt versions of dependencies may not be coherent, causing build and runtime failures. - Use mkDerivation instead of - stdenv.mkDerivation. mkDerivation is - a wrapper around stdenv.mkDerivation which applies some - Qt-specific settings. This deriver accepts the same arguments as - stdenv.mkDerivation; refer to - for details. + Use mkDerivation instead of stdenv.mkDerivation. mkDerivation is a wrapper around stdenv.mkDerivation which applies some Qt-specific settings. This deriver accepts the same arguments as stdenv.mkDerivation; refer to for details. - To use another deriver instead of stdenv.mkDerivation, - use mkDerivationWith: + To use another deriver instead of stdenv.mkDerivation, use mkDerivationWith: mkDerivationWith myDeriver { # ... } - If you cannot use mkDerivationWith, please refer to - . + If you cannot use mkDerivationWith, please refer to . - mkDerivation accepts the same arguments as - stdenv.mkDerivation, such as - buildInputs. + mkDerivation accepts the same arguments as stdenv.mkDerivation, such as buildInputs. @@ -67,10 +51,7 @@ mkDerivationWith myDeriver { Locating runtime dependencies - Qt applications need to be wrapped to find runtime dependencies. If you - cannot use mkDerivation or - mkDerivationWith above, include - wrapQtAppsHook in nativeBuildInputs: + Qt applications need to be wrapped to find runtime dependencies. If you cannot use mkDerivation or mkDerivationWith above, include wrapQtAppsHook in nativeBuildInputs: stdenv.mkDerivation { # ... @@ -82,9 +63,7 @@ stdenv.mkDerivation { - Entries added to qtWrapperArgs are used to modify the - wrappers created by wrapQtAppsHook. The entries are passed - as arguments to . + Entries added to qtWrapperArgs are used to modify the wrappers created by wrapQtAppsHook. The entries are passed as arguments to . mkDerivation { # ... @@ -95,10 +74,7 @@ mkDerivation { - Set dontWrapQtApps to stop applications from being wrapped - automatically. It is required to wrap applications manually with - wrapQtApp, using the syntax of - : + Set dontWrapQtApps to stop applications from being wrapped automatically. It is required to wrap applications manually with wrapQtApp, using the syntax of : mkDerivation { # ... @@ -113,17 +89,12 @@ mkDerivation { - wrapQtAppsHook ignores files that are non-ELF - executables. This means that scripts won't be automatically wrapped so - you'll need to manually wrap them as previously mentioned. An example of - when you'd always need to do this is with Python applications that use PyQT. + wrapQtAppsHook ignores files that are non-ELF executables. This means that scripts won't be automatically wrapped so you'll need to manually wrap them as previously mentioned. An example of when you'd always need to do this is with Python applications that use PyQT. - Libraries are built with every available version of Qt. Use the - meta.broken attribute to disable the package for - unsupported Qt versions: + Libraries are built with every available version of Qt. Use the meta.broken attribute to disable the package for unsupported Qt versions: mkDerivation { # ... @@ -137,9 +108,7 @@ mkDerivation { Adding a library to Nixpkgs - Add a Qt library to all-packages.nix by adding it to - the collection inside mkLibsForQt5. This ensures that the - library is built with every available version of Qt as needed. + Add a Qt library to all-packages.nix by adding it to the collection inside mkLibsForQt5. This ensures that the library is built with every available version of Qt as needed. Adding a Qt library to <filename>all-packages.nix</filename> @@ -162,10 +131,7 @@ mkDerivation { Adding an application to Nixpkgs - Add a Qt application to all-packages.nix using - libsForQt5.callPackage instead of the usual - callPackage. The former ensures that all dependencies are - built with the same version of Qt. + Add a Qt application to all-packages.nix using libsForQt5.callPackage instead of the usual callPackage. The former ensures that all dependencies are built with the same version of Qt. Adding a Qt application to <filename>all-packages.nix</filename> diff --git a/doc/languages-frameworks/ruby.xml b/doc/languages-frameworks/ruby.xml index df4e5acb22cb..b28745fd6e27 100644 --- a/doc/languages-frameworks/ruby.xml +++ b/doc/languages-frameworks/ruby.xml @@ -4,11 +4,7 @@ Ruby - There currently is support to bundle applications that are packaged as Ruby - gems. The utility "bundix" allows you to write a - Gemfile, let bundler create a - Gemfile.lock, and then convert this into a nix - expression that contains all Gem dependencies automatically. + There currently is support to bundle applications that are packaged as Ruby gems. The utility "bundix" allows you to write a Gemfile, let bundler create a Gemfile.lock, and then convert this into a nix expression that contains all Gem dependencies automatically. @@ -45,9 +41,7 @@ bundlerEnv rec {
- Please check in the Gemfile, - Gemfile.lock and the gemset.nix so - future updates can be run easily. + Please check in the Gemfile, Gemfile.lock and the gemset.nix so future updates can be run easily. @@ -62,10 +56,7 @@ $ nix-shell -p bundix --run 'bundix'
- For tools written in Ruby - i.e. where the desire is to install a package and - then execute e.g. rake at the command line, there is an - alternative builder called bundlerApp. Set up the - gemset.nix the same way, and then, for example: + For tools written in Ruby - i.e. where the desire is to install a package and then execute e.g. rake at the command line, there is an alternative builder called bundlerApp. Set up the gemset.nix the same way, and then, for example: @@ -87,29 +78,11 @@ bundlerApp { - The chief advantage of bundlerApp over - bundlerEnv is the executables introduced in the - environment are precisely those selected in the exes list, - as opposed to bundlerEnv which adds all the executables - made available by gems in the gemset, which can mean e.g. - rspec or rake in unpredictable versions - available from various packages. + The chief advantage of bundlerApp over bundlerEnv is the executables introduced in the environment are precisely those selected in the exes list, as opposed to bundlerEnv which adds all the executables made available by gems in the gemset, which can mean e.g. rspec or rake in unpredictable versions available from various packages. - Resulting derivations for both builders also have two helpful attributes, - env and wrappedRuby. The first one - allows one to quickly drop into nix-shell with the - specified environment present. E.g. nix-shell -A sensu.env - would give you an environment with Ruby preset so it has all the libraries - necessary for sensu in its paths. The second one can be - used to make derivations from custom Ruby scripts which have - Gemfiles with their dependencies specified. It is a - derivation with ruby wrapped so it can find all the needed - dependencies. For example, to make a derivation my-script - for a my-script.rb (which should be placed in - bin) you should run bundix as - specified above and then use bundlerEnv like this: + Resulting derivations for both builders also have two helpful attributes, env and wrappedRuby. The first one allows one to quickly drop into nix-shell with the specified environment present. E.g. nix-shell -A sensu.env would give you an environment with Ruby preset so it has all the libraries necessary for sensu in its paths. The second one can be used to make derivations from custom Ruby scripts which have Gemfiles with their dependencies specified. It is a derivation with ruby wrapped so it can find all the needed dependencies. For example, to make a derivation my-script for a my-script.rb (which should be placed in bin) you should run bundix as specified above and then use bundlerEnv like this: diff --git a/doc/languages-frameworks/texlive.xml b/doc/languages-frameworks/texlive.xml index 97f274933bef..7876cc213b66 100644 --- a/doc/languages-frameworks/texlive.xml +++ b/doc/languages-frameworks/texlive.xml @@ -4,8 +4,7 @@ TeX Live - Since release 15.09 there is a new TeX Live packaging that lives entirely - under attribute texlive. + Since release 15.09 there is a new TeX Live packaging that lives entirely under attribute texlive.
@@ -14,28 +13,23 @@ - For basic usage just pull texlive.combined.scheme-basic - for an environment with basic LaTeX support. + For basic usage just pull texlive.combined.scheme-basic for an environment with basic LaTeX support. - It typically won't work to use separately installed packages together. - Instead, you can build a custom set of packages like this: + It typically won't work to use separately installed packages together. Instead, you can build a custom set of packages like this: texlive.combine { inherit (texlive) scheme-small collection-langkorean algorithms cm-super; } - There are all the schemes, collections and a few thousand packages, as - defined upstream (perhaps with tiny differences). + There are all the schemes, collections and a few thousand packages, as defined upstream (perhaps with tiny differences). - By default you only get executables and files needed during runtime, and a - little documentation for the core packages. To change that, you need to - add pkgFilter function to combine. + By default you only get executables and files needed during runtime, and a little documentation for the core packages. To change that, you need to add pkgFilter function to combine. texlive.combine { # inherit (texlive) whatever-you-want; @@ -59,10 +53,7 @@ nix-repl> texlive.collection- - Note that the wrapper assumes that the result has a chance to be useful. - For example, the core executables should be present, as well as some core - data files. The supported way of ensuring this is by including some - scheme, for example scheme-basic, into the combination. + Note that the wrapper assumes that the result has a chance to be useful. For example, the core executables should be present, as well as some core data files. The supported way of ensuring this is by including some scheme, for example scheme-basic, into the combination. @@ -84,14 +75,12 @@ nix-repl> texlive.collection- - feature/bug: when a package is rejected by pkgFilter, - its dependencies are still propagated; + feature/bug: when a package is rejected by pkgFilter, its dependencies are still propagated; - in case of any bugs or feature requests, file a github issue or better a - pull request and /cc @vcunat. + in case of any bugs or feature requests, file a github issue or better a pull request and /cc @vcunat. diff --git a/doc/meta.xml b/doc/meta.xml index 49db73ab79e6..9371196818ad 100644 --- a/doc/meta.xml +++ b/doc/meta.xml @@ -3,10 +3,7 @@ xml:id="chap-meta"> Meta-attributes - Nix packages can declare meta-attributes that contain - information about a package such as a description, its homepage, its license, - and so on. For instance, the GNU Hello package has a meta - declaration like this: + Nix packages can declare meta-attributes that contain information about a package such as a description, its homepage, its license, and so on. For instance, the GNU Hello package has a meta declaration like this: meta = with stdenv.lib; { description = "A program that produces a familiar, friendly greeting"; @@ -22,13 +19,10 @@ meta = with stdenv.lib; { - Meta-attributes are not passed to the builder of the package. Thus, a change - to a meta-attribute doesn’t trigger a recompilation of the package. The - value of a meta-attribute must be a string. + Meta-attributes are not passed to the builder of the package. Thus, a change to a meta-attribute doesn’t trigger a recompilation of the package. The value of a meta-attribute must be a string. - The meta-attributes of a package can be queried from the command-line using - nix-env: + The meta-attributes of a package can be queried from the command-line using nix-env: $ nix-env -qa hello --json { @@ -67,8 +61,7 @@ meta = with stdenv.lib; { - nix-env knows about the description - field specifically: + nix-env knows about the description field specifically: $ nix-env -qa hello --description hello-2.3 A program that produces a familiar, friendly greeting @@ -88,18 +81,13 @@ hello-2.3 A program that produces a familiar, friendly greeting - A short (one-line) description of the package. This is shown by - nix-env -q --description and also on the Nixpkgs - release pages. + A short (one-line) description of the package. This is shown by nix-env -q --description and also on the Nixpkgs release pages. - Don’t include a period at the end. Don’t include newline characters. - Capitalise the first character. For brevity, don’t repeat the name of - package — just describe what it does. + Don’t include a period at the end. Don’t include newline characters. Capitalise the first character. For brevity, don’t repeat the name of package — just describe what it does. - Wrong: "libpng is a library that allows you to decode PNG - images." + Wrong: "libpng is a library that allows you to decode PNG images." Right: "A library for decoding PNG images" @@ -122,9 +110,7 @@ hello-2.3 A program that produces a familiar, friendly greeting - Release branch. Used to specify that a package is not going to receive - updates that are not in this branch; for example, Linux kernel 3.0 is - supposed to be updated to 3.0.X, not 3.1. + Release branch. Used to specify that a package is not going to receive updates that are not in this branch; for example, Linux kernel 3.0 is supposed to be updated to 3.0.X, not 3.1. @@ -134,8 +120,7 @@ hello-2.3 A program that produces a familiar, friendly greeting - The package’s homepage. Example: - https://www.gnu.org/software/hello/manual/ + The package’s homepage. Example: https://www.gnu.org/software/hello/manual/ @@ -145,8 +130,7 @@ hello-2.3 A program that produces a familiar, friendly greeting - The page where a link to the current version can be found. Example: - https://ftp.gnu.org/gnu/hello/ + The page where a link to the current version can be found. Example: https://ftp.gnu.org/gnu/hello/ @@ -156,10 +140,7 @@ hello-2.3 A program that produces a familiar, friendly greeting - A link or a list of links to the location of Changelog for a package. A - link may use expansion to refer to the correct changelog version. - Example: - "https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}" + A link or a list of links to the location of Changelog for a package. A link may use expansion to refer to the correct changelog version. Example: "https://git.savannah.gnu.org/cgit/hello.git/plain/NEWS?h=v${version}" @@ -169,46 +150,32 @@ hello-2.3 A program that produces a familiar, friendly greeting - The license, or licenses, for the package. One from the attribute set - defined in - - nixpkgs/lib/licenses.nix. At this moment - using both a list of licenses and a single license is valid. If the - license field is in the form of a list representation, then it means that - parts of the package are licensed differently. Each license should - preferably be referenced by their attribute. The non-list attribute value - can also be a space delimited string representation of the contained - attribute shortNames or spdxIds. The following are all valid examples: + The license, or licenses, for the package. One from the attribute set defined in nixpkgs/lib/licenses.nix. At this moment using both a list of licenses and a single license is valid. If the license field is in the form of a list representation, then it means that parts of the package are licensed differently. Each license should preferably be referenced by their attribute. The non-list attribute value can also be a space delimited string representation of the contained attribute shortNames or spdxIds. The following are all valid examples: - Single license referenced by attribute (preferred) - stdenv.lib.licenses.gpl3. + Single license referenced by attribute (preferred) stdenv.lib.licenses.gpl3. - Single license referenced by its attribute shortName (frowned upon) - "gpl3". + Single license referenced by its attribute shortName (frowned upon) "gpl3". - Single license referenced by its attribute spdxId (frowned upon) - "GPL-3.0". + Single license referenced by its attribute spdxId (frowned upon) "GPL-3.0". - Multiple licenses referenced by attribute (preferred) with - stdenv.lib.licenses; [ asl20 free ofl ]. + Multiple licenses referenced by attribute (preferred) with stdenv.lib.licenses; [ asl20 free ofl ]. - Multiple licenses referenced as a space delimited string of attribute - shortNames (frowned upon) "asl20 free ofl". + Multiple licenses referenced as a space delimited string of attribute shortNames (frowned upon) "asl20 free ofl". @@ -222,13 +189,8 @@ hello-2.3 A program that produces a familiar, friendly greeting - A list of names and e-mail addresses of the maintainers of this Nix - expression. If you would like to be a maintainer of a package, you may - want to add yourself to - nixpkgs/maintainers/maintainer-list.nix - and write something like [ stdenv.lib.maintainers.alice - stdenv.lib.maintainers.bob ]. + A list of names and e-mail addresses of the maintainers of this Nix expression. If you would like to be a maintainer of a package, you may want to add yourself to nixpkgs/maintainers/maintainer-list.nix and write something like [ stdenv.lib.maintainers.alice stdenv.lib.maintainers.bob ]. @@ -238,10 +200,7 @@ hello-2.3 A program that produces a familiar, friendly greeting - The priority of the package, used by - nix-env to resolve file name conflicts between - packages. See the Nix manual page for nix-env for - details. Example: "10" (a low-priority package). + The priority of the package, used by nix-env to resolve file name conflicts between packages. See the Nix manual page for nix-env for details. Example: "10" (a low-priority package). @@ -251,15 +210,11 @@ hello-2.3 A program that produces a familiar, friendly greeting - The list of Nix platform types on which the package is supported. Hydra - builds packages according to the platform specified. If no platform is - specified, the package does not have prebuilt binaries. An example is: + The list of Nix platform types on which the package is supported. Hydra builds packages according to the platform specified. If no platform is specified, the package does not have prebuilt binaries. An example is: meta.platforms = stdenv.lib.platforms.linux; - Attribute Set stdenv.lib.platforms defines - - various common lists of platforms types. + Attribute Set stdenv.lib.platforms defines various common lists of platforms types. @@ -270,23 +225,14 @@ meta.platforms = stdenv.lib.platforms.linux; - This attribute is special in that it is not actually under the - meta attribute set but rather under the - passthru attribute set. This is due to how - meta attributes work, and the fact that they are - supposed to contain only metadata, not derivations. + This attribute is special in that it is not actually under the meta attribute set but rather under the passthru attribute set. This is due to how meta attributes work, and the fact that they are supposed to contain only metadata, not derivations. - An attribute set with as values tests. A test is a derivation, which - builds successfully when the test passes, and fails to build otherwise. A - derivation that is a test needs to have meta.timeout - defined. + An attribute set with as values tests. A test is a derivation, which builds successfully when the test passes, and fails to build otherwise. A derivation that is a test needs to have meta.timeout defined. - The NixOS tests are available as nixosTests in - parameters of derivations. For instance, the OpenSMTPD derivation - includes lines similar to: + The NixOS tests are available as nixosTests in parameters of derivations. For instance, the OpenSMTPD derivation includes lines similar to: { /* ... */, nixosTests }: { @@ -305,13 +251,7 @@ meta.platforms = stdenv.lib.platforms.linux; - A timeout (in seconds) for building the derivation. If the derivation - takes longer than this time to build, it can fail due to breaking the - timeout. However, all computers do not have the same computing power, - hence some builders may decide to apply a multiplicative factor to this - value. When filling this value in, try to keep it approximately - consistent with other values already present in - nixpkgs. + A timeout (in seconds) for building the derivation. If the derivation takes longer than this time to build, it can fail due to breaking the timeout. However, all computers do not have the same computing power, hence some builders may decide to apply a multiplicative factor to this value. When filling this value in, try to keep it approximately consistent with other values already present in nixpkgs. @@ -321,13 +261,7 @@ meta.platforms = stdenv.lib.platforms.linux; - The list of Nix platform types for which the Hydra instance at - hydra.nixos.org will build the package. (Hydra is the - Nix-based continuous build system.) It defaults to the value of - meta.platforms. Thus, the only reason to set - meta.hydraPlatforms is if you want - hydra.nixos.org to build the package on a subset of - meta.platforms, or not at all, e.g. + The list of Nix platform types for which the Hydra instance at hydra.nixos.org will build the package. (Hydra is the Nix-based continuous build system.) It defaults to the value of meta.platforms. Thus, the only reason to set meta.hydraPlatforms is if you want hydra.nixos.org to build the package on a subset of meta.platforms, or not at all, e.g. meta.platforms = stdenv.lib.platforms.linux; meta.hydraPlatforms = []; @@ -341,10 +275,7 @@ meta.hydraPlatforms = []; - If set to true, the package is marked as “broken”, - meaning that it won’t show up in nix-env -qa, and - cannot be built or installed. Such packages should be removed from - Nixpkgs eventually unless they are fixed. + If set to true, the package is marked as “broken”, meaning that it won’t show up in nix-env -qa, and cannot be built or installed. Such packages should be removed from Nixpkgs eventually unless they are fixed. @@ -354,12 +285,7 @@ meta.hydraPlatforms = []; - If set to true, the package is tested to be updated - correctly by the update-walker.sh script without - additional settings. Such packages have meta.version - set and their homepage (or the page specified by - meta.downloadPage) contains a direct link to the - package tarball. + If set to true, the package is tested to be updated correctly by the update-walker.sh script without additional settings. Such packages have meta.version set and their homepage (or the page specified by meta.downloadPage) contains a direct link to the package tarball. @@ -369,17 +295,11 @@ meta.hydraPlatforms = []; Licenses - The meta.license attribute should preferrably contain a - value from stdenv.lib.licenses defined in - - nixpkgs/lib/licenses.nix, or in-place license - description of the same format if the license is unlikely to be useful in - another expression. + The meta.license attribute should preferrably contain a value from stdenv.lib.licenses defined in nixpkgs/lib/licenses.nix, or in-place license description of the same format if the license is unlikely to be useful in another expression. - Although it's typically better to indicate the specific license, a few - generic options are available: + Although it's typically better to indicate the specific license, a few generic options are available: @@ -397,18 +317,10 @@ meta.hydraPlatforms = []; - Unfree package that can be redistributed in binary form. That is, it’s - legal to redistribute the output of the derivation. - This means that the package can be included in the Nixpkgs channel. + Unfree package that can be redistributed in binary form. That is, it’s legal to redistribute the output of the derivation. This means that the package can be included in the Nixpkgs channel. - Sometimes proprietary software can only be redistributed unmodified. - Make sure the builder doesn’t actually modify the original binaries; - otherwise we’re breaking the license. For instance, the NVIDIA X11 - drivers can be redistributed unmodified, but our builder applies - patchelf to make them work. Thus, its license is - "unfree" and it cannot be included in the Nixpkgs - channel. + Sometimes proprietary software can only be redistributed unmodified. Make sure the builder doesn’t actually modify the original binaries; otherwise we’re breaking the license. For instance, the NVIDIA X11 drivers can be redistributed unmodified, but our builder applies patchelf to make them work. Thus, its license is "unfree" and it cannot be included in the Nixpkgs channel. @@ -418,9 +330,7 @@ meta.hydraPlatforms = []; - Unfree package that cannot be redistributed. You can build it yourself, - but you cannot redistribute the output of the derivation. Thus it cannot - be included in the Nixpkgs channel. + Unfree package that cannot be redistributed. You can build it yourself, but you cannot redistribute the output of the derivation. Thus it cannot be included in the Nixpkgs channel. @@ -430,9 +340,7 @@ meta.hydraPlatforms = []; - This package supplies unfree, redistributable firmware. This is a - separate value from unfree-redistributable because - not everybody cares whether firmware is free. + This package supplies unfree, redistributable firmware. This is a separate value from unfree-redistributable because not everybody cares whether firmware is free. diff --git a/doc/multiple-output.xml b/doc/multiple-output.xml index d0247e081f99..83275bb2fbd1 100644 --- a/doc/multiple-output.xml +++ b/doc/multiple-output.xml @@ -10,31 +10,16 @@ Introduction - The Nix language allows a derivation to produce multiple outputs, which is - similar to what is utilized by other Linux distribution packaging systems. - The outputs reside in separate Nix store paths, so they can be mostly - handled independently of each other, including passing to build inputs, - garbage collection or binary substitution. The exception is that building - from source always produces all the outputs. + The Nix language allows a derivation to produce multiple outputs, which is similar to what is utilized by other Linux distribution packaging systems. The outputs reside in separate Nix store paths, so they can be mostly handled independently of each other, including passing to build inputs, garbage collection or binary substitution. The exception is that building from source always produces all the outputs. - The main motivation is to save disk space by reducing runtime closure sizes; - consequently also sizes of substituted binaries get reduced. Splitting can - be used to have more granular runtime dependencies, for example the typical - reduction is to split away development-only files, as those are typically - not needed during runtime. As a result, closure sizes of many packages can - get reduced to a half or even much less. + The main motivation is to save disk space by reducing runtime closure sizes; consequently also sizes of substituted binaries get reduced. Splitting can be used to have more granular runtime dependencies, for example the typical reduction is to split away development-only files, as those are typically not needed during runtime. As a result, closure sizes of many packages can get reduced to a half or even much less. - The reduction effects could be instead achieved by building the parts in - completely separate derivations. That would often additionally reduce - build-time closures, but it tends to be much harder to write such - derivations, as build systems typically assume all parts are being built at - once. This compromise approach of single source package producing multiple - binary packages is also utilized often by rpm and deb. + The reduction effects could be instead achieved by building the parts in completely separate derivations. That would often additionally reduce build-time closures, but it tends to be much harder to write such derivations, as build systems typically assume all parts are being built at once. This compromise approach of single source package producing multiple binary packages is also utilized often by rpm and deb.
@@ -42,23 +27,18 @@ Installing a split package - When installing a package via systemPackages or - nix-env you have several options: + When installing a package via systemPackages or nix-env you have several options: - You can install particular outputs explicitly, as each is available in the - Nix language as an attribute of the package. The - outputs attribute contains a list of output names. + You can install particular outputs explicitly, as each is available in the Nix language as an attribute of the package. The outputs attribute contains a list of output names. - You can let it use the default outputs. These are handled by - meta.outputsToInstall attribute that contains a list of - output names. + You can let it use the default outputs. These are handled by meta.outputsToInstall attribute that contains a list of output names. TODO: more about tweaking the attribute, etc. @@ -66,19 +46,11 @@ - NixOS provides configuration option - environment.extraOutputsToInstall that allows adding - extra outputs of environment.systemPackages atop the - default ones. It's mainly meant for documentation and debug symbols, and - it's also modified by specific options. + NixOS provides configuration option environment.extraOutputsToInstall that allows adding extra outputs of environment.systemPackages atop the default ones. It's mainly meant for documentation and debug symbols, and it's also modified by specific options. - At this moment there is no similar configurability for packages installed - by nix-env. You can still use approach from - to override - meta.outputsToInstall attributes, but that's a rather - inconvenient way. + At this moment there is no similar configurability for packages installed by nix-env. You can still use approach from to override meta.outputsToInstall attributes, but that's a rather inconvenient way. @@ -88,25 +60,15 @@ Using a split package - In the Nix language the individual outputs can be reached explicitly as - attributes, e.g. coreutils.info, but the typical case is - just using packages as build inputs. + In the Nix language the individual outputs can be reached explicitly as attributes, e.g. coreutils.info, but the typical case is just using packages as build inputs. - When a multiple-output derivation gets into a build input of another - derivation, the dev output is added if it exists, - otherwise the first output is added. In addition to that, - propagatedBuildOutputs of that package which by default - contain $outputBin and $outputLib are - also added. (See .) + When a multiple-output derivation gets into a build input of another derivation, the dev output is added if it exists, otherwise the first output is added. In addition to that, propagatedBuildOutputs of that package which by default contain $outputBin and $outputLib are also added. (See .) - In some cases it may be desirable to combine different outputs under a - single store path. A function symlinkJoin can be used to - do this. (Note that it may negate some closure size benefits of using a - multiple-output package.) + In some cases it may be desirable to combine different outputs under a single store path. A function symlinkJoin can be used to do this. (Note that it may negate some closure size benefits of using a multiple-output package.)
@@ -117,29 +79,18 @@ - In nixpkgs there is a framework supporting multiple-output derivations. It - tries to cover most cases by default behavior. You can find the source - separated in - <nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh>; - it's relatively well-readable. The whole machinery is triggered by defining - the outputs attribute to contain the list of desired - output names (strings). + In nixpkgs there is a framework supporting multiple-output derivations. It tries to cover most cases by default behavior. You can find the source separated in <nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh>; it's relatively well-readable. The whole machinery is triggered by defining the outputs attribute to contain the list of desired output names (strings). outputs = [ "bin" "dev" "out" "doc" ]; - Often such a single line is enough. For each output an equally named - environment variable is passed to the builder and contains the path in nix - store for that output. Typically you also want to have the main - out output, as it catches any files that didn't get - elsewhere. + Often such a single line is enough. For each output an equally named environment variable is passed to the builder and contains the path in nix store for that output. Typically you also want to have the main out output, as it catches any files that didn't get elsewhere. - There is a special handling of the debug output, - described at . + There is a special handling of the debug output, described at . @@ -147,36 +98,15 @@ <quote>Binaries first</quote> - A commonly adopted convention in nixpkgs is that - executables provided by the package are contained within its first output. - This convention allows the dependent packages to reference the executables - provided by packages in a uniform manner. For instance, provided with the - knowledge that the perl package contains a - perl executable it can be referenced as - ${pkgs.perl}/bin/perl within a Nix derivation that needs - to execute a Perl script. + A commonly adopted convention in nixpkgs is that executables provided by the package are contained within its first output. This convention allows the dependent packages to reference the executables provided by packages in a uniform manner. For instance, provided with the knowledge that the perl package contains a perl executable it can be referenced as ${pkgs.perl}/bin/perl within a Nix derivation that needs to execute a Perl script. - The glibc package is a deliberate single exception to - the binaries first convention. The glibc - has libs as its first output allowing the libraries - provided by glibc to be referenced directly (e.g. - ${stdenv.glibc}/lib/ld-linux-x86-64.so.2). The - executables provided by glibc can be accessed via its - bin attribute (e.g. - ${stdenv.glibc.bin}/bin/ldd). + The glibc package is a deliberate single exception to the binaries first convention. The glibc has libs as its first output allowing the libraries provided by glibc to be referenced directly (e.g. ${stdenv.glibc}/lib/ld-linux-x86-64.so.2). The executables provided by glibc can be accessed via its bin attribute (e.g. ${stdenv.glibc.bin}/bin/ldd). - The reason for why glibc deviates from the convention is - because referencing a library provided by glibc is a - very common operation among Nix packages. For instance, third-party - executables packaged by Nix are typically patched and relinked with the - relevant version of glibc libraries from Nix packages - (please see the documentation on - patchelf for more - details). + The reason for why glibc deviates from the convention is because referencing a library provided by glibc is a very common operation among Nix packages. For instance, third-party executables packaged by Nix are typically patched and relinked with the relevant version of glibc libraries from Nix packages (please see the documentation on patchelf for more details).
@@ -184,13 +114,7 @@ File type groups - The support code currently recognizes some particular kinds of outputs and - either instructs the build system of the package to put files into their - desired outputs or it moves the files during the fixup phase. Each group of - file types has an outputFoo variable specifying the - output name where they should go. If that variable isn't defined by the - derivation writer, it is guessed – a default output name is defined, - falling back to other possibilities if the output isn't defined. + The support code currently recognizes some particular kinds of outputs and either instructs the build system of the package to put files into their desired outputs or it moves the files during the fixup phase. Each group of file types has an outputFoo variable specifying the output name where they should go. If that variable isn't defined by the derivation writer, it is guessed – a default output name is defined, falling back to other possibilities if the output isn't defined. @@ -200,9 +124,7 @@ - is for development-only files. These include C(++) headers, pkg-config, - cmake and aclocal files. They go to dev or - out by default. + is for development-only files. These include C(++) headers, pkg-config, cmake and aclocal files. They go to dev or out by default. @@ -212,8 +134,7 @@ - is meant for user-facing binaries, typically residing in bin/. They go - to bin or out by default. + is meant for user-facing binaries, typically residing in bin/. They go to bin or out by default. @@ -223,9 +144,7 @@ - is meant for libraries, typically residing in lib/ - and libexec/. They go to lib or - out by default. + is meant for libraries, typically residing in lib/ and libexec/. They go to lib or out by default. @@ -235,9 +154,7 @@ - is for user documentation, typically residing in - share/doc/. It goes to doc or - out by default. + is for user documentation, typically residing in share/doc/. It goes to doc or out by default. @@ -247,10 +164,7 @@ - is for developer documentation. Currently we count - gtk-doc and devhelp books in there. It goes to devdoc - or is removed (!) by default. This is because e.g. gtk-doc tends to be - rather large and completely unused by nixpkgs users. + is for developer documentation. Currently we count gtk-doc and devhelp books in there. It goes to devdoc or is removed (!) by default. This is because e.g. gtk-doc tends to be rather large and completely unused by nixpkgs users. @@ -260,8 +174,7 @@ - is for man pages (except for section 3). They go to - man or $outputBin by default. + is for man pages (except for section 3). They go to man or $outputBin by default. @@ -271,8 +184,7 @@ - is for section 3 man pages. They go to devman or - $outputMan by default. + is for section 3 man pages. They go to devman or $outputMan by default. @@ -282,8 +194,7 @@ - is for info pages. They go to info or - $outputBin by default. + is for info pages. They go to info or $outputBin by default. @@ -296,31 +207,22 @@ - Some configure scripts don't like some of the parameters passed by - default by the framework, e.g. --docdir=/foo/bar. You - can disable this by setting setOutputFlags = false;. + Some configure scripts don't like some of the parameters passed by default by the framework, e.g. --docdir=/foo/bar. You can disable this by setting setOutputFlags = false;. - The outputs of a single derivation can retain references to each other, - but note that circular references are not allowed. (And each - strongly-connected component would act as a single output anyway.) + The outputs of a single derivation can retain references to each other, but note that circular references are not allowed. (And each strongly-connected component would act as a single output anyway.) - Most of split packages contain their core functionality in libraries. - These libraries tend to refer to various kind of data that typically gets - into out, e.g. locale strings, so there is often no - advantage in separating the libraries into lib, as - keeping them in out is easier. + Most of split packages contain their core functionality in libraries. These libraries tend to refer to various kind of data that typically gets into out, e.g. locale strings, so there is often no advantage in separating the libraries into lib, as keeping them in out is easier. - Some packages have hidden assumptions on install paths, which complicates - splitting. + Some packages have hidden assumptions on install paths, which complicates splitting. diff --git a/doc/overlays.xml b/doc/overlays.xml index bff2339ca933..26a888368abf 100644 --- a/doc/overlays.xml +++ b/doc/overlays.xml @@ -3,47 +3,32 @@ xml:id="chap-overlays"> Overlays - This chapter describes how to extend and change Nixpkgs using overlays. - Overlays are used to add layers in the fixed-point used by Nixpkgs to compose - the set of all packages. + This chapter describes how to extend and change Nixpkgs using overlays. Overlays are used to add layers in the fixed-point used by Nixpkgs to compose the set of all packages. - Nixpkgs can be configured with a list of overlays, which are applied in - order. This means that the order of the overlays can be significant if - multiple layers override the same package. + Nixpkgs can be configured with a list of overlays, which are applied in order. This means that the order of the overlays can be significant if multiple layers override the same package.
Installing overlays - The list of overlays can be set either explicitly in a Nix expression, or - through <nixpkgs-overlays> or user configuration - files. + The list of overlays can be set either explicitly in a Nix expression, or through <nixpkgs-overlays> or user configuration files.
Set overlays in NixOS or Nix expressions - On a NixOS system the value of the nixpkgs.overlays - option, if present, is passed to the system Nixpkgs directly as an - argument. Note that this does not affect the overlays for non-NixOS - operations (e.g. nix-env), which are - looked up independently. + On a NixOS system the value of the nixpkgs.overlays option, if present, is passed to the system Nixpkgs directly as an argument. Note that this does not affect the overlays for non-NixOS operations (e.g. nix-env), which are looked up independently. - The list of overlays can be passed explicitly when importing nixpkgs, for - example import <nixpkgs> { overlays = [ overlay1 overlay2 ]; - }. + The list of overlays can be passed explicitly when importing nixpkgs, for example import <nixpkgs> { overlays = [ overlay1 overlay2 ]; }. - Further overlays can be added by calling the pkgs.extend - or pkgs.appendOverlays, although it is often preferable - to avoid these functions, because they recompute the Nixpkgs fixpoint, - which is somewhat expensive to do. + Further overlays can be added by calling the pkgs.extend or pkgs.appendOverlays, although it is often preferable to avoid these functions, because they recompute the Nixpkgs fixpoint, which is somewhat expensive to do.
@@ -58,30 +43,20 @@ - First, if an - overlays - argument to the Nixpkgs function itself is given, then that is - used and no path lookup will be performed. + First, if an overlays argument to the Nixpkgs function itself is given, then that is used and no path lookup will be performed. - Otherwise, if the Nix path entry - <nixpkgs-overlays> exists, we look for overlays at - that path, as described below. + Otherwise, if the Nix path entry <nixpkgs-overlays> exists, we look for overlays at that path, as described below. - See the section on NIX_PATH in the Nix manual for - more details on how to set a value for - <nixpkgs-overlays>. + See the section on NIX_PATH in the Nix manual for more details on how to set a value for <nixpkgs-overlays>. - If one of ~/.config/nixpkgs/overlays.nix and - ~/.config/nixpkgs/overlays/ exists, then we look - for overlays at that path, as described below. It is an error if both - exist. + If one of ~/.config/nixpkgs/overlays.nix and ~/.config/nixpkgs/overlays/ exists, then we look for overlays at that path, as described below. It is an error if both exist. @@ -92,15 +67,12 @@ - If the path is a file, then the file is imported as a Nix expression and - used as the list of overlays. + If the path is a file, then the file is imported as a Nix expression and used as the list of overlays. - If the path is a directory, then we take the content of the directory, - order it lexicographically, and attempt to interpret each as an overlay - by: + If the path is a directory, then we take the content of the directory, order it lexicographically, and attempt to interpret each as an overlay by: @@ -109,8 +81,7 @@ - Importing a top-level default.nix file, if it is - a directory. + Importing a top-level default.nix file, if it is a directory. @@ -120,12 +91,7 @@ - Because overlays that are set in NixOS configuration do not affect - non-NixOS operations such as nix-env, the - overlays.nix option provides a convenient way to use - the same overlays for a NixOS system configuration and user configuration: - the same file can be used as overlays.nix and imported - as the value of nixpkgs.overlays. + Because overlays that are set in NixOS configuration do not affect non-NixOS operations such as nix-env, the overlays.nix option provides a convenient way to use the same overlays for a NixOS system configuration and user configuration: the same file can be used as overlays.nix and imported as the value of nixpkgs.overlays.
Linux kernel - The Nix expressions to build the Linux kernel are in - pkgs/os-specific/linux/kernel. - The function that builds the kernel has an argument - kernelPatches which should be a list of {name, - patch, extraConfig} attribute sets, where name - is the name of the patch (which is included in the kernel’s - meta.description attribute), patch is - the patch itself (possibly compressed), and extraConfig - (optional) is a string specifying extra options to be concatenated to the - kernel configuration file (.config). + The function that builds the kernel has an argument kernelPatches which should be a list of {name, patch, extraConfig} attribute sets, where name is the name of the patch (which is included in the kernel’s meta.description attribute), patch is the patch itself (possibly compressed), and extraConfig (optional) is a string specifying extra options to be concatenated to the kernel configuration file (.config). - The kernel derivation exports an attribute features - specifying whether optional functionality is or isn’t enabled. This is - used in NixOS to implement kernel-specific behaviour. For instance, if the - kernel has the iwlwifi feature (i.e. has built-in support - for Intel wireless chipsets), then NixOS doesn’t have to build the - external iwlwifi package: + The kernel derivation exports an attribute features specifying whether optional functionality is or isn’t enabled. This is used in NixOS to implement kernel-specific behaviour. For instance, if the kernel has the iwlwifi feature (i.e. has built-in support for Intel wireless chipsets), then NixOS doesn’t have to build the external iwlwifi package: modulesTree = [kernel] ++ pkgs.lib.optional (!kernel.features ? iwlwifi) kernelPackages.iwlwifi @@ -47,45 +32,31 @@ modulesTree = [kernel] - Copy the old Nix expression (e.g. linux-2.6.21.nix) - to the new one (e.g. linux-2.6.22.nix) and update - it. + Copy the old Nix expression (e.g. linux-2.6.21.nix) to the new one (e.g. linux-2.6.22.nix) and update it. - Add the new kernel to all-packages.nix (e.g., create - an attribute kernel_2_6_22). + Add the new kernel to all-packages.nix (e.g., create an attribute kernel_2_6_22). - Now we’re going to update the kernel configuration. First unpack the - kernel. Then for each supported platform (i686, - x86_64, uml) do the following: + Now we’re going to update the kernel configuration. First unpack the kernel. Then for each supported platform (i686, x86_64, uml) do the following: - Make an copy from the old config (e.g. - config-2.6.21-i686-smp) to the new one (e.g. - config-2.6.22-i686-smp). + Make an copy from the old config (e.g. config-2.6.21-i686-smp) to the new one (e.g. config-2.6.22-i686-smp). - Copy the config file for this platform (e.g. - config-2.6.22-i686-smp) to - .config in the kernel source tree. + Copy the config file for this platform (e.g. config-2.6.22-i686-smp) to .config in the kernel source tree. - Run make oldconfig - ARCH={i386,x86_64,um} and answer - all questions. (For the uml configuration, also add - SHELL=bash.) Make sure to keep the configuration - consistent between platforms (i.e. don’t enable some feature on - i686 and disable it on x86_64). + Run make oldconfig ARCH={i386,x86_64,um} and answer all questions. (For the uml configuration, also add SHELL=bash.) Make sure to keep the configuration consistent between platforms (i.e. don’t enable some feature on i686 and disable it on x86_64). @@ -99,8 +70,7 @@ modulesTree = [kernel] - Copy .config over the new config file (e.g. - config-2.6.22-i686-smp). + Copy .config over the new config file (e.g. config-2.6.22-i686-smp). @@ -108,18 +78,12 @@ modulesTree = [kernel] - Test building the kernel: nix-build -A kernel_2_6_22. - If it compiles, ship it! For extra credit, try booting NixOS with it. + Test building the kernel: nix-build -A kernel_2_6_22. If it compiles, ship it! For extra credit, try booting NixOS with it. - It may be that the new kernel requires updating the external kernel - modules and kernel-dependent packages listed in the - linuxPackagesFor function in - all-packages.nix (such as the NVIDIA drivers, AUFS, - etc.). If the updated packages aren’t backwards compatible with older - kernels, you may need to keep the older versions around. + It may be that the new kernel requires updating the external kernel modules and kernel-dependent packages listed in the linuxPackagesFor function in all-packages.nix (such as the NVIDIA drivers, AUFS, etc.). If the updated packages aren’t backwards compatible with older kernels, you may need to keep the older versions around. @@ -130,13 +94,7 @@ modulesTree = [kernel] X.org - The Nix expressions for the X.org packages reside in - pkgs/servers/x11/xorg/default.nix. 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 - pkgs/servers/x11/xorg/overrides.nix, in which you can - override or add to the derivations produced by the generator. + The Nix expressions for the X.org packages reside in pkgs/servers/x11/xorg/default.nix. 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 pkgs/servers/x11/xorg/overrides.nix, in which you can override or add to the derivations produced by the generator. @@ -146,37 +104,22 @@ modulesTree = [kernel] $ cat tarballs-7.5.list extra.list old.list \ | perl ./generate-expr-from-tarballs.pl - For each of the tarballs in the .list files, the script - downloads it, unpacks it, and searches its configure.ac - and *.pc.in files for dependencies. This information is - used to generate default.nix. The generator caches - downloaded tarballs between runs. Pay close attention to the NOT - FOUND: name messages at the end of the - run, since they may indicate missing dependencies. (Some might be optional - dependencies, however.) + For each of the tarballs in the .list files, the script downloads it, unpacks it, and searches its configure.ac and *.pc.in files for dependencies. This information is used to generate default.nix. The generator caches downloaded tarballs between runs. Pay close attention to the NOT FOUND: name messages at the end of the run, since they may indicate missing dependencies. (Some might be optional dependencies, however.) - A file like tarballs-7.5.list contains all tarballs in - a X.org release. It can be generated like this: + A file like tarballs-7.5.list contains all tarballs in a X.org release. It can be generated like this: $ export i="mirror://xorg/X11R7.4/src/everything/" $ cat $(PRINT_PATH=1 nix-prefetch-url $i | tail -n 1) \ | perl -e 'while (<>) { if (/(href|HREF)="([^"]*.bz2)"/) { print "$ENV{'i'}$2\n"; }; }' \ | sort > tarballs-7.4.list - extra.list contains libraries that aren’t part of - X.org proper, but are closely related to it, such as - libxcb. old.list contains some - packages that were removed from X.org, but are still needed by some people - or by other packages (such as imake). + extra.list contains libraries that aren’t part of X.org proper, but are closely related to it, such as libxcb. old.list contains some packages that were removed from X.org, but are still needed by some people or by other packages (such as imake). - If the expression for a package requires derivation attributes that the - generator cannot figure out automatically (say, patches - or a postInstall hook), you should modify - pkgs/servers/x11/xorg/overrides.nix. + If the expression for a package requires derivation attributes that the generator cannot figure out automatically (say, patches or a postInstall hook), you should modify pkgs/servers/x11/xorg/overrides.nix.
@@ -199,41 +142,19 @@ modulesTree = [kernel] Eclipse - The Nix expressions related to the Eclipse platform and IDE are in - pkgs/applications/editors/eclipse. + The Nix expressions related to the Eclipse platform and IDE are in pkgs/applications/editors/eclipse. - 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: + 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: $ nix-env -f '<nixpkgs>' -qaP -A eclipses --description - Once an Eclipse variant is installed it can be run using the - eclipse 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. + Once an Eclipse variant is installed it can be run using the eclipse 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. - 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 - Eclipse environment. This type of environment is - created using the function eclipseWithPlugins found - inside the nixpkgs.eclipses attribute set. This function - takes as argument { eclipse, plugins ? [], jvmArgs ? [] } - where eclipse is a one of the Eclipse packages described - above, plugins is a list of plugin derivations, and - jvmArgs 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 + 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 Eclipse environment. This type of environment is created using the function eclipseWithPlugins found inside the nixpkgs.eclipses attribute set. This function takes as argument { eclipse, plugins ? [], jvmArgs ? [] } where eclipse is a one of the Eclipse packages described above, plugins is a list of plugin derivations, and jvmArgs 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 packageOverrides = pkgs: { myEclipse = with pkgs.eclipses; eclipseWithPlugins { @@ -243,38 +164,18 @@ packageOverrides = pkgs: { }; } - to your Nixpkgs configuration - (~/.config/nixpkgs/config.nix) and install it by - running nix-env -f '<nixpkgs>' -iA myEclipse and - afterward run Eclipse as usual. It is possible to find out which plugins are - available for installation using eclipseWithPlugins by - running + to your Nixpkgs configuration (~/.config/nixpkgs/config.nix) and install it by running nix-env -f '<nixpkgs>' -iA myEclipse and afterward run Eclipse as usual. It is possible to find out which plugins are available for installation using eclipseWithPlugins by running $ nix-env -f '<nixpkgs>' -qaP -A eclipses.plugins --description - 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 - buildEclipseUpdateSite and - buildEclipsePlugin functions found in the - nixpkgs.eclipses.plugins attribute set. Use the - buildEclipseUpdateSite function to install a plugin - distributed as an Eclipse update site. This function takes { name, - src } as argument where src 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 buildEclipsePlugin function can be - used to install a plugin that consists of a pair of feature and plugin JARs. - This function takes an argument { name, srcFeature, srcPlugin - } where srcFeature and - srcPlugin are the feature and plugin JARs, respectively. + 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 buildEclipseUpdateSite and buildEclipsePlugin functions found in the nixpkgs.eclipses.plugins attribute set. Use the buildEclipseUpdateSite function to install a plugin distributed as an Eclipse update site. This function takes { name, src } as argument where src 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 buildEclipsePlugin function can be used to install a plugin that consists of a pair of feature and plugin JARs. This function takes an argument { name, srcFeature, srcPlugin } where srcFeature and srcPlugin are the feature and plugin JARs, respectively. - Expanding the previous example with two plugins using the above functions we - have + Expanding the previous example with two plugins using the above functions we have packageOverrides = pkgs: { myEclipse = with pkgs.eclipses; eclipseWithPlugins { @@ -311,19 +212,15 @@ packageOverrides = pkgs: { Elm - To start a development environment do nix-shell -p elmPackages.elm - elmPackages.elm-format + To start a development environment do nix-shell -p elmPackages.elm elmPackages.elm-format - To update Elm compiler, see - nixpkgs/pkgs/development/compilers/elm/README.md. + To update Elm compiler, see nixpkgs/pkgs/development/compilers/elm/README.md. - To package Elm applications, - read about - elm2nix. + To package Elm applications, read about elm2nix.
@@ -342,11 +239,7 @@ packageOverrides = pkgs: { Interactive shell helpers - 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 PACKAGE-share scripts are shipped that print - the location of the corresponding shared folder. Current list of such - packages is as following: + 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 PACKAGE-share scripts are shipped that print the location of the corresponding shared folder. Current list of such packages is as following: @@ -369,31 +262,20 @@ packageOverrides = pkgs: { Weechat - 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 + 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 weechat.override {configure = {availablePlugins, ...}: { plugins = with availablePlugins; [ python perl ]; } } - If the configure function returns an attrset without the - plugins attribute, availablePlugins - will be used automatically. + If the configure function returns an attrset without the plugins attribute, availablePlugins will be used automatically. - The plugins currently available are python, - perl, ruby, guile, - tcl and lua. + The plugins currently available are python, perl, ruby, guile, tcl and lua. - The python and perl plugins allows the addition of extra libraries. For - instance, the inotify.py script in weechat-scripts - requires D-Bus or libnotify, and the fish.py script - requires pycrypto. To use these scripts, use the plugin's - withPackages attribute: + The python and perl plugins allows the addition of extra libraries. For instance, the inotify.py script in weechat-scripts requires D-Bus or libnotify, and the fish.py script requires pycrypto. To use these scripts, use the plugin's withPackages attribute: weechat.override { configure = {availablePlugins, ...}: { plugins = with availablePlugins; [ (python.withPackages (ps: with ps; [ pycrypto python-dbus ])) @@ -404,8 +286,7 @@ packageOverrides = pkgs: { - In order to also keep all default plugins installed, it is possible to use - the following method: + In order to also keep all default plugins installed, it is possible to use the following method: weechat.override { configure = { availablePlugins, ... }: { plugins = builtins.attrValues (availablePlugins // { python = availablePlugins.python.withPackages (ps: with ps; [ pycrypto python-dbus ]); @@ -415,9 +296,7 @@ packageOverrides = pkgs: { - WeeChat allows to set defaults on startup using the - --run-command. The configure method - can be used to pass commands to the program: + WeeChat allows to set defaults on startup using the --run-command. The configure method can be used to pass commands to the program: weechat.override { configure = { availablePlugins, ... }: { init = '' @@ -426,14 +305,11 @@ packageOverrides = pkgs: { ''; }; } - Further values can be added to the list of commands when running - weechat --run-command "your-commands". + Further values can be added to the list of commands when running weechat --run-command "your-commands". - Additionally it's possible to specify scripts to be loaded when starting - weechat. These will be loaded before the commands from - init: + Additionally it's possible to specify scripts to be loaded when starting weechat. These will be loaded before the commands from init: weechat.override { configure = { availablePlugins, ... }: { scripts = with pkgs.weechatScripts; [ @@ -447,11 +323,7 @@ packageOverrides = pkgs: { - In nixpkgs there's a subpackage which contains - derivations for WeeChat scripts. Such derivations expect a - passthru.scripts attribute which contains a list of all - scripts inside the store path. Furthermore all scripts have to live in - $out/share. An exemplary derivation looks like this: + In nixpkgs there's a subpackage which contains derivations for WeeChat scripts. Such derivations expect a passthru.scripts attribute which contains a list of all scripts inside the store path. Furthermore all scripts have to live in $out/share. An exemplary derivation looks like this: { stdenv, fetchurl }: stdenv.mkDerivation { @@ -480,18 +352,11 @@ stdenv.mkDerivation { Activating the engine - IBus needs to be configured accordingly to activate - typing-booster. The configuration depends on the desktop - manager in use. For detailed instructions, please refer to the - upstream - docs. + IBus needs to be configured accordingly to activate typing-booster. The configuration depends on the desktop manager in use. For detailed instructions, please refer to the upstream docs. - On NixOS you need to explicitly enable ibus with given - engines before customizing your desktop to use - typing-booster. This can be achieved using the - ibus module: + On NixOS you need to explicitly enable ibus with given engines before customizing your desktop to use typing-booster. This can be achieved using the ibus module: { pkgs, ... }: { i18n.inputMethod = { enabled = "ibus"; @@ -505,21 +370,14 @@ stdenv.mkDerivation { Using custom hunspell dictionaries - The IBus engine is based on hunspell to support - completion in many languages. By default the dictionaries - de-de, en-us, - fr-moderne es-es, - it-it, sv-se and - sv-fi are in use. To add another dictionary, the package - can be overridden like this: + The IBus engine is based on hunspell to support completion in many languages. By default the dictionaries de-de, en-us, fr-moderne es-es, it-it, sv-se and sv-fi are in use. To add another dictionary, the package can be overridden like this: ibus-engines.typing-booster.override { langs = [ "de-at" "en-gb" ]; } - Note: each language passed to langs must be an - attribute name in pkgs.hunspellDicts. + Note: each language passed to langs must be an attribute name in pkgs.hunspellDicts.
@@ -527,10 +385,7 @@ stdenv.mkDerivation { Built-in emoji picker - The ibus-engines.typing-booster package contains a - program named emoji-picker. To display all emojis - correctly, a special font such as noto-fonts-emoji is - needed: + The ibus-engines.typing-booster package contains a program named emoji-picker. To display all emojis correctly, a special font such as noto-fonts-emoji is needed: @@ -545,45 +400,22 @@ stdenv.mkDerivation { Nginx - Nginx is a reverse proxy and - lightweight webserver. + Nginx is a reverse proxy and lightweight webserver.
ETags on static files served from the Nix store - 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 - Last-Modified - response header automatically; unfortunately, it works by using filesystem - timestamps to determine the value of the Last-Modified - 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). + 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 Last-Modified response header automatically; unfortunately, it works by using filesystem timestamps to determine the value of the Last-Modified 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). - Fortunately, HTTP supports an alternative (and more effective) caching - mechanism: the - ETag - response header. The value of the ETag 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 If-None-Match header. If the - ETag value is unchanged, then the server does not need to resend the - content. + Fortunately, HTTP supports an alternative (and more effective) caching mechanism: the ETag response header. The value of the ETag 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 If-None-Match header. If the ETag value is unchanged, then the server does not need to resend the content. - As of NixOS 19.09, the nginx package in Nixpkgs is patched such that when - nginx serves a file out of /nix/store, the hash in the - store path is used as the ETag 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. + As of NixOS 19.09, the nginx package in Nixpkgs is patched such that when nginx serves a file out of /nix/store, the hash in the store path is used as the ETag 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.
diff --git a/doc/package-specific-user-notes.xml b/doc/package-specific-user-notes.xml index 09af69bb15d8..a3ee42dc7fa0 100644 --- a/doc/package-specific-user-notes.xml +++ b/doc/package-specific-user-notes.xml @@ -1,46 +1,24 @@ Package-specific usage notes - 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 - package-specific development notes. + 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 package-specific development notes.
OpenGL - Packages that use OpenGL have NixOS desktop as their primary target. The - current solution for loading the GPU-specific drivers is based on - libglvnd and looks for the driver implementation in - LD_LIBRARY_PATH. 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 - libglvnd and mesa_drivers in - LD_LIBRARY_PATH. For proprietary video drivers you might - have luck with also adding the corresponding video driver package. + Packages that use OpenGL have NixOS desktop as their primary target. The current solution for loading the GPU-specific drivers is based on libglvnd and looks for the driver implementation in LD_LIBRARY_PATH. 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 libglvnd and mesa_drivers in LD_LIBRARY_PATH. For proprietary video drivers you might have luck with also adding the corresponding video driver package.
Locales - To allow simultaneous use of packages linked against different versions of - glibc with different locale archive formats Nixpkgs - patches glibc to rely on - LOCALE_ARCHIVE environment variable. + To allow simultaneous use of packages linked against different versions of glibc with different locale archive formats Nixpkgs patches glibc to rely on LOCALE_ARCHIVE environment variable. - 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 LOCALE_ARCHIVE variable pointing to - ${glibcLocales}/lib/locale/locale-archive. 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 allLocales and - locales of the package. + 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 LOCALE_ARCHIVE variable pointing to ${glibcLocales}/lib/locale/locale-archive. 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 allLocales and locales of the package.
@@ -50,15 +28,7 @@ Configuring Emacs - The Emacs package comes with some extra helpers to make it easier to - configure. emacsWithPackages 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 - company, counsel, - flycheck, ivy, - magit, projectile, and - use-package you could use this as a - ~/.config/nixpkgs/config.nix override: + The Emacs package comes with some extra helpers to make it easier to configure. emacsWithPackages 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 company, counsel, flycheck, ivy, magit, projectile, and use-package you could use this as a ~/.config/nixpkgs/config.nix override: @@ -78,15 +48,7 @@ - You can install it like any other packages via nix-env -iA - myEmacs. However, this will only install those packages. It will - not configure 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 - default.el file in - /share/emacs/site-start/. Emacs knows to load this - file automatically when it starts. + You can install it like any other packages via nix-env -iA myEmacs. However, this will only install those packages. It will not configure 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 default.el file in /share/emacs/site-start/. Emacs knows to load this file automatically when it starts. @@ -168,22 +130,11 @@ cp ${myEmacsConfig} $out/share/emacs/site-lisp/default.el - 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 - -q to the Emacs command. + 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 -q to the Emacs command. - Sometimes emacsWithPackages 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 pkgs/top-level/emacs-packages.nix). 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 - overrideScope'. + Sometimes emacsWithPackages 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 pkgs/top-level/emacs-packages.nix). 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 overrideScope'. @@ -203,23 +154,18 @@ overrides = self: super: rec { DLib - DLib is a modern, C++-based - toolkit which provides several machine learning algorithms. + DLib is a modern, C++-based toolkit which provides several machine learning algorithms.
Compiling without AVX support - Especially older CPUs don't support - AVX - (Advanced Vector Extensions) instructions that are used by - DLib to optimize their algorithms. + Especially older CPUs don't support AVX (Advanced Vector Extensions) instructions that are used by DLib to optimize their algorithms. - On the affected hardware errors like Illegal instruction - will occur. In those cases AVX support needs to be disabled: + On the affected hardware errors like Illegal instruction will occur. In those cases AVX support needs to be disabled: self: super: { dlib = super.dlib.override { avxSupport = false; }; } @@ -230,22 +176,11 @@ overrides = self: super: rec { Unfree software - All users of Nixpkgs are free software users, and many users (and - developers) of Nixpkgs want to limit and tightly control their exposure to - unfree software. At the same time, many users need (or want) to run some - specific pieces of proprietary software. Nixpkgs includes some expressions - for unfree software packages. By default unfree software cannot be installed - and doesn’t show up in searches. To allow installing unfree software in a - single Nix invocation one can export - NIXPKGS_ALLOW_UNFREE=1. For a persistent solution, users - can set allowUnfree in the Nixpkgs configuration. + All users of Nixpkgs are free software users, and many users (and developers) of Nixpkgs want to limit and tightly control their exposure to unfree software. At the same time, many users need (or want) to run some specific pieces of proprietary software. Nixpkgs includes some expressions for unfree software packages. By default unfree software cannot be installed and doesn’t show up in searches. To allow installing unfree software in a single Nix invocation one can export NIXPKGS_ALLOW_UNFREE=1. For a persistent solution, users can set allowUnfree in the Nixpkgs configuration. - Fine-grained control is possible by defining - allowUnfreePredicate function in config; it takes the - mkDerivation parameter attrset and returns - true for unfree packages that should be allowed. + Fine-grained control is possible by defining allowUnfreePredicate function in config; it takes the mkDerivation parameter attrset and returns true for unfree packages that should be allowed.
@@ -255,13 +190,7 @@ overrides = self: super: rec { Steam in Nix - Steam is distributed as a .deb file, for now only as - an i686 package (the amd64 package only has documentation). When unpacked, - it has a script called steam that in Ubuntu (their - target distro) would go to /usr/bin . When run for the - first time, this script copies some files to the user's home, which include - another script that is the ultimate responsible for launching the steam - binary, which is also in $HOME. + Steam is distributed as a .deb file, for now only as an i686 package (the amd64 package only has documentation). When unpacked, it has a script called steam that in Ubuntu (their target distro) would go to /usr/bin . When run for the first time, this script copies some files to the user's home, which include another script that is the ultimate responsible for launching the steam binary, which is also in $HOME. @@ -269,8 +198,7 @@ overrides = self: super: rec { - We don't have /bin/bash and many scripts point - there. Similarly for /usr/bin/python . + We don't have /bin/bash and many scripts point there. Similarly for /usr/bin/python . @@ -280,8 +208,7 @@ overrides = self: super: rec { - The steam.sh script in $HOME can not be patched, as - it is checked and rewritten by steam. + The steam.sh script in $HOME can not be patched, as it is checked and rewritten by steam. @@ -293,11 +220,7 @@ overrides = self: super: rec { - The current approach to deploy Steam in NixOS is composing a FHS-compatible - chroot environment, as documented - here. - 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. + The current approach to deploy Steam in NixOS is composing a FHS-compatible chroot environment, as documented here. 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.
@@ -309,9 +232,7 @@ overrides = self: super: rec { hardware.opengl.driSupport32Bit = true; in your /etc/nixos/configuration.nix. You'll also need hardware.pulseaudio.support32Bit = true; - 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 + 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 hardware.steam-hardware.enable = true; to your configuration. @@ -342,19 +263,14 @@ overrides = self: super: rec { - The newStdcpp parameter was removed since NixOS - 17.09 and should not be needed anymore. + The newStdcpp parameter was removed since NixOS 17.09 and should not be needed anymore. - 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 + 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 steam.sh: line 713: 7842 Segmentation fault (core dumped) - have a look at - this - pull request. + have a look at this pull request. @@ -368,8 +284,7 @@ overrides = self: super: rec { - There is no java in steam chrootenv by default. If you get a message - like + There is no java in steam chrootenv by default. If you get a message like /home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found You need to add steam.override { withJava = true; }; @@ -387,8 +302,7 @@ overrides = self: super: rec { steam-run - 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 + 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 pkgs.(steam.override { nativeOnly = true; newStdcpp = true; @@ -404,46 +318,23 @@ overrides = self: super: rec { - Please note that the citrix_receiver package has been - deprecated since its development was - discontinued - by upstream and has been replaced by - the - citrix workspace app. + Please note that the citrix_receiver package has been deprecated since its development was discontinued by upstream and has been replaced by the citrix workspace app. - Citrix - Receiver and - Citrix - Workspace App are a remote desktop viewers which provide access to - XenDesktop - installations. + Citrix Receiver and Citrix Workspace App are a remote desktop viewers which provide access to XenDesktop installations.
Basic usage - The tarball archive needs to be downloaded manually as the license - agreements of the vendor for - Citrix - Receiver or - Citrix - Workspace need to be accepted first. Then run - nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz. - With the archive available in the store the package can be built and - installed with Nix. + The tarball archive needs to be downloaded manually as the license agreements of the vendor for Citrix Receiver or Citrix Workspace need to be accepted first. Then run nix-prefetch-url file://$PWD/linuxx64-$version.tar.gz. With the archive available in the store the package can be built and installed with Nix. Caution with <command>nix-shell</command> installs - It's recommended to install Citrix Receiver and/or - Citrix Workspace using nix-env -i or - globally to ensure that the .desktop files are - installed properly into $XDG_CONFIG_DIRS. Otherwise it - won't be possible to open .ica files automatically from - the browser to start a Citrix connection. + It's recommended to install Citrix Receiver and/or Citrix Workspace using nix-env -i or globally to ensure that the .desktop files are installed properly into $XDG_CONFIG_DIRS. Otherwise it won't be possible to open .ica files automatically from the browser to start a Citrix connection.
@@ -452,17 +343,7 @@ overrides = self: super: rec { Custom certificates - The Citrix Workspace App in nixpkgs - trust several certificates - from the - Mozilla database 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 - $ICAROOT, - however this directory is a store path in nixpkgs. In - order to work around this issue the package provides a simple mechanism to - add custom certificates without rebuilding the entire package using - symlinkJoin: + The Citrix Workspace App in nixpkgs trust several certificates from the Mozilla database 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 $ICAROOT, however this directory is a store path in nixpkgs. In order to work around this issue the package provides a simple mechanism to add custom certificates without rebuilding the entire package using symlinkJoin: { config.allowUnfree = true; }; let extraCerts = [ ./custom-cert-1.pem ./custom-cert-2.pem /* ... */ ]; in diff --git a/doc/platform-notes.xml b/doc/platform-notes.xml index 157d3fe2fcdd..d8d7692fc9a7 100644 --- a/doc/platform-notes.xml +++ b/doc/platform-notes.xml @@ -12,12 +12,7 @@ - The Darwin stdenv uses clang instead of gcc. When - referring to the compiler $CC or cc - will work in both cases. Some builds hardcode gcc/g++ in their build - scripts, that can usually be fixed with using something like - makeFlags = [ "CC=cc" ]; or by patching the build - scripts. + The Darwin stdenv uses clang instead of gcc. When referring to the compiler $CC or cc will work in both cases. Some builds hardcode gcc/g++ in their build scripts, that can usually be fixed with using something like makeFlags = [ "CC=cc" ]; or by patching the build scripts. stdenv.mkDerivation { @@ -31,12 +26,7 @@ stdenv.mkDerivation { - On Darwin, libraries are linked using absolute paths, libraries are - resolved by their install_name at link time. Sometimes - packages won't set this correctly causing the library lookups to fail at - runtime. This can be fixed by adding extra linker flags or by running - install_name_tool -id during the - fixupPhase. + On Darwin, libraries are linked using absolute paths, libraries are resolved by their install_name at link time. Sometimes packages won't set this correctly causing the library lookups to fail at runtime. This can be fixed by adding extra linker flags or by running install_name_tool -id during the fixupPhase. stdenv.mkDerivation { @@ -48,16 +38,10 @@ stdenv.mkDerivation { - Even if the libraries are linked using absolute paths and resolved via - their install_name correctly, tests can sometimes fail - to run binaries. This happens because the checkPhase - runs before the libraries are installed. + Even if the libraries are linked using absolute paths and resolved via their install_name correctly, tests can sometimes fail to run binaries. This happens because the checkPhase runs before the libraries are installed. - This can usually be solved by running the tests after the - installPhase or alternatively by using - DYLD_LIBRARY_PATH. More information about this variable - can be found in the + This can usually be solved by running the tests after the installPhase or alternatively by using DYLD_LIBRARY_PATH. More information about this variable can be found in the dyld 1 manpage. @@ -78,11 +62,7 @@ stdenv.mkDerivation { - Some packages assume xcode is available and use xcrun - to resolve build tools like clang, etc. This causes - errors like xcode-select: error: no developer tools were found at - '/Applications/Xcode.app' while the build doesn't actually depend - on xcode. + Some packages assume xcode is available and use xcrun to resolve build tools like clang, etc. This causes errors like xcode-select: error: no developer tools were found at '/Applications/Xcode.app' while the build doesn't actually depend on xcode. stdenv.mkDerivation { @@ -95,9 +75,7 @@ stdenv.mkDerivation { } - The package xcbuild can be used to build projects that - really depend on Xcode. However, this replacement is not 100% compatible - with Xcode and can occasionally cause issues. + The package xcbuild can be used to build projects that really depend on Xcode. However, this replacement is not 100% compatible with Xcode and can occasionally cause issues. diff --git a/doc/quick-start.xml b/doc/quick-start.xml index 39e3e7396bd5..80514cba4904 100644 --- a/doc/quick-start.xml +++ b/doc/quick-start.xml @@ -15,120 +15,75 @@
- Find a good place in the Nixpkgs tree to add the Nix expression for your - package. For instance, a library package typically goes into - pkgs/development/libraries/pkgname, - while a web browser goes into - pkgs/applications/networking/browsers/pkgname. - See for some hints on the tree - organisation. Create a directory for your package, e.g. + Find a good place in the Nixpkgs tree to add the Nix expression for your package. For instance, a library package typically goes into pkgs/development/libraries/pkgname, while a web browser goes into pkgs/applications/networking/browsers/pkgname. See for some hints on the tree organisation. Create a directory for your package, e.g. $ mkdir pkgs/development/libraries/libfoo - In the package directory, create a Nix expression — a piece of code that - describes how to build the package. In this case, it should be a - function that is called with the package dependencies - as arguments, and returns a build of the package in the Nix store. The - expression should usually be called default.nix. + In the package directory, create a Nix expression — a piece of code that describes how to build the package. In this case, it should be a function that is called with the package dependencies as arguments, and returns a build of the package in the Nix store. The expression should usually be called default.nix. $ emacs pkgs/development/libraries/libfoo/default.nix $ git add pkgs/development/libraries/libfoo/default.nix - You can have a look at the existing Nix expressions under - pkgs/ to see how it’s done. Here are some good - ones: + You can have a look at the existing Nix expressions under pkgs/ to see how it’s done. Here are some good ones: - GNU Hello: - pkgs/applications/misc/hello/default.nix. - Trivial package, which specifies some meta - attributes which is good practice. + GNU Hello: pkgs/applications/misc/hello/default.nix. Trivial package, which specifies some meta attributes which is good practice. - GNU cpio: - pkgs/tools/archivers/cpio/default.nix. - Also a simple package. The generic builder in stdenv - does everything for you. It has no dependencies beyond - stdenv. + GNU cpio: pkgs/tools/archivers/cpio/default.nix. Also a simple package. The generic builder in stdenv does everything for you. It has no dependencies beyond stdenv. - GNU Multiple Precision arithmetic library (GMP): - pkgs/development/libraries/gmp/5.1.x.nix. - Also done by the generic builder, but has a dependency on - m4. + GNU Multiple Precision arithmetic library (GMP): pkgs/development/libraries/gmp/5.1.x.nix. Also done by the generic builder, but has a dependency on m4. - Pan, a GTK-based newsreader: - pkgs/applications/networking/newsreaders/pan/default.nix. - Has an optional dependency on gtkspell, which is - only built if spellCheck is true. + Pan, a GTK-based newsreader: pkgs/applications/networking/newsreaders/pan/default.nix. Has an optional dependency on gtkspell, which is only built if spellCheck is true. - Apache HTTPD: - pkgs/servers/http/apache-httpd/2.4.nix. - A bunch of optional features, variable substitutions in the configure - flags, a post-install hook, and miscellaneous hackery. + Apache HTTPD: pkgs/servers/http/apache-httpd/2.4.nix. A bunch of optional features, variable substitutions in the configure flags, a post-install hook, and miscellaneous hackery. - Thunderbird: - pkgs/applications/networking/mailreaders/thunderbird/default.nix. - Lots of dependencies. + Thunderbird: pkgs/applications/networking/mailreaders/thunderbird/default.nix. Lots of dependencies. - JDiskReport, a Java utility: - pkgs/tools/misc/jdiskreport/default.nix - (and the - builder). - Nixpkgs doesn’t have a decent stdenv for Java yet - so this is pretty ad-hoc. + JDiskReport, a Java utility: pkgs/tools/misc/jdiskreport/default.nix (and the builder). Nixpkgs doesn’t have a decent stdenv for Java yet so this is pretty ad-hoc. - XML::Simple, a Perl module: - pkgs/top-level/perl-packages.nix - (search for the XMLSimple attribute). Most Perl - modules are so simple to build that they are defined directly in - perl-packages.nix; no need to make a separate file - for them. + XML::Simple, a Perl module: pkgs/top-level/perl-packages.nix (search for the XMLSimple attribute). Most Perl modules are so simple to build that they are defined directly in perl-packages.nix; no need to make a separate file for them. - Adobe Reader: - pkgs/applications/misc/adobe-reader/default.nix. - Shows how binary-only packages can be supported. In particular the - builder - uses patchelf to set the RUNPATH and ELF interpreter - of the executables so that the right libraries are found at runtime. + Adobe Reader: pkgs/applications/misc/adobe-reader/default.nix. Shows how binary-only packages can be supported. In particular the builder uses patchelf to set the RUNPATH and ELF interpreter of the executables so that the right libraries are found at runtime. @@ -138,67 +93,45 @@ - All meta attributes are - optional, but it’s still a good idea to provide at least the - description, homepage and - meta attributes are optional, but it’s still a good idea to provide at least the description, homepage and license. - You can use nix-prefetch-url - url to get the SHA-256 hash of source - distributions. There are similar commands as - nix-prefetch-git and - nix-prefetch-hg available in - nix-prefetch-scripts package. + You can use nix-prefetch-url url to get the SHA-256 hash of source distributions. There are similar commands as nix-prefetch-git and nix-prefetch-hg available in nix-prefetch-scripts package. - A list of schemes for mirror:// URLs can be found in - mirror:// URLs can be found in pkgs/build-support/fetchurl/mirrors.nix. - The exact syntax and semantics of the Nix expression language, including - the built-in function, are described in the Nix manual in the - chapter - on writing Nix expressions. + The exact syntax and semantics of the Nix expression language, including the built-in function, are described in the Nix manual in the chapter on writing Nix expressions. - Add a call to the function defined in the previous step to - pkgs/top-level/all-packages.nix - with some descriptive name for the variable, e.g. - libfoo. + Add a call to the function defined in the previous step to pkgs/top-level/all-packages.nix with some descriptive name for the variable, e.g. libfoo. $ emacs pkgs/top-level/all-packages.nix - The attributes in that file are sorted by category (like “Development / - Libraries”) that more-or-less correspond to the directory structure of - Nixpkgs, and then by attribute name. + The attributes in that file are sorted by category (like “Development / Libraries”) that more-or-less correspond to the directory structure of Nixpkgs, and then by attribute name. - To test whether the package builds, run the following command from the - root of the nixpkgs source tree: + To test whether the package builds, run the following command from the root of the nixpkgs source tree: $ nix-build -A libfoo - where libfoo should be the variable name defined in the - previous step. You may want to add the flag to keep - the temporary build directory in case something fails. If the build - succeeds, a symlink ./result to the package in the - Nix store is created. + where libfoo should be the variable name defined in the previous step. You may want to add the flag to keep the temporary build directory in case something fails. If the build succeeds, a symlink ./result to the package in the Nix store is created. @@ -210,14 +143,9 @@ - Optionally commit the new package and open a pull request - to - nixpkgs, or use - - the Patches category on Discourse for sending a patch without a - GitHub account. + Optionally commit the new package and open a pull request to nixpkgs, or use the Patches category on Discourse for sending a patch without a GitHub account.
diff --git a/doc/release-notes.xml b/doc/release-notes.xml index 8d9b1813010a..b85f61da079c 100644 --- a/doc/release-notes.xml +++ b/doc/release-notes.xml @@ -6,15 +6,11 @@ Release 0.14 (June 4, 2012) - In preparation for the switch from Subversion to Git, this release is mainly - the prevent the Nixpkgs version number from going backwards. (This would - happen because prerelease version numbers produced for the Git repository - are lower than those for the Subversion repository.) + In preparation for the switch from Subversion to Git, this release is mainly the prevent the Nixpkgs version number from going backwards. (This would happen because prerelease version numbers produced for the Git repository are lower than those for the Subversion repository.) - Since the last release, there have been thousands of changes and new - packages by numerous contributors. For details, see the commit logs. + Since the last release, there have been thousands of changes and new packages by numerous contributors. For details, see the commit logs.
@@ -55,14 +51,11 @@ Release 0.12 (April 24, 2009) - There are way too many additions to Nixpkgs since the last release to list - here: for example, the number of packages on Linux has increased from 1002 - to 2159. However, some specific improvements are worth listing: + There are way too many additions to Nixpkgs since the last release to list here: for example, the number of packages on Linux has increased from 1002 to 2159. However, some specific improvements are worth listing: - Nixpkgs now has a manual. In particular, it describes the standard build - environment in detail. + Nixpkgs now has a manual. In particular, it describes the standard build environment in detail. @@ -122,9 +115,7 @@ - Support for building derivations in a virtual machine, including RPM and - Debian builds in automatically generated VM images. See - pkgs/build-support/vm/default.nix for details. + Support for building derivations in a virtual machine, including RPM and Debian builds in automatically generated VM images. See pkgs/build-support/vm/default.nix for details. @@ -136,13 +127,7 @@ - The following people contributed to this release: Andres Löh, Arie - Middelkoop, Armijn Hemel, Eelco Dolstra, Lluís Batlle, Ludovic Courtès, - Marc Weber, Mart Kolthof, Martin Bravenboer, Michael Raskin, Nicolas - Pierron, Peter Simons, Pjotr Prins, Rob Vermaas, Sander van der Burg, Tobias - Hammerschmidt, Valentin David, Wouter den Breejen and Yury G. Kudryashov. In - addition, several people contributed patches on the - nix-dev mailing list. + The following people contributed to this release: Andres Löh, Arie Middelkoop, Armijn Hemel, Eelco Dolstra, Lluís Batlle, Ludovic Courtès, Marc Weber, Mart Kolthof, Martin Bravenboer, Michael Raskin, Nicolas Pierron, Peter Simons, Pjotr Prins, Rob Vermaas, Sander van der Burg, Tobias Hammerschmidt, Valentin David, Wouter den Breejen and Yury G. Kudryashov. In addition, several people contributed patches on the nix-dev mailing list.
@@ -153,25 +138,12 @@ - The standard build environment (stdenv) is now pure on - the x86_64-linux and powerpc-linux - platforms, just as on i686-linux. (Purity means that - building and using the standard environment has no dependencies outside - of the Nix store. For instance, it doesn’t require an external C - compiler such as /usr/bin/gcc.) Also, the statically - linked binaries used in the bootstrap process are now automatically - reproducible, making it easy to update the bootstrap tools and to add - support for other Linux platforms. See - pkgs/stdenv/linux/make-bootstrap-tools.nix for - details. + The standard build environment (stdenv) is now pure on the x86_64-linux and powerpc-linux platforms, just as on i686-linux. (Purity means that building and using the standard environment has no dependencies outside of the Nix store. For instance, it doesn’t require an external C compiler such as /usr/bin/gcc.) Also, the statically linked binaries used in the bootstrap process are now automatically reproducible, making it easy to update the bootstrap tools and to add support for other Linux platforms. See pkgs/stdenv/linux/make-bootstrap-tools.nix for details. - Hook variables in the generic builder are now executed using the - eval shell command. This has a major advantage: you - can write hooks directly in Nix expressions. For instance, rather than - writing a builder like this: + Hook variables in the generic builder are now executed using the eval shell command. This has a major advantage: you can write hooks directly in Nix expressions. For instance, rather than writing a builder like this: source $stdenv/setup @@ -182,91 +154,57 @@ postInstall() { } genericBuild - (the gzip builder), you can just add this attribute to - the derivation: + (the gzip builder), you can just add this attribute to the derivation: postInstall = "ln -sf gzip $out/bin/gunzip; ln -sf gzip $out/bin/zcat"; - and so a separate build script becomes unnecessary. This should allow us - to get rid of most builders in Nixpkgs. + and so a separate build script becomes unnecessary. This should allow us to get rid of most builders in Nixpkgs. - It is now possible to have the generic builder pass arguments to - configure and make that contain - whitespace. Previously, for example, you could say in a builder, + It is now possible to have the generic builder pass arguments to configure and make that contain whitespace. Previously, for example, you could say in a builder, configureFlags="CFLAGS=-O0" but not configureFlags="CFLAGS=-O0 -g" - since the -g would be interpreted as a separate - argument to configure. Now you can say + since the -g would be interpreted as a separate argument to configure. Now you can say configureFlagsArray=("CFLAGS=-O0 -g") or similarly configureFlagsArray=("CFLAGS=-O0 -g" "LDFLAGS=-L/foo -L/bar") - which does the right thing. Idem for makeFlags, - installFlags, checkFlags and - distFlags. + which does the right thing. Idem for makeFlags, installFlags, checkFlags and distFlags. - Unfortunately you can't pass arrays to Bash through the environment, so - you can't put the array above in a Nix expression, e.g., + Unfortunately you can't pass arrays to Bash through the environment, so you can't put the array above in a Nix expression, e.g., configureFlagsArray = ["CFLAGS=-O0 -g"]; - since it would just be flattened to a since string. However, you - can use the inline hooks described above: + since it would just be flattened to a since string. However, you can use the inline hooks described above: preConfigure = "configureFlagsArray=(\"CFLAGS=-O0 -g\")"; - The function fetchurl now has support for two - different kinds of mirroring of files. First, it has support for - content-addressable mirrors. For example, given the - fetchurl call + The function fetchurl now has support for two different kinds of mirroring of files. First, it has support for content-addressable mirrors. For example, given the fetchurl call fetchurl { url = http://releases.mozilla.org/.../firefox-2.0.0.6-source.tar.bz2; sha1 = "eb72f55e4a8bf08e8c6ef227c0ade3d068ba1082"; } - fetchurl will first try to download this file from - . - If that file doesn’t exist, it will try the original URL. In general, - the “content-addressed” location is - mirror/hash-type/hash. - There is currently only one content-addressable mirror - (), but more can be - specified in the hashedMirrors attribute in - pkgs/build-support/fetchurl/mirrors.nix, or by - setting the NIX_HASHED_MIRRORS environment variable to a - whitespace-separated list of URLs. + fetchurl will first try to download this file from . If that file doesn’t exist, it will try the original URL. In general, the “content-addressed” location is mirror/hash-type/hash. There is currently only one content-addressable mirror (), but more can be specified in the hashedMirrors attribute in pkgs/build-support/fetchurl/mirrors.nix, or by setting the NIX_HASHED_MIRRORS environment variable to a whitespace-separated list of URLs. - Second, fetchurl has support for widely-mirrored - distribution sites such as SourceForge or the Linux kernel archives. - Given a URL of the form - mirror://site/path, - it will try to download path from a - configurable list of mirrors for site. (This - idea was borrowed from Gentoo Linux.) Example: + Second, fetchurl has support for widely-mirrored distribution sites such as SourceForge or the Linux kernel archives. Given a URL of the form mirror://site/path, it will try to download path from a configurable list of mirrors for site. (This idea was borrowed from Gentoo Linux.) Example: fetchurl { url = mirror://gnu/gcc/gcc-4.2.0/gcc-core-4.2.0.tar.bz2; sha256 = "0ykhzxhr8857dr97z0j9wyybfz1kjr71xk457cfapfw5fjas4ny1"; } - Currently site can be - sourceforge, gnu and - kernel. The list of mirrors is defined in - pkgs/build-support/fetchurl/mirrors.nix. You can - override the list of mirrors for a particular site by setting the - environment variable - NIX_MIRRORS_site, e.g. + Currently site can be sourceforge, gnu and kernel. The list of mirrors is defined in pkgs/build-support/fetchurl/mirrors.nix. You can override the list of mirrors for a particular site by setting the environment variable NIX_MIRRORS_site, e.g. export NIX_MIRRORS_sourceforge=http://osdn.dl.sourceforge.net/sourceforge/ @@ -339,9 +277,7 @@ export NIX_MIRRORS_sourceforge=http://osdn.dl.sourceforge.net/sourceforge/ - The following people contributed to this release: Andres Löh, Arie - Middelkoop, Armijn Hemel, Eelco Dolstra, Marc Weber, Mart Kolthof, Martin - Bravenboer, Michael Raskin, Wouter den Breejen and Yury G. Kudryashov. + The following people contributed to this release: Andres Löh, Arie Middelkoop, Armijn Hemel, Eelco Dolstra, Marc Weber, Mart Kolthof, Martin Bravenboer, Michael Raskin, Wouter den Breejen and Yury G. Kudryashov.
@@ -349,10 +285,8 @@ export NIX_MIRRORS_sourceforge=http://osdn.dl.sourceforge.net/sourceforge/ - This release of Nixpkgs requires - Nix 0.10 - or higher. + This release of Nixpkgs requires Nix 0.10 or higher. @@ -363,32 +297,15 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10 - pkgs/system/all-packages-generic.nix is gone, we now - just have pkgs/top-level/all-packages.nix that - contains all available packages. This should cause much less confusion - with users. all-packages.nix is a function that by - default returns packages for the current platform, but you can override - this by specifying a different system argument. + pkgs/system/all-packages-generic.nix is gone, we now just have pkgs/top-level/all-packages.nix that contains all available packages. This should cause much less confusion with users. all-packages.nix is a function that by default returns packages for the current platform, but you can override this by specifying a different system argument. - Certain packages in Nixpkgs are now user-configurable through a - configuration file, i.e., without having to edit the Nix expressions in - Nixpkgs. For instance, the Firefox provided in the Nixpkgs channel is - built without the RealPlayer plugin (for legal reasons). Previously, you - could easily enable RealPlayer support by editing the call to the Firefox - function in all-packages.nix, but such changes are - not respected when Firefox is subsequently updated through the Nixpkgs - channel. + Certain packages in Nixpkgs are now user-configurable through a configuration file, i.e., without having to edit the Nix expressions in Nixpkgs. For instance, the Firefox provided in the Nixpkgs channel is built without the RealPlayer plugin (for legal reasons). Previously, you could easily enable RealPlayer support by editing the call to the Firefox function in all-packages.nix, but such changes are not respected when Firefox is subsequently updated through the Nixpkgs channel. - The Nixpkgs configuration file (found in - ~/.nixpkgs/config.nix or through the - NIXPKGS_CONFIG environment variable) is an attribute set - that contains configuration options that - all-packages.nix reads and uses for certain packages. - For instance, the following configuration file: + The Nixpkgs configuration file (found in ~/.nixpkgs/config.nix or through the NIXPKGS_CONFIG environment variable) is an attribute set that contains configuration options that all-packages.nix reads and uses for certain packages. For instance, the following configuration file: { firefox = { @@ -398,9 +315,7 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10 persistently enables RealPlayer support in the Firefox build. - (Actually, firefox.enableRealPlayer is the - only configuration option currently available, but - more are sure to be added.) + (Actually, firefox.enableRealPlayer is the only configuration option currently available, but more are sure to be added.) @@ -409,17 +324,8 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10 - i686-cygwin, i.e., Windows (using - Cygwin). The standard - environment on i686-cygwin by default builds - binaries for the Cygwin environment (i.e., it uses Cygwin tools and - produces executables that use the Cygwin library). However, there is - also a standard environment that produces binaries that use - MinGW. You can - use it by calling all-package.nix with the - stdenvType argument set to - "i686-mingw". + i686-cygwin, i.e., Windows (using Cygwin). The standard environment on i686-cygwin by default builds binaries for the Cygwin environment (i.e., it uses Cygwin tools and produces executables that use the Cygwin library). However, there is also a standard environment that produces binaries that use MinGW. You can use it by calling all-package.nix with the stdenvType argument set to "i686-mingw". @@ -434,9 +340,7 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10 - x86_64-linux, i.e., Linux on 64-bit AMD/Intel CPUs. - Unlike i686-linux, this platform doesn’t have a - pure stdenv yet. + x86_64-linux, i.e., Linux on 64-bit AMD/Intel CPUs. Unlike i686-linux, this platform doesn’t have a pure stdenv yet. @@ -472,21 +376,10 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix 0.10 - It is now much easier to override the default C - compiler and other tools in stdenv for specific - packages. all-packages.nix provides two utility - functions for this purpose: overrideGCC and - overrideInStdenv. Both take a - stdenv and return an augmented - stdenv; the formed changes the C compiler, and the - latter adds additional packages to the front of - stdenv’s initial PATH, allowing tools - to be overridden. + It is now much easier to override the default C compiler and other tools in stdenv for specific packages. all-packages.nix provides two utility functions for this purpose: overrideGCC and overrideInStdenv. Both take a stdenv and return an augmented stdenv; the formed changes the C compiler, and the latter adds additional packages to the front of stdenv’s initial PATH, allowing tools to be overridden. - For instance, the package strategoxt doesn’t build - with the GNU Make in stdenv (version 3.81), so we call - it with an augmented stdenv that uses GNU Make 3.80: + For instance, the package strategoxt doesn’t build with the GNU Make in stdenv (version 3.81), so we call it with an augmented stdenv that uses GNU Make 3.80: strategoxt = (import ../development/compilers/strategoxt) { inherit fetchurl pkgconfig sdf aterm; @@ -494,8 +387,7 @@ strategoxt = (import ../development/compilers/strategoxt) { }; gnumake380 = ...; - Likewise, there are many packages that don’t compile with the default - GCC (4.1.1), but that’s easily fixed: + Likewise, there are many packages that don’t compile with the default GCC (4.1.1), but that’s easily fixed: exult = import ../games/exult { inherit fetchurl SDL SDL_mixer zlib libpng unzip; @@ -505,13 +397,7 @@ exult = import ../games/exult { - It has also become much easier to experiment with changes to the - stdenv setup script (which notably contains the generic - builder). Since edits to pkgs/stdenv/generic/setup.sh - trigger a rebuild of everything, this was formerly - quite painful. But now stdenv contains a function to - “regenerate” stdenv with a different setup script, - allowing the use of a different setup script for specific packages: + It has also become much easier to experiment with changes to the stdenv setup script (which notably contains the generic builder). Since edits to pkgs/stdenv/generic/setup.sh trigger a rebuild of everything, this was formerly quite painful. But now stdenv contains a function to “regenerate” stdenv with a different setup script, allowing the use of a different setup script for specific packages: pkg = import ... { stdenv = stdenv.regenerate ./my-setup.sh; @@ -521,10 +407,7 @@ pkg = import ... { - Packages can now have a human-readable description - field. Package descriptions are shown by nix-env -qa - --description. In addition, they’re shown on the Nixpkgs - release page. A description can be added to a package as follows: + Packages can now have a human-readable description field. Package descriptions are shown by nix-env -qa --description. In addition, they’re shown on the Nixpkgs release page. A description can be added to a package as follows: stdenv.mkDerivation { name = "exult-1.2"; @@ -533,34 +416,26 @@ stdenv.mkDerivation { description = "A reimplementation of the Ultima VII game engine"; }; } - The meta attribute is not passed to the builder, so - changes to the description do not trigger a rebuild. Additional - meta attributes may be defined in the future (such as - the URL of the package’s homepage, the license, etc.). + The meta attribute is not passed to the builder, so changes to the description do not trigger a rebuild. Additional meta attributes may be defined in the future (such as the URL of the package’s homepage, the license, etc.). - The following people contributed to this release: Andres Löh, Armijn Hemel, - Christof Douma, Eelco Dolstra, Eelco Visser, Mart Kolthof, Martin - Bravenboer, Merijn de Jonge, Rob Vermaas and Roy van den Broek. + The following people contributed to this release: Andres Löh, Armijn Hemel, Christof Douma, Eelco Dolstra, Eelco Visser, Mart Kolthof, Martin Bravenboer, Merijn de Jonge, Rob Vermaas and Roy van den Broek.
Release 0.9 (January 31, 2006) - There have been zillions of changes since the last release of Nixpkgs. Many - packages have been added or updated. The following are some of the more - notable changes: + There have been zillions of changes since the last release of Nixpkgs. Many packages have been added or updated. The following are some of the more notable changes: - Distribution files have been moved to - . @@ -576,24 +451,17 @@ stdenv.mkDerivation { - The old, unofficial Xlibs has been replaced by the official modularised - X11 distribution from X.org, i.e., X11R7.0. X11R7.0 consists of 287 (!) - packages, all of which are in Nixpkgs though not all have been tested. It - is now possible to build a working X server (previously we only had X - client libraries). We use a fully Nixified X server on NixOS. + The old, unofficial Xlibs has been replaced by the official modularised X11 distribution from X.org, i.e., X11R7.0. X11R7.0 consists of 287 (!) packages, all of which are in Nixpkgs though not all have been tested. It is now possible to build a working X server (previously we only had X client libraries). We use a fully Nixified X server on NixOS. - The Sun JDK 5 has been purified, i.e., it doesn’t require any non-Nix - components such as /lib/ld-linux.so.2. This means - that Java applications such as Eclipse and Azureus can run on NixOS. + The Sun JDK 5 has been purified, i.e., it doesn’t require any non-Nix components such as /lib/ld-linux.so.2. This means that Java applications such as Eclipse and Azureus can run on NixOS. - Hardware-accelerated OpenGL support, used by games like Quake 3 (which is - now built from source). + Hardware-accelerated OpenGL support, used by games like Quake 3 (which is now built from source). @@ -608,8 +476,7 @@ stdenv.mkDerivation { - Some support for cross-compilation: cross-compiling builds of GCC and - Binutils, and cross-compiled builds of the C library uClibc. + Some support for cross-compilation: cross-compiling builds of GCC and Binutils, and cross-compiled builds of the C library uClibc. @@ -618,8 +485,7 @@ stdenv.mkDerivation { - teTeX, including support for building LaTeX documents using Nix (with - automatic dependency determination). + teTeX, including support for building LaTeX documents using Nix (with automatic dependency determination). @@ -629,14 +495,12 @@ stdenv.mkDerivation { - System-level packages to support NixOS, e.g. Grub, GNU - parted and so on. + System-level packages to support NixOS, e.g. Grub, GNU parted and so on. - ecj, the Eclipse Compiler for Java, so we finally - have a freely distributable compiler that supports Java 5.0. + ecj, the Eclipse Compiler for Java, so we finally have a freely distributable compiler that supports Java 5.0. @@ -661,8 +525,7 @@ stdenv.mkDerivation { - kdelibs. This allows us to add KDE-based packages - (such as kcachegrind). + kdelibs. This allows us to add KDE-based packages (such as kcachegrind). @@ -671,17 +534,14 @@ stdenv.mkDerivation { - The following people contributed to this release: Andres Löh, Armijn Hemel, - Bogdan Dumitriu, Christof Douma, Eelco Dolstra, Eelco Visser, Mart Kolthof, - Martin Bravenboer, Rob Vermaas and Roy van den Broek. + The following people contributed to this release: Andres Löh, Armijn Hemel, Bogdan Dumitriu, Christof Douma, Eelco Dolstra, Eelco Visser, Mart Kolthof, Martin Bravenboer, Rob Vermaas and Roy van den Broek.
Release 0.8 (April 11, 2005) - This release is mostly to remain synchronised with the changed hashing - scheme in Nix 0.8. + This release is mostly to remain synchronised with the changed hashing scheme in Nix 0.8. @@ -706,16 +566,10 @@ stdenv.mkDerivation { - The bootstrap process for the standard build environment on Linux - (stdenv-linux) has been improved. It is no longer dependent in its initial - bootstrap stages on the system Glibc, GCC, and other tools. Rather, - Nixpkgs contains a statically linked bash and curl, and uses that to - download other statically linked tools. These are then used to build a - Glibc and dynamically linked versions of all other tools. + The bootstrap process for the standard build environment on Linux (stdenv-linux) has been improved. It is no longer dependent in its initial bootstrap stages on the system Glibc, GCC, and other tools. Rather, Nixpkgs contains a statically linked bash and curl, and uses that to download other statically linked tools. These are then used to build a Glibc and dynamically linked versions of all other tools. - This change also makes the bootstrap process faster. For instance, GCC is - built only once instead of three times. + This change also makes the bootstrap process faster. For instance, GCC is built only once instead of three times. (Contributed by Armijn Hemel.) @@ -723,17 +577,13 @@ stdenv.mkDerivation { - Tarballs used by Nixpkgs are now obtained from the same server that hosts - Nixpkgs (). This - reduces the risk of packages being unbuildable due to moved or deleted - files on various servers. + Tarballs used by Nixpkgs are now obtained from the same server that hosts Nixpkgs (). This reduces the risk of packages being unbuildable due to moved or deleted files on various servers. - There now is a generic mechanism for building Perl modules. See the - various Perl modules defined in pkgs/system/all-packages-generic.nix. + There now is a generic mechanism for building Perl modules. See the various Perl modules defined in pkgs/system/all-packages-generic.nix. diff --git a/doc/reviewing-contributions.xml b/doc/reviewing-contributions.xml index 5aa950625efa..5a14684f9b1e 100644 --- a/doc/reviewing-contributions.xml +++ b/doc/reviewing-contributions.xml @@ -6,68 +6,40 @@ Reviewing contributions - The following section is a draft, and the policy for reviewing is still - being discussed in issues such as - #11166 - and - #20836 - . + The following section is a draft, and the policy for reviewing is still being discussed in issues such as #11166 and #20836 . - The Nixpkgs project receives a fairly high number of contributions via GitHub - pull requests. Reviewing and approving these is an important task and a way - to contribute to the project. + The Nixpkgs project receives a fairly high number of contributions via GitHub pull requests. Reviewing and approving these is an important task and a way to contribute to the project. - The high change rate of Nixpkgs makes any pull request that remains open for - too long subject to conflicts that will require extra work from the submitter - or the merger. Reviewing pull requests in a timely manner and being - responsive to the comments is the key to avoid this issue. GitHub provides - sort filters that can be used to see the - most - recently and the - least - recently updated pull requests. We highly encourage looking at - - this list of ready to merge, unreviewed pull requests. + The high change rate of Nixpkgs makes any pull request that remains open for too long subject to conflicts that will require extra work from the submitter or the merger. Reviewing pull requests in a timely manner and being responsive to the comments is the key to avoid this issue. GitHub provides sort filters that can be used to see the most recently and the least recently updated pull requests. We highly encourage looking at this list of ready to merge, unreviewed pull requests. - When reviewing a pull request, please always be nice and polite. - Controversial changes can lead to controversial opinions, but it is important - to respect every community member and their work. + When reviewing a pull request, please always be nice and polite. Controversial changes can lead to controversial opinions, but it is important to respect every community member and their work. - GitHub provides reactions as a simple and quick way to provide feedback to - pull requests or any comments. The thumb-down reaction should be used with - care and if possible accompanied with some explanation so the submitter has - directions to improve their contribution. + GitHub provides reactions as a simple and quick way to provide feedback to pull requests or any comments. The thumb-down reaction should be used with care and if possible accompanied with some explanation so the submitter has directions to improve their contribution. - pull request reviews should include a list of what has been reviewed in a - comment, so other reviewers and mergers can know the state of the review. + pull request reviews should include a list of what has been reviewed in a comment, so other reviewers and mergers can know the state of the review. - All the review template samples provided in this section are generic and - meant as examples. Their usage is optional and the reviewer is free to adapt - them to their liking. + All the review template samples provided in this section are generic and meant as examples. Their usage is optional and the reviewer is free to adapt them to their liking.
Package updates - A package update is the most trivial and common type of pull request. These - pull requests mainly consist of updating the version part of the package - name and the source hash. + A package update is the most trivial and common type of pull request. These pull requests mainly consist of updating the version part of the package name and the source hash. - It can happen that non-trivial updates include patches or more complex - changes. + It can happen that non-trivial updates include patches or more complex changes. @@ -82,8 +54,7 @@ - 8.has: package (update) and any topic label that fit - the updated package. + 8.has: package (update) and any topic label that fit the updated package. @@ -105,9 +76,7 @@ - CODEOWNERS - will make GitHub notify users based on the submitted changes, but it can - happen that it misses some of the package maintainers. + CODEOWNERS will make GitHub notify users based on the submitted changes, but it can happen that it misses some of the package maintainers. @@ -119,15 +88,12 @@ - License can change with version updates, so it should be checked to - match the upstream license. + License can change with version updates, so it should be checked to match the upstream license. - If the package has no maintainer, a maintainer must be set. This can be - the update submitter or a community member that accepts to take - maintainership of the package. + If the package has no maintainer, a maintainer must be set. This can be the update submitter or a community member that accepts to take maintainership of the package. @@ -144,14 +110,10 @@ - pull requests are often targeted to the master or staging branch, and - building the pull request locally when it is submitted can trigger many - source builds. + pull requests are often targeted to the master or staging branch, and building the pull request locally when it is submitted can trigger many source builds. - 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. $ git remote add channels https://github.com/NixOS/nixpkgs-channels.git @@ -163,8 +125,7 @@ - This should be done only once to be able to fetch channel branches - from the nixpkgs-channels repository. + This should be done only once to be able to fetch channel branches from the nixpkgs-channels repository. @@ -174,9 +135,7 @@ - Fetching the pull request changes, PRNUMBER is the - number at the end of the pull request title and - BASEBRANCH the base branch of the pull request. + Fetching the pull request changes, PRNUMBER is the number at the end of the pull request title and BASEBRANCH the base branch of the pull request. @@ -189,12 +148,7 @@ - The - nix-review - tool can be used to review a pull request content in a single command. - PRNUMBER should be replaced by the number at the end - of the pull request title. You can also provide the full github pull - request url. + The nix-review tool can be used to review a pull request content in a single command. PRNUMBER should be replaced by the number at the end of the pull request title. You can also provide the full github pull request url. $ nix-shell -p nix-review --run "nix-review pr PRNUMBER" @@ -231,8 +185,7 @@ New packages - New packages are a common type of pull requests. These pull requests - consists in adding a new nix-expression for a package. + New packages are a common type of pull requests. These pull requests consists in adding a new nix-expression for a package. @@ -247,8 +200,7 @@ - 8.has: package (new) and any topic label that fit the - new package. + 8.has: package (new) and any topic label that fit the new package. @@ -280,8 +232,7 @@ - A maintainer must be set. This can be the package submitter or a - community member that accepts to take maintainership of the package. + A maintainer must be set. This can be the package submitter or a community member that accepts to take maintainership of the package. @@ -303,8 +254,7 @@ - The most appropriate function should be used (e.g. packages from GitHub - should use fetchFromGitHub). + The most appropriate function should be used (e.g. packages from GitHub should use fetchFromGitHub). @@ -351,8 +301,7 @@ Module updates - Module updates are submissions changing modules in some ways. These often - contains changes to the options or introduce new options. + Module updates are submissions changing modules in some ways. These often contains changes to the options or introduce new options. @@ -367,8 +316,7 @@ - 8.has: module (update) and any topic label that fit - the module. + 8.has: module (update) and any topic label that fit the module. @@ -380,9 +328,7 @@ - CODEOWNERS - will make GitHub notify users based on the submitted changes, but it can - happen that it misses some of the package maintainers. + CODEOWNERS will make GitHub notify users based on the submitted changes, but it can happen that it misses some of the package maintainers. @@ -399,9 +345,7 @@ - Type should be appropriate (string related types differs in their - merging capabilities, optionSet and - string types are deprecated). + Type should be appropriate (string related types differs in their merging capabilities, optionSet and string types are deprecated). @@ -418,23 +362,19 @@ - mkRenamedOptionModule and - mkAliasOptionModule functions provide way to make - option changes backward compatible. + mkRenamedOptionModule and mkAliasOptionModule functions provide way to make option changes backward compatible. - Ensure that removed options are declared with - mkRemovedOptionModule + Ensure that removed options are declared with mkRemovedOptionModule - Ensure that changes that are not backward compatible are mentioned in - release notes. + Ensure that changes that are not backward compatible are mentioned in release notes. @@ -480,8 +420,7 @@ - 8.has: module (new) and any topic label that fit the - module. + 8.has: module (new) and any topic label that fit the module. @@ -498,9 +437,7 @@ - Type should be appropriate (string related types differs in their - merging capabilities, optionSet and - string types are deprecated). + Type should be appropriate (string related types differs in their merging capabilities, optionSet and string types are deprecated). @@ -522,8 +459,7 @@ - Module documentation should be declared with - meta.doc. + Module documentation should be declared with meta.doc. @@ -535,8 +471,7 @@ - For example, enabling a module should not open firewall ports by - default. + For example, enabling a module should not open firewall ports by default. @@ -573,25 +508,18 @@ - If you consider having enough knowledge and experience in a topic and would - like to be a long-term reviewer for related submissions, please contact the - current reviewers for that topic. They will give you information about the - reviewing process. The main reviewers for a topic can be hard to find as - there is no list, but checking past pull requests to see who reviewed or - git-blaming the code to see who committed to that topic can give some hints. + If you consider having enough knowledge and experience in a topic and would like to be a long-term reviewer for related submissions, please contact the current reviewers for that topic. They will give you information about the reviewing process. The main reviewers for a topic can be hard to find as there is no list, but checking past pull requests to see who reviewed or git-blaming the code to see who committed to that topic can give some hints. - Container system, boot system and library changes are some examples of the - pull requests fitting this category. + Container system, boot system and library changes are some examples of the pull requests fitting this category.
Merging pull requests - It is possible for community members that have enough knowledge and - experience on a special topic to contribute by merging pull requests. + It is possible for community members that have enough knowledge and experience on a special topic to contribute by merging pull requests. @@ -608,12 +536,8 @@ policy. --> - In a case a contributor definitively leaves the Nix community, they should - create an issue or post on - Discourse with - references of packages and modules they maintain so the maintainership can - be taken over by other contributors. + In a case a contributor definitively leaves the Nix community, they should create an issue or post on Discourse with references of packages and modules they maintain so the maintainership can be taken over by other contributors.
diff --git a/doc/stdenv.xml b/doc/stdenv.xml index a4bc2809be05..5495ce29ce31 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -3,22 +3,13 @@ xml:id="chap-stdenv"> The Standard Environment - The standard build environment in the Nix Packages collection provides an - environment for building Unix packages that does a lot of common build tasks - automatically. In fact, for Unix packages that use the standard - ./configure; make; make install build interface, you - don’t need to write a build script at all; the standard environment does - everything automatically. If stdenv doesn’t do what you - need automatically, you can easily customise or override the various build - phases. + The standard build environment in the Nix Packages collection provides an environment for building Unix packages that does a lot of common build tasks automatically. In fact, for Unix packages that use the standard ./configure; make; make install build interface, you don’t need to write a build script at all; the standard environment does everything automatically. If stdenv doesn’t do what you need automatically, you can easily customise or override the various build phases.
Using <literal>stdenv</literal> - To build a package with the standard environment, you use the function - stdenv.mkDerivation, instead of the primitive built-in - function derivation, e.g. + To build a package with the standard environment, you use the function stdenv.mkDerivation, instead of the primitive built-in function derivation, e.g. stdenv.mkDerivation { name = "libfoo-1.2.3"; @@ -27,17 +18,7 @@ stdenv.mkDerivation { sha256 = "0x2g1jqygyr5wiwg4ma1nd7w4ydpy82z9gkcv8vh2v8dn3y58v5m"; }; } - (stdenv needs to be in scope, so if you write this in a - separate Nix expression from pkgs/all-packages.nix, you - need to pass it as a function argument.) Specifying a - name and a src is the absolute minimum - Nix requires. For convenience, you can also use pname and - version attributes and mkDerivation - will automatically set name to - "${pname}-${version}" by default. Since - RFC 0035, - this is preferred for packages in Nixpkgs, as it allows us to reuse the - version easily: + (stdenv needs to be in scope, so if you write this in a separate Nix expression from pkgs/all-packages.nix, you need to pass it as a function argument.) Specifying a name and a src is the absolute minimum Nix requires. For convenience, you can also use pname and version attributes and mkDerivation will automatically set name to "${pname}-${version}" by default. Since RFC 0035, this is preferred for packages in Nixpkgs, as it allows us to reuse the version easily: stdenv.mkDerivation rec { pname = "libfoo"; @@ -50,31 +31,18 @@ stdenv.mkDerivation rec { - Many packages have dependencies that are not provided in the standard - environment. It’s usually sufficient to specify those dependencies in the - buildInputs attribute: + Many packages have dependencies that are not provided in the standard environment. It’s usually sufficient to specify those dependencies in the buildInputs attribute: stdenv.mkDerivation { name = "libfoo-1.2.3"; ... buildInputs = [libbar perl ncurses]; } - This attribute ensures that the bin subdirectories of - these packages appear in the PATH environment variable during - the build, that their include subdirectories are - searched by the C compiler, and so on. (See - for details.) + This attribute ensures that the bin subdirectories of these packages appear in the PATH environment variable during the build, that their include subdirectories are searched by the C compiler, and so on. (See for details.) - Often it is necessary to override or modify some aspect of the build. To - make this easier, the standard environment breaks the package build into a - number of phases, all of which can be overridden or - modified individually: unpacking the sources, applying patches, configuring, - building, and installing. (There are some others; see - .) For instance, a package that doesn’t - supply a makefile but instead has to be compiled “manually” could be - handled like this: + Often it is necessary to override or modify some aspect of the build. To make this easier, the standard environment breaks the package build into a number of phases, all of which can be overridden or modified individually: unpacking the sources, applying patches, configuring, building, and installing. (There are some others; see .) For instance, a package that doesn’t supply a makefile but instead has to be compiled “manually” could be handled like this: stdenv.mkDerivation { name = "fnord-4.5"; @@ -87,20 +55,15 @@ stdenv.mkDerivation { cp foo $out/bin ''; } - (Note the use of ''-style string literals, which are very - convenient for large multi-line script fragments because they don’t need - escaping of " and \, and because - indentation is intelligently removed.) + (Note the use of ''-style string literals, which are very convenient for large multi-line script fragments because they don’t need escaping of " and \, and because indentation is intelligently removed.) - There are many other attributes to customise the build. These are listed in - . + There are many other attributes to customise the build. These are listed in . - While the standard environment provides a generic builder, you can still - supply your own build script: + While the standard environment provides a generic builder, you can still supply your own build script: stdenv.mkDerivation { name = "libfoo-1.2.3"; @@ -111,9 +74,7 @@ stdenv.mkDerivation { source $stdenv/setup - to let stdenv set up the environment (e.g., process the - buildInputs). If you want, you can still use - stdenv’s generic builder: + to let stdenv set up the environment (e.g., process the buildInputs). If you want, you can still use stdenv’s generic builder: source $stdenv/setup @@ -179,23 +140,17 @@ genericBuild - gzip, bzip2 and - xz. + gzip, bzip2 and xz. - GNU Make. It has been patched to provide nested output - that can be fed into the nix-log2xml command and - log2html stylesheet to create a structured, readable - output of the build steps performed by Make. + GNU Make. It has been patched to provide nested output that can be fed into the nix-log2xml command and log2html stylesheet to create a structured, readable output of the build steps performed by Make. - Bash. This is the shell used for all builders in the Nix Packages - collection. Not using /bin/sh removes a large source - of portability problems. + Bash. This is the shell used for all builders in the Nix Packages collection. Not using /bin/sh removes a large source of portability problems. @@ -207,108 +162,52 @@ genericBuild - On Linux, stdenv also includes the - patchelf utility. + On Linux, stdenv also includes the patchelf utility.
Specifying dependencies - As described in the Nix manual, almost any *.drv store - path in a derivation's attribute set will induce a dependency on that - derivation. mkDerivation, however, takes a few attributes - intended to, between them, include all the dependencies of a package. This - is done both for structure and consistency, but also so that certain other - setup can take place. For example, certain dependencies need their bin - directories added to the PATH. That is built-in, but other - setup is done via a pluggable mechanism that works in conjunction with these - dependency attributes. See for details. + As described in the Nix manual, almost any *.drv store path in a derivation's attribute set will induce a dependency on that derivation. mkDerivation, however, takes a few attributes intended to, between them, include all the dependencies of a package. This is done both for structure and consistency, but also so that certain other setup can take place. For example, certain dependencies need their bin directories added to the PATH. That is built-in, but other setup is done via a pluggable mechanism that works in conjunction with these dependency attributes. See for details. - Dependencies can be broken down along three axes: their host and target - platforms relative to the new derivation's, and whether they are propagated. - The platform distinctions are motivated by cross compilation; see - for exactly what each platform means. + Dependencies can be broken down along three axes: their host and target platforms relative to the new derivation's, and whether they are propagated. The platform distinctions are motivated by cross compilation; see for exactly what each platform means. - The build platform is ignored because it is a mere implementation detail - of the package satisfying the dependency: As a general programming - principle, dependencies are always specified as - interfaces, not concrete implementation. + The build platform is ignored because it is a mere implementation detail of the package satisfying the dependency: As a general programming principle, dependencies are always specified as interfaces, not concrete implementation. - But even if one is not cross compiling, the platforms imply whether or not - the dependency is needed at run-time or build-time, a concept that makes - perfect sense outside of cross compilation. By default, the - run-time/build-time distinction is just a hint for mental clarity, but with - strictDeps set it is mostly enforced even in the native - case. + But even if one is not cross compiling, the platforms imply whether or not the dependency is needed at run-time or build-time, a concept that makes perfect sense outside of cross compilation. By default, the run-time/build-time distinction is just a hint for mental clarity, but with strictDeps set it is mostly enforced even in the native case. - The extension of PATH with dependencies, alluded to above, - proceeds according to the relative platforms alone. The process is carried - out only for dependencies whose host platform matches the new derivation's - build platform i.e. dependencies which run on the platform where the new - derivation will be built. + The extension of PATH with dependencies, alluded to above, proceeds according to the relative platforms alone. The process is carried out only for dependencies whose host platform matches the new derivation's build platform i.e. dependencies which run on the platform where the new derivation will be built. - Currently, this means for native builds all dependencies are put on the - PATH. But in the future that may not be the case for sake - of matching cross: the platforms would be assumed to be unique for native - and cross builds alike, so only the depsBuild* and - nativeBuildInputs would be added to the - PATH. + Currently, this means for native builds all dependencies are put on the PATH. But in the future that may not be the case for sake of matching cross: the platforms would be assumed to be unique for native and cross builds alike, so only the depsBuild* and nativeBuildInputs would be added to the PATH. - For each dependency dep of those dependencies, - dep/bin, if present, is - added to the PATH environment variable. + For each dependency dep of those dependencies, dep/bin, if present, is added to the PATH environment variable. - The dependency is propagated when it forces some of its other-transitive - (non-immediate) downstream dependencies to also take it on as an immediate - dependency. Nix itself already takes a package's transitive dependencies - into account, but this propagation ensures nixpkgs-specific infrastructure - like setup hooks (mentioned above) also are run as if the propagated - dependency. + The dependency is propagated when it forces some of its other-transitive (non-immediate) downstream dependencies to also take it on as an immediate dependency. Nix itself already takes a package's transitive dependencies into account, but this propagation ensures nixpkgs-specific infrastructure like setup hooks (mentioned above) also are run as if the propagated dependency. - It is important to note that dependencies are not necessarily propagated as - the same sort of dependency that they were before, but rather as the - corresponding sort so that the platform rules still line up. The exact rules - for dependency propagation can be given by assigning to each dependency two - integers based one how its host and target platforms are offset from the - depending derivation's platforms. Those offsets are given below in the - descriptions of each dependency list attribute. Algorithmically, we traverse - propagated inputs, accumulating every propagated dependency's propagated - dependencies and adjusting them to account for the "shift in perspective" - described by the current dependency's platform offsets. This results in sort - a transitive closure of the dependency relation, with the offsets being - approximately summed when two dependency links are combined. We also prune - transitive dependencies whose combined offsets go out-of-bounds, which can - be viewed as a filter over that transitive closure removing dependencies - that are blatantly absurd. + It is important to note that dependencies are not necessarily propagated as the same sort of dependency that they were before, but rather as the corresponding sort so that the platform rules still line up. The exact rules for dependency propagation can be given by assigning to each dependency two integers based one how its host and target platforms are offset from the depending derivation's platforms. Those offsets are given below in the descriptions of each dependency list attribute. Algorithmically, we traverse propagated inputs, accumulating every propagated dependency's propagated dependencies and adjusting them to account for the "shift in perspective" described by the current dependency's platform offsets. This results in sort a transitive closure of the dependency relation, with the offsets being approximately summed when two dependency links are combined. We also prune transitive dependencies whose combined offsets go out-of-bounds, which can be viewed as a filter over that transitive closure removing dependencies that are blatantly absurd. - We can define the process precisely with - Natural - Deduction using the inference rules. This probably seems a bit - obtuse, but so is the bash code that actually implements it! + We can define the process precisely with Natural Deduction using the inference rules. This probably seems a bit obtuse, but so is the bash code that actually implements it! - The findInputs function, currently residing in - pkgs/stdenv/generic/setup.sh, implements the - propagation logic. + The findInputs function, currently residing in pkgs/stdenv/generic/setup.sh, implements the propagation logic. - They're confusing in very different ways so... hopefully if something - doesn't make sense in one presentation, it will in the other! + They're confusing in very different ways so... hopefully if something doesn't make sense in one presentation, it will in the other! let mapOffset(h, t, i) = i + (if i <= 0 then h else t - 1) @@ -335,50 +234,22 @@ propagated-dep(mapOffset(h0, t0, h1), propagated-dep(h, t, A, B) ----------------------------- Propagated dependencies count as dependencies dep(h, t, A, B) - Some explanation of this monstrosity is in order. In the common case, the - target offset of a dependency is the successor to the target offset: - t = h + 1. That means that: + Some explanation of this monstrosity is in order. In the common case, the target offset of a dependency is the successor to the target offset: t = h + 1. That means that: let f(h, t, i) = i + (if i <= 0 then h else t - 1) let f(h, h + 1, i) = i + (if i <= 0 then h else (h + 1) - 1) let f(h, h + 1, i) = i + (if i <= 0 then h else h) let f(h, h + 1, i) = i + h - This is where "sum-like" comes in from above: We can just sum all of the - host offsets to get the host offset of the transitive dependency. The target - offset is the transitive dependency is simply the host offset + 1, just as - it was with the dependencies composed to make this transitive one; it can be - ignored as it doesn't add any new information. + This is where "sum-like" comes in from above: We can just sum all of the host offsets to get the host offset of the transitive dependency. The target offset is the transitive dependency is simply the host offset + 1, just as it was with the dependencies composed to make this transitive one; it can be ignored as it doesn't add any new information. - Because of the bounds checks, the uncommon cases are h = - t and h + 2 = t. In the former case, the - motivation for mapOffset is that since its host and - target platforms are the same, no transitive dependency of it should be able - to "discover" an offset greater than its reduced target offsets. - mapOffset effectively "squashes" all its transitive - dependencies' offsets so that none will ever be greater than the target - offset of the original h = t package. In the other case, - h + 1 is skipped over between the host and target - offsets. Instead of squashing the offsets, we need to "rip" them apart so no - transitive dependencies' offset is that one. + Because of the bounds checks, the uncommon cases are h = t and h + 2 = t. In the former case, the motivation for mapOffset is that since its host and target platforms are the same, no transitive dependency of it should be able to "discover" an offset greater than its reduced target offsets. mapOffset effectively "squashes" all its transitive dependencies' offsets so that none will ever be greater than the target offset of the original h = t package. In the other case, h + 1 is skipped over between the host and target offsets. Instead of squashing the offsets, we need to "rip" them apart so no transitive dependencies' offset is that one. - Overall, the unifying theme here is that propagation shouldn't be - introducing transitive dependencies involving platforms the depending - package is unaware of. [One can imagine the dependending package asking for - dependencies with the platforms it knows about; other platforms it doesn't - know how to ask for. The platform description in that scenario is a kind of - unforagable capability.] The offset bounds checking and definition of - mapOffset together ensure that this is the case. - Discovering a new offset is discovering a new platform, and since those - platforms weren't in the derivation "spec" of the needing package, they - cannot be relevant. From a capability perspective, we can imagine that the - host and target platforms of a package are the capabilities a package - requires, and the depending package must provide the capability to the - dependency. + Overall, the unifying theme here is that propagation shouldn't be introducing transitive dependencies involving platforms the depending package is unaware of. [One can imagine the dependending package asking for dependencies with the platforms it knows about; other platforms it doesn't know how to ask for. The platform description in that scenario is a kind of unforagable capability.] The offset bounds checking and definition of mapOffset together ensure that this is the case. Discovering a new offset is discovering a new platform, and since those platforms weren't in the derivation "spec" of the needing package, they cannot be relevant. From a capability perspective, we can imagine that the host and target platforms of a package are the capabilities a package requires, and the depending package must provide the capability to the dependency. @@ -389,23 +260,10 @@ let f(h, h + 1, i) = i + h - A list of dependencies whose host and target platforms are the new - derivation's build platform. This means a -1 host and - -1 target offset from the new derivation's platforms. - These are programs and libraries used at build time that produce programs - and libraries also used at build time. If the dependency doesn't care - about the target platform (i.e. isn't a compiler or similar tool), put it - in nativeBuildInputs instead. The most common use of - this buildPackages.stdenv.cc, the default C compiler - for this role. That example crops up more than one might think in old - commonly used C libraries. + A list of dependencies whose host and target platforms are the new derivation's build platform. This means a -1 host and -1 target offset from the new derivation's platforms. These are programs and libraries used at build time that produce programs and libraries also used at build time. If the dependency doesn't care about the target platform (i.e. isn't a compiler or similar tool), put it in nativeBuildInputs instead. The most common use of this buildPackages.stdenv.cc, the default C compiler for this role. That example crops up more than one might think in old commonly used C libraries. - Since these packages are able to be run at build-time, they are always - added to the PATH, as described above. But since these - packages are only guaranteed to be able to run then, they shouldn't - persist as run-time dependencies. This isn't currently enforced, but - could be in the future. + Since these packages are able to be run at build-time, they are always added to the PATH, as described above. But since these packages are only guaranteed to be able to run then, they shouldn't persist as run-time dependencies. This isn't currently enforced, but could be in the future. @@ -415,24 +273,10 @@ let f(h, h + 1, i) = i + h - A list of dependencies whose host platform is the new derivation's build - platform, and target platform is the new derivation's host platform. This - means a -1 host offset and 0 target - offset from the new derivation's platforms. These are programs and - libraries used at build-time that, if they are a compiler or similar - tool, produce code to run at run-time—i.e. tools used to build the new - derivation. If the dependency doesn't care about the target platform - (i.e. isn't a compiler or similar tool), put it here, rather than in - depsBuildBuild or depsBuildTarget. - This could be called depsBuildHost but - nativeBuildInputs is used for historical continuity. - - - Since these packages are able to be run at build-time, they are added to - the PATH, as described above. But since these packages are - only guaranteed to be able to run then, they shouldn't persist as - run-time dependencies. This isn't currently enforced, but could be in the - future. + A list of dependencies whose host platform is the new derivation's build platform, and target platform is the new derivation's host platform. This means a -1 host offset and 0 target offset from the new derivation's platforms. These are programs and libraries used at build-time that, if they are a compiler or similar tool, produce code to run at run-time—i.e. tools used to build the new derivation. If the dependency doesn't care about the target platform (i.e. isn't a compiler or similar tool), put it here, rather than in depsBuildBuild or depsBuildTarget. This could be called depsBuildHost but nativeBuildInputs is used for historical continuity. + + + Since these packages are able to be run at build-time, they are added to the PATH, as described above. But since these packages are only guaranteed to be able to run then, they shouldn't persist as run-time dependencies. This isn't currently enforced, but could be in the future. @@ -442,39 +286,13 @@ let f(h, h + 1, i) = i + h - A list of dependencies whose host platform is the new derivation's build - platform, and target platform is the new derivation's target platform. - This means a -1 host offset and 1 - target offset from the new derivation's platforms. These are programs - used at build time that produce code to run with code produced by the - depending package. Most commonly, these are tools used to build the - runtime or standard library that the currently-being-built compiler will - inject into any code it compiles. In many cases, the - currently-being-built-compiler is itself employed for that task, but when - that compiler won't run (i.e. its build and host platform differ) this is - not possible. Other times, the compiler relies on some other tool, like - binutils, that is always built separately so that the dependency is - unconditional. - - - This is a somewhat confusing concept to wrap one’s head around, and for - good reason. As the only dependency type where the platform offsets are - not adjacent integers, it requires thinking of a bootstrapping stage - two away from the current one. It and its use-case - go hand in hand and are both considered poor form: try to not need this - sort of dependency, and try to avoid building standard libraries and - runtimes in the same derivation as the compiler produces code using them. - Instead strive to build those like a normal library, using the - newly-built compiler just as a normal library would. In short, do not use - this attribute unless you are packaging a compiler and are sure it is - needed. - - - Since these packages are able to run at build time, they are added to the - PATH, as described above. But since these packages are - only guaranteed to be able to run then, they shouldn't persist as - run-time dependencies. This isn't currently enforced, but could be in the - future. + A list of dependencies whose host platform is the new derivation's build platform, and target platform is the new derivation's target platform. This means a -1 host offset and 1 target offset from the new derivation's platforms. These are programs used at build time that produce code to run with code produced by the depending package. Most commonly, these are tools used to build the runtime or standard library that the currently-being-built compiler will inject into any code it compiles. In many cases, the currently-being-built-compiler is itself employed for that task, but when that compiler won't run (i.e. its build and host platform differ) this is not possible. Other times, the compiler relies on some other tool, like binutils, that is always built separately so that the dependency is unconditional. + + + This is a somewhat confusing concept to wrap one’s head around, and for good reason. As the only dependency type where the platform offsets are not adjacent integers, it requires thinking of a bootstrapping stage two away from the current one. It and its use-case go hand in hand and are both considered poor form: try to not need this sort of dependency, and try to avoid building standard libraries and runtimes in the same derivation as the compiler produces code using them. Instead strive to build those like a normal library, using the newly-built compiler just as a normal library would. In short, do not use this attribute unless you are packaging a compiler and are sure it is needed. + + + Since these packages are able to run at build time, they are added to the PATH, as described above. But since these packages are only guaranteed to be able to run then, they shouldn't persist as run-time dependencies. This isn't currently enforced, but could be in the future. @@ -484,16 +302,7 @@ let f(h, h + 1, i) = i + h - A list of dependencies whose host and target platforms match the new - derivation's host platform. This means a 0 host offset - and 0 target offset from the new derivation's host - platform. These are packages used at run-time to generate code also used - at run-time. In practice, this would usually be tools used by compilers - for macros or a metaprogramming system, or libraries used by the macros - or metaprogramming code itself. It's always preferable to use a - depsBuildBuild dependency in the derivation being - built over a depsHostHost on the tool doing the - building for this purpose. + A list of dependencies whose host and target platforms match the new derivation's host platform. This means a 0 host offset and 0 target offset from the new derivation's host platform. These are packages used at run-time to generate code also used at run-time. In practice, this would usually be tools used by compilers for macros or a metaprogramming system, or libraries used by the macros or metaprogramming code itself. It's always preferable to use a depsBuildBuild dependency in the derivation being built over a depsHostHost on the tool doing the building for this purpose. @@ -503,21 +312,10 @@ let f(h, h + 1, i) = i + h - A list of dependencies whose host platform and target platform match the - new derivation's. This means a 0 host offset and a - 1 target offset from the new derivation's host - platform. This would be called depsHostTarget but for - historical continuity. If the dependency doesn't care about the target - platform (i.e. isn't a compiler or similar tool), put it here, rather - than in depsBuildBuild. + A list of dependencies whose host platform and target platform match the new derivation's. This means a 0 host offset and a 1 target offset from the new derivation's host platform. This would be called depsHostTarget but for historical continuity. If the dependency doesn't care about the target platform (i.e. isn't a compiler or similar tool), put it here, rather than in depsBuildBuild. - These are often programs and libraries used by the new derivation at - run-time, but that isn't always the case. For - example, the machine code in a statically-linked library is only used at - run-time, but the derivation containing the library is only needed at - build-time. Even in the dynamic case, the library may also be needed at - build-time to appease the linker. + These are often programs and libraries used by the new derivation at run-time, but that isn't always the case. For example, the machine code in a statically-linked library is only used at run-time, but the derivation containing the library is only needed at build-time. Even in the dynamic case, the library may also be needed at build-time to appease the linker. @@ -527,14 +325,7 @@ let f(h, h + 1, i) = i + h - A list of dependencies whose host platform matches the new derivation's - target platform. This means a 1 offset from the new - derivation's platforms. These are packages that run on the target - platform, e.g. the standard library or run-time deps of standard library - that a compiler insists on knowing about. It's poor form in almost all - cases for a package to depend on another from a future stage [future - stage corresponding to positive offset]. Do not use this attribute unless - you are packaging a compiler and are sure it is needed. + A list of dependencies whose host platform matches the new derivation's target platform. This means a 1 offset from the new derivation's platforms. These are packages that run on the target platform, e.g. the standard library or run-time deps of standard library that a compiler insists on knowing about. It's poor form in almost all cases for a package to depend on another from a future stage [future stage corresponding to positive offset]. Do not use this attribute unless you are packaging a compiler and are sure it is needed. @@ -544,9 +335,7 @@ let f(h, h + 1, i) = i + h - The propagated equivalent of depsBuildBuild. This - perhaps never ought to be used, but it is included for consistency [see - below for the others]. + The propagated equivalent of depsBuildBuild. This perhaps never ought to be used, but it is included for consistency [see below for the others]. @@ -556,18 +345,7 @@ let f(h, h + 1, i) = i + h - The propagated equivalent of nativeBuildInputs. This - would be called depsBuildHostPropagated but for - historical continuity. For example, if package Y has - propagatedNativeBuildInputs = [X], and package - Z has buildInputs = [Y], then - package Z will be built as if it included package - X in its nativeBuildInputs. If - instead, package Z has nativeBuildInputs = - [Y], then Z will be built as if it included - X in the depsBuildBuild of package - Z, because of the sum of the two -1 - host offsets. + The propagated equivalent of nativeBuildInputs. This would be called depsBuildHostPropagated but for historical continuity. For example, if package Y has propagatedNativeBuildInputs = [X], and package Z has buildInputs = [Y], then package Z will be built as if it included package X in its nativeBuildInputs. If instead, package Z has nativeBuildInputs = [Y], then Z will be built as if it included X in the depsBuildBuild of package Z, because of the sum of the two -1 host offsets. @@ -577,8 +355,7 @@ let f(h, h + 1, i) = i + h - The propagated equivalent of depsBuildTarget. This is - prefixed for the same reason of alerting potential users. + The propagated equivalent of depsBuildTarget. This is prefixed for the same reason of alerting potential users. @@ -598,9 +375,7 @@ let f(h, h + 1, i) = i + h - The propagated equivalent of buildInputs. This would - be called depsHostTargetPropagated but for historical - continuity. + The propagated equivalent of buildInputs. This would be called depsHostTargetPropagated but for historical continuity. @@ -610,8 +385,7 @@ let f(h, h + 1, i) = i + h - The propagated equivalent of depsTargetTarget. This is - prefixed for the same reason of alerting potential users. + The propagated equivalent of depsTargetTarget. This is prefixed for the same reason of alerting potential users. @@ -628,15 +402,7 @@ let f(h, h + 1, i) = i + h - A natural number indicating how much information to log. If set to 1 or - higher, stdenv will print moderate debugging - information during the build. In particular, the gcc - and ld wrapper scripts will print out the complete - command line passed to the wrapped tools. If set to 6 or higher, the - stdenv setup script will be run with set - -x tracing. If set to 7 or higher, the gcc - and ld wrapper scripts will also be run with - set -x tracing. + A natural number indicating how much information to log. If set to 1 or higher, stdenv will print moderate debugging information during the build. In particular, the gcc and ld wrapper scripts will print out the complete command line passed to the wrapped tools. If set to 6 or higher, the stdenv setup script will be run with set -x tracing. If set to 7 or higher, the gcc and ld wrapper scripts will also be run with set -x tracing. @@ -650,15 +416,10 @@ let f(h, h + 1, i) = i + h - If set to true, stdenv will pass - specific flags to make and other build tools to enable - parallel building with up to build-cores workers. + If set to true, stdenv will pass specific flags to make and other build tools to enable parallel building with up to build-cores workers. - Unless set to false, some build systems with good - support for parallel building including cmake, - meson, and qmake will set it to - true. + Unless set to false, some build systems with good support for parallel building including cmake, meson, and qmake will set it to true. @@ -672,8 +433,7 @@ let f(h, h + 1, i) = i + h - This is an attribute set which can be filled with arbitrary values. For - example: + This is an attribute set which can be filled with arbitrary values. For example: passthru = { foo = "bar"; @@ -685,17 +445,7 @@ passthru = { - Values inside it are not passed to the builder, so you can change them - without triggering a rebuild. However, they can be accessed outside of a - derivation directly, as if they were set inside a derivation itself, e.g. - hello.baz.value1. We don't specify any usage or schema - of passthru - it is meant for values that would be - useful outside the derivation in other parts of a Nix expression (e.g. in - other derivations). An example would be to convey some specific - dependency of your derivation which contains a program with plugins - support. Later, others who make derivations with plugins can use - passed-through dependency to ensure that their plugin would be - binary-compatible with built program. + Values inside it are not passed to the builder, so you can change them without triggering a rebuild. However, they can be accessed outside of a derivation directly, as if they were set inside a derivation itself, e.g. hello.baz.value1. We don't specify any usage or schema of passthru - it is meant for values that would be useful outside the derivation in other parts of a Nix expression (e.g. in other derivations). An example would be to convey some specific dependency of your derivation which contains a program with plugins support. Later, others who make derivations with plugins can use passed-through dependency to ensure that their plugin would be binary-compatible with built program. @@ -705,9 +455,7 @@ passthru = { - A script to be run by maintainers/scripts/update.nix - when the package is matched. It needs to be an executable file, either on - the file system: + A script to be run by maintainers/scripts/update.nix when the package is matched. It needs to be an executable file, either on the file system: passthru.updateScript = ./update.sh; @@ -723,21 +471,16 @@ passthru.updateScript = writeScript "update-zoom-us" '' update-source-version zoom-us "$version" ''; - The attribute can also contain a list, a script followed by arguments to - be passed to it: + The attribute can also contain a list, a script followed by arguments to be passed to it: passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ]; - The script will be usually run from the root of the Nixpkgs repository - but you should not rely on that. Also note that the update scripts will - be run in parallel by default; you should avoid running git - commit or any other commands that cannot handle that. + The script will be usually run from the root of the Nixpkgs repository but you should not rely on that. Also note that the update scripts will be run in parallel by default; you should avoid running git commit or any other commands that cannot handle that. - For information about how to run the updates, execute nix-shell - maintainers/scripts/update.nix. + For information about how to run the updates, execute nix-shell maintainers/scripts/update.nix. @@ -747,33 +490,18 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] Phases - The generic builder has a number of phases. Package - builds are split into phases to make it easier to override specific parts of - the build (e.g., unpacking the sources or installing the binaries). - Furthermore, it allows a nicer presentation of build logs in the Nix build - farm. + The generic builder has a number of phases. Package builds are split into phases to make it easier to override specific parts of the build (e.g., unpacking the sources or installing the binaries). Furthermore, it allows a nicer presentation of build logs in the Nix build farm. - Each phase can be overridden in its entirety either by setting the - environment variable namePhase - to a string containing some shell commands to be executed, or by redefining - the shell function namePhase. - The former is convenient to override a phase from the derivation, while the - latter is convenient from a build script. However, typically one only wants - to add some commands to a phase, e.g. by defining - postInstall or preFixup, as skipping - some of the default actions may have unexpected consequences. The default - script for each phase is defined in the file - pkgs/stdenv/generic/setup.sh. + Each phase can be overridden in its entirety either by setting the environment variable namePhase to a string containing some shell commands to be executed, or by redefining the shell function namePhase. The former is convenient to override a phase from the derivation, while the latter is convenient from a build script. However, typically one only wants to add some commands to a phase, e.g. by defining postInstall or preFixup, as skipping some of the default actions may have unexpected consequences. The default script for each phase is defined in the file pkgs/stdenv/generic/setup.sh.
Controlling phases - There are a number of variables that control what phases are executed and - in what order: + There are a number of variables that control what phases are executed and in what order: Variables affecting phase control @@ -782,19 +510,10 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - Specifies the phases. You can change the order in which phases are - executed, or add new phases, by setting this variable. If it’s not - set, the default value is used, which is $prePhases - unpackPhase patchPhase $preConfigurePhases configurePhase - $preBuildPhases buildPhase checkPhase $preInstallPhases installPhase - fixupPhase installCheckPhase $preDistPhases distPhase - $postPhases. + Specifies the phases. You can change the order in which phases are executed, or add new phases, by setting this variable. If it’s not set, the default value is used, which is $prePhases unpackPhase patchPhase $preConfigurePhases configurePhase $preBuildPhases buildPhase checkPhase $preInstallPhases installPhase fixupPhase installCheckPhase $preDistPhases distPhase $postPhases. - Usually, if you just want to add a few phases, it’s more convenient - to set one of the variables below (such as - preInstallPhases), as you then don’t specify all - the normal phases. + Usually, if you just want to add a few phases, it’s more convenient to set one of the variables below (such as preInstallPhases), as you then don’t specify all the normal phases. @@ -876,11 +595,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] The unpack phase - The unpack phase is responsible for unpacking the source code of the - package. The default implementation of unpackPhase - unpacks the source files listed in the src environment - variable to the current directory. It supports the following files by - default: + The unpack phase is responsible for unpacking the source code of the package. The default implementation of unpackPhase unpacks the source files listed in the src environment variable to the current directory. It supports the following files by default: @@ -888,13 +603,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - These can optionally be compressed using gzip - (.tar.gz, .tgz or - .tar.Z), bzip2 - (.tar.bz2, .tbz2 or - .tbz) or xz - (.tar.xz, .tar.lzma or - .txz). + These can optionally be compressed using gzip (.tar.gz, .tgz or .tar.Z), bzip2 (.tar.bz2, .tbz2 or .tbz) or xz (.tar.xz, .tar.lzma or .txz). @@ -904,9 +613,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - Zip files are unpacked using unzip. However, - unzip is not in the standard environment, so you - should add it to nativeBuildInputs yourself. + Zip files are unpacked using unzip. However, unzip is not in the standard environment, so you should add it to nativeBuildInputs yourself. @@ -916,16 +623,12 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - These are simply copied to the current directory. The hash part of the - file name is stripped, e.g. - /nix/store/1wydxgby13cz...-my-sources would be - copied to my-sources. + These are simply copied to the current directory. The hash part of the file name is stripped, e.g. /nix/store/1wydxgby13cz...-my-sources would be copied to my-sources. - Additional file types can be supported by setting the - unpackCmd variable (see below). + Additional file types can be supported by setting the unpackCmd variable (see below). @@ -938,8 +641,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - The list of source files or directories to be unpacked or copied. One of - these must be set. + The list of source files or directories to be unpacked or copied. One of these must be set. @@ -949,10 +651,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - After running unpackPhase, the generic builder - changes the current directory to the directory created by unpacking the - sources. If there are multiple source directories, you should set - sourceRoot to the name of the intended directory. + After running unpackPhase, the generic builder changes the current directory to the directory created by unpacking the sources. If there are multiple source directories, you should set sourceRoot to the name of the intended directory. @@ -962,10 +661,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - Alternatively to setting sourceRoot, you can set - setSourceRoot to a shell command to be evaluated by - the unpack phase after the sources have been unpacked. This command must - set sourceRoot. + Alternatively to setting sourceRoot, you can set setSourceRoot to a shell command to be evaluated by the unpack phase after the sources have been unpacked. This command must set sourceRoot. @@ -1005,10 +701,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - If set to 1, the unpacked sources are - not made writable. By default, they are made - writable to prevent problems with read-only sources. For example, copied - store directories would be read-only without this. + If set to 1, the unpacked sources are not made writable. By default, they are made writable to prevent problems with read-only sources. For example, copied store directories would be read-only without this. @@ -1018,9 +711,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - The unpack phase evaluates the string $unpackCmd for - any unrecognised file. The path to the current source file is contained - in the curSrc variable. + The unpack phase evaluates the string $unpackCmd for any unrecognised file. The path to the current source file is contained in the curSrc variable. @@ -1031,8 +722,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] The patch phase - The patch phase applies the list of patches defined in the - patches variable. + The patch phase applies the list of patches defined in the patches variable. @@ -1043,11 +733,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - The list of patches. They must be in the format accepted by the - patch command, and may optionally be compressed using - gzip (.gz), - bzip2 (.bz2) or - xz (.xz). + The list of patches. They must be in the format accepted by the patch command, and may optionally be compressed using gzip (.gz), bzip2 (.bz2) or xz (.xz). @@ -1057,9 +743,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - Flags to be passed to patch. If not set, the argument - is used, which causes the leading directory - component to be stripped from the file names in each patch. + Flags to be passed to patch. If not set, the argument is used, which causes the leading directory component to be stripped from the file names in each patch. @@ -1090,9 +774,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] The configure phase - The configure phase prepares the source tree for building. The default - configurePhase runs ./configure - (typically an Autoconf-generated script) if it exists. + The configure phase prepares the source tree for building. The default configurePhase runs ./configure (typically an Autoconf-generated script) if it exists. @@ -1103,10 +785,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - The name of the configure script. It defaults to - ./configure if it exists; otherwise, the configure - phase is skipped. This can actually be a command (like perl - ./Configure.pl). + The name of the configure script. It defaults to ./configure if it exists; otherwise, the configure phase is skipped. This can actually be a command (like perl ./Configure.pl). @@ -1116,8 +795,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - A list of strings passed as additional arguments to the configure - script. + A list of strings passed as additional arguments to the configure script. @@ -1137,9 +815,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - A shell array containing additional arguments passed to the configure - script. You must use this instead of configureFlags - if the arguments contain spaces. + A shell array containing additional arguments passed to the configure script. You must use this instead of configureFlags if the arguments contain spaces. @@ -1149,8 +825,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - By default, the flag --prefix=$prefix is added to the - configure flags. If this is undesirable, set this variable to true. + By default, the flag --prefix=$prefix is added to the configure flags. If this is undesirable, set this variable to true. @@ -1160,9 +835,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - The prefix under which the package must be installed, passed via the - option to the configure script. It defaults to - . + The prefix under which the package must be installed, passed via the option to the configure script. It defaults to . @@ -1172,8 +845,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - The key to use when specifying the prefix. By default, this is set to - as that is used by the majority of packages. + The key to use when specifying the prefix. By default, this is set to as that is used by the majority of packages. @@ -1183,9 +855,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - By default, the flag --disable-dependency-tracking is - added to the configure flags to speed up Automake-based builds. If this - is undesirable, set this variable to true. + By default, the flag --disable-dependency-tracking is added to the configure flags to speed up Automake-based builds. If this is undesirable, set this variable to true. @@ -1195,15 +865,10 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - By default, the configure phase applies some special hackery to all - files called ltmain.sh before running the configure - script in order to improve the purity of Libtool-based packages + By default, the configure phase applies some special hackery to all files called ltmain.sh before running the configure script in order to improve the purity of Libtool-based packages - It clears the - sys_lib_*search_path - variables in the Libtool script to prevent Libtool from using - libraries in /usr/lib and such. + It clears the sys_lib_*search_path variables in the Libtool script to prevent Libtool from using libraries in /usr/lib and such. . If this is undesirable, set this variable to true. @@ -1216,9 +881,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - By default, when the configure script has - , the option - is added to the configure flags. + By default, when the configure script has , the option is added to the configure flags. If this is undesirable, set this variable to true. @@ -1231,16 +894,10 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - By default, when cross compiling, the configure script has - and passed. - Packages can instead pass [ "build" "host" "target" ] - or a subset to control exactly which platform flags are passed. - Compilers and other tools can use this to also pass the target platform. + By default, when cross compiling, the configure script has and passed. Packages can instead pass [ "build" "host" "target" ] or a subset to control exactly which platform flags are passed. Compilers and other tools can use this to also pass the target platform. - Eventually these will be passed building natively as well, to improve - determinism: build-time guessing, as is done today, is a risk of - impurity. + Eventually these will be passed building natively as well, to improve determinism: build-time guessing, as is done today, is a risk of impurity. @@ -1273,12 +930,7 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] The build phase - The build phase is responsible for actually building the package (e.g. - compiling it). The default buildPhase simply calls - make if a file named Makefile, - makefile or GNUmakefile exists in - the current directory (or the makefile is explicitly - set); otherwise it does nothing. + The build phase is responsible for actually building the package (e.g. compiling it). The default buildPhase simply calls make if a file named Makefile, makefile or GNUmakefile exists in the current directory (or the makefile is explicitly set); otherwise it does nothing. @@ -1309,17 +961,13 @@ passthru.updateScript = [ ../../update.sh pname "--requested-release=unstable" ] - A list of strings passed as additional flags to make. - These flags are also used by the default install and check phase. For - setting make flags specific to the build phase, use - buildFlags (see below). + A list of strings passed as additional flags to make. These flags are also used by the default install and check phase. For setting make flags specific to the build phase, use buildFlags (see below). makeFlags = [ "PREFIX=$(out)" ]; - The flags are quoted in bash, but environment variables can be - specified by using the make syntax. + The flags are quoted in bash, but environment variables can be specified by using the make syntax. @@ -1331,18 +979,13 @@ makeFlags = [ "PREFIX=$(out)" ]; - A shell array containing additional arguments passed to - make. You must use this instead of - makeFlags if the arguments contain spaces, e.g. + A shell array containing additional arguments passed to make. You must use this instead of makeFlags if the arguments contain spaces, e.g. preBuild = '' makeFlagsArray+=(CFLAGS="-O0 -g" LDFLAGS="-lfoo -lbar") ''; - Note that shell arrays cannot be passed through environment variables, - so you cannot set makeFlagsArray in a derivation - attribute (because those are passed through environment variables): you - have to define them in shell code. + Note that shell arrays cannot be passed through environment variables, so you cannot set makeFlagsArray in a derivation attribute (because those are passed through environment variables): you have to define them in shell code. @@ -1352,9 +995,7 @@ preBuild = '' - A list of strings passed as additional flags to make. - Like makeFlags and makeFlagsArray, - but only used by the build phase. + A list of strings passed as additional flags to make. Like makeFlags and makeFlagsArray, but only used by the build phase. @@ -1381,14 +1022,11 @@ preBuild = '' - You can set flags for make through the - makeFlags variable. + You can set flags for make through the makeFlags variable. - Before and after running make, the hooks - preBuild and postBuild are called, - respectively. + Before and after running make, the hooks preBuild and postBuild are called, respectively.
@@ -1396,10 +1034,7 @@ preBuild = '' The check phase - The check phase checks whether the package was built correctly by running - its test suite. The default checkPhase calls - make check, but only if the doCheck - variable is enabled. + The check phase checks whether the package was built correctly by running its test suite. The default checkPhase calls make check, but only if the doCheck variable is enabled. @@ -1410,14 +1045,9 @@ preBuild = '' - Controls whether the check phase is executed. By default it is skipped, - but if doCheck is set to true, the check phase is - usually executed. Thus you should set + Controls whether the check phase is executed. By default it is skipped, but if doCheck is set to true, the check phase is usually executed. Thus you should set doCheck = true; - in the derivation to enable checks. The exception is cross compilation. - Cross compiled builds never run tests, no matter how - doCheck is set, as the newly-built program won't run - on the platform used to build it. + in the derivation to enable checks. The exception is cross compilation. Cross compiled builds never run tests, no matter how doCheck is set, as the newly-built program won't run on the platform used to build it. @@ -1437,8 +1067,7 @@ preBuild = '' - The make target that runs the tests. Defaults to - check. + The make target that runs the tests. Defaults to check. @@ -1448,9 +1077,7 @@ preBuild = '' - A list of strings passed as additional flags to make. - Like makeFlags and makeFlagsArray, - but only used by the check phase. + A list of strings passed as additional flags to make. Like makeFlags and makeFlagsArray, but only used by the check phase. @@ -1460,9 +1087,7 @@ preBuild = '' - A list of dependencies used by the phase. This gets included in - nativeBuildInputs when doCheck is - set. + A list of dependencies used by the phase. This gets included in nativeBuildInputs when doCheck is set. @@ -1493,10 +1118,7 @@ preBuild = '' The install phase - The install phase is responsible for installing the package in the Nix - store under out. The default - installPhase creates the directory - $out and calls make install. + The install phase is responsible for installing the package in the Nix store under out. The default installPhase creates the directory $out and calls make install. @@ -1517,8 +1139,7 @@ preBuild = '' - The make targets that perform the installation. Defaults to - install. Example: + The make targets that perform the installation. Defaults to install. Example: installTargets = "install-bin install-doc"; @@ -1530,9 +1151,7 @@ installTargets = "install-bin install-doc"; - A list of strings passed as additional flags to make. - Like makeFlags and makeFlagsArray, - but only used by the install phase. + A list of strings passed as additional flags to make. Like makeFlags and makeFlagsArray, but only used by the install phase. @@ -1563,15 +1182,11 @@ installTargets = "install-bin install-doc"; The fixup phase - The fixup phase performs some (Nix-specific) post-processing actions on the - files installed under $out by the install phase. The - default fixupPhase does the following: + The fixup phase performs some (Nix-specific) post-processing actions on the files installed under $out by the install phase. The default fixupPhase does the following: - It moves the man/, doc/ and - info/ subdirectories of $out to - share/. + It moves the man/, doc/ and info/ subdirectories of $out to share/. @@ -1581,19 +1196,12 @@ installTargets = "install-bin install-doc"; - On Linux, it applies the patchelf command to ELF - executables and libraries to remove unused directories from the - RPATH in order to prevent unnecessary runtime - dependencies. + On Linux, it applies the patchelf command to ELF executables and libraries to remove unused directories from the RPATH in order to prevent unnecessary runtime dependencies. - It rewrites the interpreter paths of shell scripts to paths found in - PATH. E.g., /usr/bin/perl will be - rewritten to - /nix/store/some-perl/bin/perl - found in PATH. + It rewrites the interpreter paths of shell scripts to paths found in PATH. E.g., /usr/bin/perl will be rewritten to /nix/store/some-perl/bin/perl found in PATH. @@ -1617,8 +1225,7 @@ installTargets = "install-bin install-doc"; - If set, libraries and executables are not stripped. By default, they - are. + If set, libraries and executables are not stripped. By default, they are. @@ -1628,10 +1235,7 @@ installTargets = "install-bin install-doc"; - Like dontStrip, but only affects the - strip command targetting the package's host platform. - Useful when supporting cross compilation, but otherwise feel free to - ignore. + Like dontStrip, but only affects the strip command targetting the package's host platform. Useful when supporting cross compilation, but otherwise feel free to ignore. @@ -1641,10 +1245,7 @@ installTargets = "install-bin install-doc"; - Like dontStrip, but only affects the - strip command targetting the packages' target - platform. Useful when supporting cross compilation, but otherwise feel - free to ignore. + Like dontStrip, but only affects the strip command targetting the packages' target platform. Useful when supporting cross compilation, but otherwise feel free to ignore. @@ -1654,8 +1255,7 @@ installTargets = "install-bin install-doc"; - If set, files in $out/sbin are not moved to - $out/bin. By default, they are. + If set, files in $out/sbin are not moved to $out/bin. By default, they are. @@ -1665,10 +1265,7 @@ installTargets = "install-bin install-doc"; - List of directories to search for libraries and executables from which - all symbols should be stripped. By default, it’s - empty. Stripping all symbols is risky, since it may remove not just - debug symbols but also ELF information necessary for normal execution. + List of directories to search for libraries and executables from which all symbols should be stripped. By default, it’s empty. Stripping all symbols is risky, since it may remove not just debug symbols but also ELF information necessary for normal execution. @@ -1678,9 +1275,7 @@ installTargets = "install-bin install-doc"; - Flags passed to the strip command applied to the - files in the directories listed in stripAllList. - Defaults to (i.e. ). + Flags passed to the strip command applied to the files in the directories listed in stripAllList. Defaults to (i.e. ). @@ -1690,9 +1285,7 @@ installTargets = "install-bin install-doc"; - List of directories to search for libraries and executables from which - only debugging-related symbols should be stripped. It defaults to - lib bin sbin. + List of directories to search for libraries and executables from which only debugging-related symbols should be stripped. It defaults to lib bin sbin. @@ -1702,9 +1295,7 @@ installTargets = "install-bin install-doc"; - Flags passed to the strip command applied to the - files in the directories listed in stripDebugList. - Defaults to (i.e. ). + Flags passed to the strip command applied to the files in the directories listed in stripDebugList. Defaults to (i.e. ). @@ -1714,8 +1305,7 @@ installTargets = "install-bin install-doc"; - If set, the patchelf command is not used to remove - unnecessary RPATH entries. Only applies to Linux. + If set, the patchelf command is not used to remove unnecessary RPATH entries. Only applies to Linux. @@ -1725,8 +1315,7 @@ installTargets = "install-bin install-doc"; - If set, scripts starting with #! do not have their - interpreter paths rewritten to paths in the Nix store. + If set, scripts starting with #! do not have their interpreter paths rewritten to paths in the Nix store. @@ -1736,9 +1325,7 @@ installTargets = "install-bin install-doc"; - If set, libtool .la files associated with shared - libraries won't have their dependency_libs field - cleared. + If set, libtool .la files associated with shared libraries won't have their dependency_libs field cleared. @@ -1748,9 +1335,7 @@ installTargets = "install-bin install-doc"; - The list of directories that must be moved from - $out to $out/share. Defaults - to man doc info. + The list of directories that must be moved from $out to $out/share. Defaults to man doc info. @@ -1760,11 +1345,7 @@ installTargets = "install-bin install-doc"; - A package can export a setup - hook by setting this variable. The setup hook, if defined, is - copied to $out/nix-support/setup-hook. Environment - variables are then substituted in it using - setup hook by setting this variable. The setup hook, if defined, is copied to $out/nix-support/setup-hook. Environment variables are then substituted in it using substituteAll. @@ -1795,25 +1376,14 @@ installTargets = "install-bin install-doc"; - If set to true, the standard environment will enable - debug information in C/C++ builds. After installation, the debug - information will be separated from the executables and stored in the - output named debug. (This output is enabled - automatically; you don’t need to set the outputs - attribute explicitly.) To be precise, the debug information is stored in - debug/lib/debug/.build-id/XX/YYYY…, - where XXYYYY… is the build - ID of the binary — a SHA-1 hash of the contents of the - binary. Debuggers like GDB use the build ID to look up the separated - debug information. + If set to true, the standard environment will enable debug information in C/C++ builds. After installation, the debug information will be separated from the executables and stored in the output named debug. (This output is enabled automatically; you don’t need to set the outputs attribute explicitly.) To be precise, the debug information is stored in debug/lib/debug/.build-id/XX/YYYY…, where XXYYYY… is the build ID of the binary — a SHA-1 hash of the contents of the binary. Debuggers like GDB use the build ID to look up the separated debug information. For example, with GDB, you can add set debug-file-directory ~/.nix-profile/lib/debug - to ~/.gdbinit. GDB will then be able to find debug - information installed via nix-env -i. + to ~/.gdbinit. GDB will then be able to find debug information installed via nix-env -i. @@ -1824,10 +1394,7 @@ set debug-file-directory ~/.nix-profile/lib/debug The installCheck phase - The installCheck phase checks whether the package was installed correctly - by running its test suite against the installed directories. The default - installCheck calls make - installcheck. + The installCheck phase checks whether the package was installed correctly by running its test suite against the installed directories. The default installCheck calls make installcheck. @@ -1838,14 +1405,9 @@ set debug-file-directory ~/.nix-profile/lib/debug - Controls whether the installCheck phase is executed. By default it is - skipped, but if doInstallCheck is set to true, the - installCheck phase is usually executed. Thus you should set + Controls whether the installCheck phase is executed. By default it is skipped, but if doInstallCheck is set to true, the installCheck phase is usually executed. Thus you should set doInstallCheck = true; - in the derivation to enable install checks. The exception is cross - compilation. Cross compiled builds never run tests, no matter how - doInstallCheck is set, as the newly-built program - won't run on the platform used to build it. + in the derivation to enable install checks. The exception is cross compilation. Cross compiled builds never run tests, no matter how doInstallCheck is set, as the newly-built program won't run on the platform used to build it. @@ -1855,8 +1417,7 @@ set debug-file-directory ~/.nix-profile/lib/debug - The make target that runs the install tests. Defaults to - installcheck. + The make target that runs the install tests. Defaults to installcheck. @@ -1866,9 +1427,7 @@ set debug-file-directory ~/.nix-profile/lib/debug - A list of strings passed as additional flags to make. - Like makeFlags and makeFlagsArray, - but only used by the installCheck phase. + A list of strings passed as additional flags to make. Like makeFlags and makeFlagsArray, but only used by the installCheck phase. @@ -1878,9 +1437,7 @@ set debug-file-directory ~/.nix-profile/lib/debug - A list of dependencies used by the phase. This gets included in - nativeBuildInputs when - doInstallCheck is set. + A list of dependencies used by the phase. This gets included in nativeBuildInputs when doInstallCheck is set. @@ -1911,11 +1468,7 @@ set debug-file-directory ~/.nix-profile/lib/debug The distribution phase - The distribution phase is intended to produce a source distribution of the - package. The default distPhase first calls - make dist, then it copies the resulting source tarballs - to $out/tarballs/. This phase is only executed if the - attribute doDist is set. + The distribution phase is intended to produce a source distribution of the package. The default distPhase first calls make dist, then it copies the resulting source tarballs to $out/tarballs/. This phase is only executed if the attribute doDist is set. @@ -1926,8 +1479,7 @@ set debug-file-directory ~/.nix-profile/lib/debug - The make target that produces the distribution. Defaults to - dist. + The make target that produces the distribution. Defaults to dist. @@ -1947,9 +1499,7 @@ set debug-file-directory ~/.nix-profile/lib/debug - The names of the source distribution files to be copied to - $out/tarballs/. It can contain shell wildcards. The - default is *.tar.gz. + The names of the source distribution files to be copied to $out/tarballs/. It can contain shell wildcards. The default is *.tar.gz. @@ -2000,8 +1550,7 @@ set debug-file-directory ~/.nix-profile/lib/debug - Constructs a wrapper for a program with various possible arguments. For - example: + Constructs a wrapper for a program with various possible arguments. For example: # adds `FOOBAR=baz` to `$out/bin/foo`’s environment makeWrapper $out/bin/foo $wrapperfile --set FOOBAR baz @@ -2011,12 +1560,10 @@ makeWrapper $out/bin/foo $wrapperfile --set FOOBAR baz # (via string replacements or in `configurePhase`). makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello git ]} - There’s many more kinds of arguments, they are documented in - nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh. + There’s many more kinds of arguments, they are documented in nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh. - wrapProgram is a convenience function you probably - want to use most of the time. + wrapProgram is a convenience function you probably want to use most of the time. @@ -2026,10 +1573,7 @@ makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello - Performs string substitution on the contents of - infile, writing the result to - outfile. The substitutions in - subs are of the following form: + Performs string substitution on the contents of infile, writing the result to outfile. The substitutions in subs are of the following form: @@ -2037,8 +1581,7 @@ makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello - Replace every occurrence of the string s1 - by s2. + Replace every occurrence of the string s1 by s2. @@ -2048,13 +1591,7 @@ makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello - Replace every occurrence of - @varName@ by the - contents of the environment variable - varName. This is useful for generating - files from templates, using - @...@ in the template - as placeholders. + Replace every occurrence of @varName@ by the contents of the environment variable varName. This is useful for generating files from templates, using @...@ in the template as placeholders. @@ -2064,9 +1601,7 @@ makeWrapper $out/bin/foo $wrapperfile --prefix PATH : ${lib.makeBinPath [ hello - Replace every occurrence of - @varName@ by the string - s. + Replace every occurrence of @varName@ by the string s. @@ -2082,14 +1617,8 @@ substitute ./foo.in ./foo.out \ - substitute is implemented using the - replace - command. Unlike with the sed command, you don’t have - to worry about escaping special characters. It supports performing - substitutions on binary files (such as executables), though there - you’ll probably want to make sure that the replacement string is as - long as the replaced string. + substitute is implemented using the replace command. Unlike with the sed command, you don’t have to worry about escaping special characters. It supports performing substitutions on binary files (such as executables), though there you’ll probably want to make sure that the replacement string is as long as the replaced string. @@ -2099,8 +1628,7 @@ substitute ./foo.in ./foo.out \ - Like substitute, but performs the substitutions in - place on the file file. + Like substitute, but performs the substitutions in place on the file file. @@ -2110,22 +1638,13 @@ substitute ./foo.in ./foo.out \ - Replaces every occurrence of - @varName@, where - varName is any environment variable, in - infile, writing the result to - outfile. For instance, if - infile has the contents + Replaces every occurrence of @varName@, where varName is any environment variable, in infile, writing the result to outfile. For instance, if infile has the contents #! @bash@/bin/sh PATH=@coreutils@/bin echo @foo@ - and the environment contains - bash=/nix/store/bmwp0q28cf21...-bash-3.2-p39 and - coreutils=/nix/store/68afga4khv0w...-coreutils-6.12, - but does not contain the variable foo, then the output - will be + and the environment contains bash=/nix/store/bmwp0q28cf21...-bash-3.2-p39 and coreutils=/nix/store/68afga4khv0w...-coreutils-6.12, but does not contain the variable foo, then the output will be #! /nix/store/bmwp0q28cf21...-bash-3.2-p39/bin/sh PATH=/nix/store/68afga4khv0w...-coreutils-6.12/bin @@ -2134,13 +1653,7 @@ echo @foo@ That is, no substitution is performed for undefined variables. - Environment variables that start with an uppercase letter or an - underscore are filtered out, to prevent global variables (like - HOME) or private variables (like - __ETC_PROFILE_DONE) from accidentally getting - substituted. The variables also have to be valid bash “names”, as - defined in the bash manpage (alphanumeric or _, must - not start with a number). + Environment variables that start with an uppercase letter or an underscore are filtered out, to prevent global variables (like HOME) or private variables (like __ETC_PROFILE_DONE) from accidentally getting substituted. The variables also have to be valid bash “names”, as defined in the bash manpage (alphanumeric or _, must not start with a number). @@ -2150,8 +1663,7 @@ echo @foo@ - Like substituteAll, but performs the substitutions - in place on the file file. + Like substituteAll, but performs the substitutions in place on the file file. @@ -2161,14 +1673,12 @@ echo @foo@ - Strips the directory and hash part of a store path, outputting the name - part to stdout. For example: + Strips the directory and hash part of a store path, outputting the name part to stdout. For example: # prints coreutils-8.24 stripHash "/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24" - If you wish to store the result in another variable, then the following - idiom may be useful: + If you wish to store the result in another variable, then the following idiom may be useful: name="/nix/store/9s9r019176g7cvn2nvcw41gsp862y6b4-coreutils-8.24" someVar=$(stripHash $name) @@ -2182,13 +1692,10 @@ someVar=$(stripHash $name) - Convenience function for makeWrapper that - automatically creates a sane wrapper file It takes all the same arguments - as makeWrapper, except for --argv0. + Convenience function for makeWrapper that automatically creates a sane wrapper file It takes all the same arguments as makeWrapper, except for --argv0. - 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. @@ -2198,85 +1705,34 @@ someVar=$(stripHash $name) Package setup hooks - Nix itself considers a build-time dependency as merely something that should - previously be built and accessible at build time—packages themselves are - on their own to perform any additional setup. In most cases, that is fine, - and the downstream derivation can deal with its own dependencies. But for a - few common tasks, that would result in almost every package doing the same - sort of setup work—depending not on the package itself, but entirely on - which dependencies were used. + Nix itself considers a build-time dependency as merely something that should previously be built and accessible at build time—packages themselves are on their own to perform any additional setup. In most cases, that is fine, and the downstream derivation can deal with its own dependencies. But for a few common tasks, that would result in almost every package doing the same sort of setup work—depending not on the package itself, but entirely on which dependencies were used. - In order to alleviate this burden, the setup hook - mechanism was written, where any package can include a shell script that [by - convention rather than enforcement by Nix], any downstream - reverse-dependency will source as part of its build process. That allows the - downstream dependency to merely specify its dependencies, and lets those - dependencies effectively initialize themselves. No boilerplate mirroring the - list of dependencies is needed. + In order to alleviate this burden, the setup hook mechanism was written, where any package can include a shell script that [by convention rather than enforcement by Nix], any downstream reverse-dependency will source as part of its build process. That allows the downstream dependency to merely specify its dependencies, and lets those dependencies effectively initialize themselves. No boilerplate mirroring the list of dependencies is needed. - The setup hook mechanism is a bit of a sledgehammer though: a powerful - feature with a broad and indiscriminate area of effect. The combination of - its power and implicit use may be expedient, but isn't without costs. Nix - itself is unchanged, but the spirit of added dependencies being effect-free - is violated even if the letter isn't. For example, if a derivation path is - mentioned more than once, Nix itself doesn't care and simply makes sure the - dependency derivation is already built just the same—depending is just - needing something to exist, and needing is idempotent. However, a dependency - specified twice will have its setup hook run twice, and that could easily - change the build environment (though a well-written setup hook will - therefore strive to be idempotent so this is in fact not observable). More - broadly, setup hooks are anti-modular in that multiple dependencies, whether - the same or different, should not interfere and yet their setup hooks may - well do so. + The setup hook mechanism is a bit of a sledgehammer though: a powerful feature with a broad and indiscriminate area of effect. The combination of its power and implicit use may be expedient, but isn't without costs. Nix itself is unchanged, but the spirit of added dependencies being effect-free is violated even if the letter isn't. For example, if a derivation path is mentioned more than once, Nix itself doesn't care and simply makes sure the dependency derivation is already built just the same—depending is just needing something to exist, and needing is idempotent. However, a dependency specified twice will have its setup hook run twice, and that could easily change the build environment (though a well-written setup hook will therefore strive to be idempotent so this is in fact not observable). More broadly, setup hooks are anti-modular in that multiple dependencies, whether the same or different, should not interfere and yet their setup hooks may well do so. - 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 - envBuildBuildHooks`, envBuildHostHooks`, - envBuildTargetHooks`, envHostHostHooks`, - envHostTargetHooks`, or envTargetTargetHooks`. - 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 envBuildBuildHooks`, envBuildHostHooks`, envBuildTargetHooks`, envHostHostHooks`, envHostTargetHooks`, or envTargetTargetHooks`. 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). - Packages adding a hook should not hard code a specific hook, but rather - choose a variable relative to how they are included. - Returning to the C compiler wrapper example, if the wrapper itself is an - n dependency, then it only wants to accumulate flags from - n + 1 dependencies, as only those ones match the - compiler's target platform. The hostOffset variable is - defined with the current dependency's host offset - targetOffset with its target offset, before its setup hook is - sourced. Additionally, since most environment hooks don't care about the - target platform, that means the setup hook can append to the right bash - array by doing something like + Packages adding a hook should not hard code a specific hook, but rather choose a variable relative to how they are included. Returning to the C compiler wrapper example, if the wrapper itself is an n dependency, then it only wants to accumulate flags from n + 1 dependencies, as only those ones match the compiler's target platform. The hostOffset variable is defined with the current dependency's host offset targetOffset with its target offset, before its setup hook is sourced. Additionally, since most environment hooks don't care about the target platform, that means the setup hook can append to the right bash array by doing something like addEnvHooks "$hostOffset" myBashFunction - The existence of setups hooks has long been documented - and packages inside Nixpkgs are free to use this mechanism. Other packages, - however, should not rely on these mechanisms not changing between Nixpkgs - versions. Because of the existing issues with this system, there's little - benefit from mandating it be stable for any period of time. + The existence of setups hooks has long been documented and packages inside Nixpkgs are free to use this mechanism. Other packages, however, should not rely on these mechanisms not changing between Nixpkgs versions. Because of the existing issues with this system, there's little benefit from mandating it be stable for any period of time. - First, let’s cover some setup hooks that are part of Nixpkgs default - stdenv. This means that they are run for every package built using - stdenv.mkDerivation. Some of these are platform - specific, so they may run on Linux but not Darwin or vice-versa. + First, let’s cover some setup hooks that are part of Nixpkgs default stdenv. This means that they are run for every package built using stdenv.mkDerivation. Some of these are platform specific, so they may run on Linux but not Darwin or vice-versa. @@ -2284,10 +1740,7 @@ addEnvHooks "$hostOffset" myBashFunction - This setup hook moves any installed documentation to the - /share subdirectory directory. This includes the man, - doc and info directories. This is needed for legacy programs that do not - know how to use the share subdirectory. + This setup hook moves any installed documentation to the /share subdirectory directory. This includes the man, doc and info directories. This is needed for legacy programs that do not know how to use the share subdirectory. @@ -2297,9 +1750,7 @@ addEnvHooks "$hostOffset" myBashFunction - This setup hook compresses any man pages that have been installed. The - compression is done using the gzip program. This helps to reduce the - installed size of packages. + This setup hook compresses any man pages that have been installed. The compression is done using the gzip program. This helps to reduce the installed size of packages. @@ -2309,9 +1760,7 @@ addEnvHooks "$hostOffset" myBashFunction - This runs the strip command on installed binaries and libraries. This - removes unnecessary information like debug symbols when they are not - needed. This also helps to reduce the installed size of packages. + This runs the strip command on installed binaries and libraries. This removes unnecessary information like debug symbols when they are not needed. This also helps to reduce the installed size of packages. @@ -2321,12 +1770,7 @@ addEnvHooks "$hostOffset" myBashFunction - This setup hook patches installed scripts to use the full path to the - shebang interpreter. A shebang interpreter is the first commented line - of a script telling the operating system which program will run the - script (e.g #!/bin/bash). In Nix, we want an exact - path to that interpreter to be used. This often replaces - /bin/sh with a path in the Nix store. + This setup hook patches installed scripts to use the full path to the shebang interpreter. A shebang interpreter is the first commented line of a script telling the operating system which program will run the script (e.g #!/bin/bash). In Nix, we want an exact path to that interpreter to be used. This often replaces /bin/sh with a path in the Nix store. @@ -2336,10 +1780,7 @@ addEnvHooks "$hostOffset" myBashFunction - This verifies that no references are left from the install binaries to - the directory used to build those binaries. This ensures that the - binaries do not need things outside the Nix store. This is currently - supported in Linux only. + This verifies that no references are left from the install binaries to the directory used to build those binaries. This ensures that the binaries do not need things outside the Nix store. This is currently supported in Linux only. @@ -2349,12 +1790,7 @@ addEnvHooks "$hostOffset" myBashFunction - This setup hook adds configure flags that tell packages to install files - into any one of the proper outputs listed in outputs. - This behavior can be turned off by setting - setOutputFlags to false in the derivation - environment. See for more - information. + This setup hook adds configure flags that tell packages to install files into any one of the proper outputs listed in outputs. This behavior can be turned off by setting setOutputFlags to false in the derivation environment. See for more information. @@ -2364,9 +1800,7 @@ addEnvHooks "$hostOffset" myBashFunction - This setup hook moves any binaries installed in the sbin subdirectory - into bin. In addition, a link is provided from sbin to bin for - compatibility. + This setup hook moves any binaries installed in the sbin subdirectory into bin. In addition, a link is provided from sbin to bin for compatibility. @@ -2376,9 +1810,7 @@ addEnvHooks "$hostOffset" myBashFunction - This setup hook moves any libraries installed in the lib64 subdirectory - into lib. In addition, a link is provided from lib64 to lib for - compatibility. + This setup hook moves any libraries installed in the lib64 subdirectory into lib. In addition, a link is provided from lib64 to lib for compatibility. @@ -2388,8 +1820,7 @@ addEnvHooks "$hostOffset" myBashFunction - This sets SOURCE_DATE_EPOCH to the modification time - of the most recent file. + This sets SOURCE_DATE_EPOCH to the modification time of the most recent file. @@ -2399,70 +1830,22 @@ addEnvHooks "$hostOffset" myBashFunction - The Bintools Wrapper wraps the binary utilities for a bunch of - miscellaneous purposes. These are GNU Binutils when targetting Linux, - and a mix of cctools and GNU binutils for Darwin. [The "Bintools" name - is supposed to be a compromise between "Binutils" and "cctools" not - denoting any specific implementation.] Specifically, the underlying - bintools package, and a C standard library (glibc or Darwin's libSystem, - just for the dynamic loader) are all fed in, and dependency finding, - hardening (see below), and purity checks for each are handled by the - Bintools Wrapper. Packages typically depend on CC Wrapper, which in turn - (at run time) depends on the Bintools Wrapper. - - - The Bintools Wrapper was only just recently split off from CC Wrapper, - so the division of labor is still being worked out. For example, it - shouldn't care about the C standard library, but just take a derivation - with the dynamic loader (which happens to be the glibc on linux). - Dependency finding however is a task both wrappers will continue to need - to share, and probably the most important to understand. It is currently - accomplished by collecting directories of host-platform dependencies - (i.e. buildInputs and - nativeBuildInputs) in environment variables. The - Bintools Wrapper's setup hook causes any lib and - lib64 subdirectories to be added to - NIX_LDFLAGS. Since the CC Wrapper and the Bintools - Wrapper use the same strategy, most of the Bintools Wrapper code is - sparsely commented and refers to the CC Wrapper. But the CC Wrapper's - code, by contrast, has quite lengthy comments. The Bintools Wrapper - merely cites those, rather than repeating them, to avoid falling out of - sync. - - - A final task of the setup hook is defining a number of standard - environment variables to tell build systems which executables fulfill - which purpose. They are defined to just be the base name of the tools, - under the assumption that the Bintools Wrapper's binaries will be on the - path. Firstly, this helps poorly-written packages, e.g. ones that look - for just gcc when CC isn't defined yet - clang is to be used. Secondly, this helps packages - not get confused when cross-compiling, in which case multiple Bintools - Wrappers may simultaneously be in use. + The Bintools Wrapper wraps the binary utilities for a bunch of miscellaneous purposes. These are GNU Binutils when targetting Linux, and a mix of cctools and GNU binutils for Darwin. [The "Bintools" name is supposed to be a compromise between "Binutils" and "cctools" not denoting any specific implementation.] Specifically, the underlying bintools package, and a C standard library (glibc or Darwin's libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by the Bintools Wrapper. Packages typically depend on CC Wrapper, which in turn (at run time) depends on the Bintools Wrapper. + + + The Bintools Wrapper was only just recently split off from CC Wrapper, so the division of labor is still being worked out. For example, it shouldn't care about the C standard library, but just take a derivation with the dynamic loader (which happens to be the glibc on linux). Dependency finding however is a task both wrappers will continue to need to share, and probably the most important to understand. It is currently accomplished by collecting directories of host-platform dependencies (i.e. buildInputs and nativeBuildInputs) in environment variables. The Bintools Wrapper's setup hook causes any lib and lib64 subdirectories to be added to NIX_LDFLAGS. Since the CC Wrapper and the Bintools Wrapper use the same strategy, most of the Bintools Wrapper code is sparsely commented and refers to the CC Wrapper. But the CC Wrapper's code, by contrast, has quite lengthy comments. The Bintools Wrapper merely cites those, rather than repeating them, to avoid falling out of sync. + + + A final task of the setup hook is defining a number of standard environment variables to tell build systems which executables fulfill which purpose. They are defined to just be the base name of the tools, under the assumption that the Bintools Wrapper's binaries will be on the path. Firstly, this helps poorly-written packages, e.g. ones that look for just gcc when CC isn't defined yet clang is to be used. Secondly, this helps packages not get confused when cross-compiling, in which case multiple Bintools Wrappers may simultaneously be in use. - Each wrapper targets a single platform, so if binaries for multiple - platforms are needed, the underlying binaries must be wrapped multiple - times. As this is a property of the wrapper itself, the multiple - wrappings are needed whether or not the same underlying binaries can - target multiple platforms. + Each wrapper targets a single platform, so if binaries for multiple platforms are needed, the underlying binaries must be wrapped multiple times. As this is a property of the wrapper itself, the multiple wrappings are needed whether or not the same underlying binaries can target multiple platforms. - BUILD_- and TARGET_-prefixed versions of - the normal environment variable are defined for additional Bintools - Wrappers, properly disambiguating them. + BUILD_- and TARGET_-prefixed versions of the normal environment variable are defined for additional Bintools Wrappers, properly disambiguating them. - A problem with this final task is that the Bintools Wrapper is honest - and defines LD as ld. Most packages, - however, firstly use the C compiler for linking, secondly use - LD anyways, defining it as the C compiler, and thirdly, - only so define LD when it is undefined as a fallback. - This triple-threat means Bintools Wrapper will break those packages, as - LD is already defined as the actual linker which the package won't - override yet doesn't want to use. The workaround is to define, just for - the problematic package, LD as the C compiler. A good way - to do this would be preConfigure = "LD=$CC". + A problem with this final task is that the Bintools Wrapper is honest and defines LD as ld. Most packages, however, firstly use the C compiler for linking, secondly use LD anyways, defining it as the C compiler, and thirdly, only so define LD when it is undefined as a fallback. This triple-threat means Bintools Wrapper will break those packages, as LD is already defined as the actual linker which the package won't override yet doesn't want to use. The workaround is to define, just for the problematic package, LD as the C compiler. A good way to do this would be preConfigure = "LD=$CC". @@ -2472,31 +1855,13 @@ addEnvHooks "$hostOffset" myBashFunction - The CC Wrapper wraps a C toolchain for a bunch of miscellaneous - purposes. Specifically, a C compiler (GCC or Clang), wrapped binary - tools, and a C standard library (glibc or Darwin's libSystem, just for - the dynamic loader) are all fed in, and dependency finding, hardening - (see below), and purity checks for each are handled by the CC Wrapper. - Packages typically depend on the CC Wrapper, which in turn (at run-time) - depends on the Bintools Wrapper. + The CC Wrapper wraps a C toolchain for a bunch of miscellaneous purposes. Specifically, a C compiler (GCC or Clang), wrapped binary tools, and a C standard library (glibc or Darwin's libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by the CC Wrapper. Packages typically depend on the CC Wrapper, which in turn (at run-time) depends on the Bintools Wrapper. - Dependency finding is undoubtedly the main task of the CC Wrapper. This - works just like the Bintools Wrapper, except that any - include subdirectory of any relevant dependency is - added to NIX_CFLAGS_COMPILE. The setup hook itself - contains some lengthy comments describing the exact convoluted mechanism - by which this is accomplished. + Dependency finding is undoubtedly the main task of the CC Wrapper. This works just like the Bintools Wrapper, except that any include subdirectory of any relevant dependency is added to NIX_CFLAGS_COMPILE. The setup hook itself contains some lengthy comments describing the exact convoluted mechanism by which this is accomplished. - Similarly, the CC Wrapper follows the Bintools Wrapper in defining - standard environment variables with the names of the tools it wraps, for - the same reasons described above. Importantly, while it includes a - cc symlink to the c compiler for portability, the - CC will be defined using the compiler's "real name" (i.e. - gcc or clang). This helps lousy - build systems that inspect on the name of the compiler rather than run - it. + Similarly, the CC Wrapper follows the Bintools Wrapper in defining standard environment variables with the names of the tools it wraps, for the same reasons described above. Importantly, while it includes a cc symlink to the c compiler for portability, the CC will be defined using the compiler's "real name" (i.e. gcc or clang). This helps lousy build systems that inspect on the name of the compiler rather than run it. @@ -2504,9 +1869,7 @@ addEnvHooks "$hostOffset" myBashFunction - 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, it might cover most uses. @@ -2514,11 +1877,7 @@ addEnvHooks "$hostOffset" myBashFunction - Adds the lib/site_perl subdirectory of each build - input to the PERL5LIB environment variable. For instance, - if buildInputs contains Perl, then the - lib/site_perl subdirectory of each input is added - to the PERL5LIB environment variable. + Adds the lib/site_perl subdirectory of each build input to the PERL5LIB environment variable. For instance, if buildInputs contains Perl, then the lib/site_perl subdirectory of each input is added to the PERL5LIB environment variable. @@ -2528,9 +1887,7 @@ addEnvHooks "$hostOffset" myBashFunction - Adds the lib/${python.libPrefix}/site-packages - subdirectory of each build input to the PYTHONPATH - environment variable. + Adds the lib/${python.libPrefix}/site-packages subdirectory of each build input to the PYTHONPATH environment variable. @@ -2540,9 +1897,7 @@ addEnvHooks "$hostOffset" myBashFunction - Adds the lib/pkgconfig and - share/pkgconfig subdirectories of each build input - to the PKG_CONFIG_PATH environment variable. + Adds the lib/pkgconfig and share/pkgconfig subdirectories of each build input to the PKG_CONFIG_PATH environment variable. @@ -2552,8 +1907,7 @@ addEnvHooks "$hostOffset" myBashFunction - Adds the share/aclocal subdirectory of each build - input to the ACLOCAL_PATH environment variable. + Adds the share/aclocal subdirectory of each build input to the ACLOCAL_PATH environment variable. @@ -2563,12 +1917,7 @@ addEnvHooks "$hostOffset" myBashFunction - The autoreconfHook derivation adds - autoreconfPhase, which runs autoreconf, libtoolize - and automake, essentially preparing the configure script in - autotools-based builds. Most autotools-based packages come with the - configure script pre-generated, but this hook is necessary for a few - packages and when you need to patch the package’s configure scripts. + The autoreconfHook derivation adds autoreconfPhase, which runs autoreconf, libtoolize and automake, essentially preparing the configure script in autotools-based builds. Most autotools-based packages come with the configure script pre-generated, but this hook is necessary for a few packages and when you need to patch the package’s configure scripts. @@ -2578,10 +1927,7 @@ addEnvHooks "$hostOffset" myBashFunction - Adds every file named catalog.xml found under the - xml/dtd and xml/xsl - subdirectories of each build input to the - XML_CATALOG_FILES environment variable. + Adds every file named catalog.xml found under the xml/dtd and xml/xsl subdirectories of each build input to the XML_CATALOG_FILES environment variable. @@ -2591,8 +1937,7 @@ addEnvHooks "$hostOffset" myBashFunction - Adds the share/texmf-nix subdirectory of each build - input to the TEXINPUTS environment variable. + Adds the share/texmf-nix subdirectory of each build input to the TEXINPUTS environment variable. @@ -2612,9 +1957,7 @@ addEnvHooks "$hostOffset" myBashFunction - Exports GDK_PIXBUF_MODULE_FILE environment variable to - the builder. Add librsvg package to buildInputs to - get svg support. + Exports GDK_PIXBUF_MODULE_FILE environment variable to the builder. Add librsvg package to buildInputs to get svg support. @@ -2624,8 +1967,7 @@ addEnvHooks "$hostOffset" myBashFunction - Creates a temporary package database and registers every Haskell build - input in it (TODO: how?). + Creates a temporary package database and registers every Haskell build input in it (TODO: how?). @@ -2635,8 +1977,7 @@ addEnvHooks "$hostOffset" myBashFunction - Hooks related to GNOME platform and related libraries like GLib, GTK and - GStreamer are described in . + Hooks related to GNOME platform and related libraries like GLib, GTK and GStreamer are described in . @@ -2646,15 +1987,10 @@ addEnvHooks "$hostOffset" myBashFunction - This is a special setup hook which helps in packaging proprietary - software in that it automatically tries to find missing shared library - dependencies of ELF files based on the given - buildInputs and nativeBuildInputs. + This is a special setup hook which helps in packaging proprietary software in that it automatically tries to find missing shared library dependencies of ELF files based on the given buildInputs and nativeBuildInputs. - You can also specify a runtimeDependencies environment - variable which lists dependencies that are unconditionally added to all - executables. + You can also specify a runtimeDependencies environment variable which lists dependencies that are unconditionally added to all executables. This is useful for programs that use @@ -2662,16 +1998,10 @@ addEnvHooks "$hostOffset" myBashFunction 3 to load libraries at runtime. - In certain situations you may want to run the main command - (autoPatchelf) of the setup hook on a file or a set - of directories instead of unconditionally patching all outputs. This can - be done by setting the dontAutoPatchelf environment - variable to a non-empty value. + In certain situations you may want to run the main command (autoPatchelf) of the setup hook on a file or a set of directories instead of unconditionally patching all outputs. This can be done by setting the dontAutoPatchelf environment variable to a non-empty value. - The autoPatchelf command also recognizes a - --no-recurse command line flag, - which prevents it from recursing into subdirectories. + The autoPatchelf command also recognizes a --no-recurse command line flag, which prevents it from recursing into subdirectories. @@ -2681,36 +2011,16 @@ addEnvHooks "$hostOffset" myBashFunction - This hook will make a build pause instead of stopping when a failure - happens. It prevents nix from cleaning up the build environment - immediately and allows the user to attach to a build environment using - the cntr command. Upon build error it will print - instructions on how to use cntr, which can be used to - enter the environment for debugging. Installing cntr and running the - command will provide shell access to the build sandbox of failed build. - At /var/lib/cntr the sandboxed filesystem is - mounted. All commands and files of the system are still accessible - within the shell. To execute commands from the sandbox use the cntr exec - subcommand. cntr is only supported on Linux-based - platforms. To use it first add cntr to your - environment.systemPackages on NixOS or alternatively - to the root user on non-NixOS systems. Then in the package that is - supposed to be inspected, add breakpointHook to - nativeBuildInputs. + This hook will make a build pause instead of stopping when a failure happens. It prevents nix from cleaning up the build environment immediately and allows the user to attach to a build environment using the cntr command. Upon build error it will print instructions on how to use cntr, which can be used to enter the environment for debugging. Installing cntr and running the command will provide shell access to the build sandbox of failed build. At /var/lib/cntr the sandboxed filesystem is mounted. All commands and files of the system are still accessible within the shell. To execute commands from the sandbox use the cntr exec subcommand. cntr is only supported on Linux-based platforms. To use it first add cntr to your environment.systemPackages on NixOS or alternatively to the root user on non-NixOS systems. Then in the package that is supposed to be inspected, add breakpointHook to nativeBuildInputs. nativeBuildInputs = [ breakpointHook ]; - When a build failure happens there will be an instruction printed that - shows how to attach with cntr to the build sandbox. + When a build failure happens there will be an instruction printed that shows how to attach with cntr to the build sandbox. Caution with remote builds - This won't work with remote builds as the build environment is on a - different machine and can't be accessed by cntr. - Remote builds can be turned off by setting --option builders - '' for nix-build or --builders - '' for nix build. + This won't work with remote builds as the build environment is on a different machine and can't be accessed by cntr. Remote builds can be turned off by setting --option builders '' for nix-build or --builders '' for nix build. @@ -2721,28 +2031,13 @@ nativeBuildInputs = [ breakpointHook ]; - This hook helps with installing manpages and shell completion files. It - exposes 2 shell functions installManPage and - installShellCompletion that can be used from your - postInstall hook. + This hook helps with installing manpages and shell completion files. It exposes 2 shell functions installManPage and installShellCompletion that can be used from your postInstall hook. - The installManPage function takes one or more paths - to manpages to install. The manpages must have a section suffix, and may - optionally be compressed (with .gz suffix). This - function will place them into the correct directory. + The installManPage function takes one or more paths to manpages to install. The manpages must have a section suffix, and may optionally be compressed (with .gz suffix). This function will place them into the correct directory. - The installShellCompletion function takes one or more - paths to shell completion files. By default it will autodetect the shell - type from the completion file extension, but you may also specify it by - passing one of --bash, --fish, or - --zsh. These flags apply to all paths listed after - them (up until another shell flag is given). Each path may also have a - custom installation name provided by providing a flag --name - NAME before the path. If this flag is not provided, zsh - completions will be renamed automatically such that - foobar.zsh becomes _foobar. + The installShellCompletion function takes one or more paths to shell completion files. By default it will autodetect the shell type from the completion file extension, but you may also specify it by passing one of --bash, --fish, or --zsh. These flags apply to all paths listed after them (up until another shell flag is given). Each path may also have a custom installation name provided by providing a flag --name NAME before the path. If this flag is not provided, zsh completions will be renamed automatically such that foobar.zsh becomes _foobar. nativeBuildInputs = [ installShellFiles ]; postInstall = '' @@ -2764,13 +2059,7 @@ postInstall = '' - A few libraries automatically add to NIX_LDFLAGS - their library, making their symbols automatically available to the - linker. This includes libiconv and libintl (gettext). This is done to - provide compatibility between GNU Linux, where libiconv and libintl are - bundled in, and other systems where that might not be the case. - Sometimes, this behavior is not desired. To disable this behavior, set - dontAddExtraLibs. + A few libraries automatically add to NIX_LDFLAGS their library, making their symbols automatically available to the linker. This includes libiconv and libintl (gettext). This is done to provide compatibility between GNU Linux, where libiconv and libintl are bundled in, and other systems where that might not be the case. Sometimes, this behavior is not desired. To disable this behavior, set dontAddExtraLibs. @@ -2780,16 +2069,7 @@ postInstall = '' - Overrides the default configure phase to run the CMake command. By - default, we use the Make generator of CMake. In addition, dependencies - are added automatically to CMAKE_PREFIX_PATH so that packages are - correctly detected by CMake. Some additional flags are passed in to give - similar behavior to configure-based packages. You can disable this - hook’s behavior by setting configurePhase to a custom value, or by - setting dontUseCmakeConfigure. cmakeFlags controls flags passed only to - CMake. By default, parallel building is enabled as CMake supports - parallel building almost everywhere. When Ninja is also in use, CMake - will detect that and use the ninja generator. + Overrides the default configure phase to run the CMake command. By default, we use the Make generator of CMake. In addition, dependencies are added automatically to CMAKE_PREFIX_PATH so that packages are correctly detected by CMake. Some additional flags are passed in to give similar behavior to configure-based packages. You can disable this hook’s behavior by setting configurePhase to a custom value, or by setting dontUseCmakeConfigure. cmakeFlags controls flags passed only to CMake. By default, parallel building is enabled as CMake supports parallel building almost everywhere. When Ninja is also in use, CMake will detect that and use the ninja generator. @@ -2799,11 +2079,7 @@ postInstall = '' - Overrides the build and install phases to run the “xcbuild” command. - This hook is needed when a project only comes with build files for the - XCode build system. You can disable this behavior by setting buildPhase - and configurePhase to a custom value. xcbuildFlags controls flags passed - only to xcbuild. + Overrides the build and install phases to run the “xcbuild” command. This hook is needed when a project only comes with build files for the XCode build system. You can disable this behavior by setting buildPhase and configurePhase to a custom value. xcbuildFlags controls flags passed only to xcbuild. @@ -2813,10 +2089,7 @@ postInstall = '' - Overrides the configure phase to run meson to generate Ninja files. To - run these files, you should accompany Meson with ninja. By default, - enableParallelBuilding is enabled as Meson supports - parallel building almost everywhere. + Overrides the configure phase to run meson to generate Ninja files. To run these files, you should accompany Meson with ninja. By default, enableParallelBuilding is enabled as Meson supports parallel building almost everywhere. Variables controlling Meson @@ -2836,10 +2109,8 @@ postInstall = '' - Which - --buildtype - to pass to Meson. We default to plain. + Which --buildtype to pass to Meson. We default to plain. @@ -2849,10 +2120,8 @@ postInstall = '' - What value to set - -Dauto_features= - to. We default to enabled. + What value to set -Dauto_features= to. We default to enabled. @@ -2862,11 +2131,8 @@ postInstall = '' - What value to set - -Dwrap_mode= - to. We default to nodownload as we disallow - network access. + What value to set -Dwrap_mode= to. We default to nodownload as we disallow network access. @@ -2889,10 +2155,7 @@ postInstall = '' - Overrides the build, install, and check phase to run ninja instead of - make. You can disable this behavior with the dontUseNinjaBuild, - dontUseNinjaInstall, and dontUseNinjaCheck, respectively. Parallel - building is enabled by default in Ninja. + Overrides the build, install, and check phase to run ninja instead of make. You can disable this behavior with the dontUseNinjaBuild, dontUseNinjaInstall, and dontUseNinjaCheck, respectively. Parallel building is enabled by default in Ninja. @@ -2902,8 +2165,7 @@ postInstall = '' - This setup hook will allow you to unzip .zip files specified in $src. - There are many similar packages like unrar, undmg, etc. + This setup hook will allow you to unzip .zip files specified in $src. There are many similar packages like unrar, undmg, etc. @@ -2913,10 +2175,7 @@ postInstall = '' - Overrides the configure, build, and install phases. This will run the - "waf" script used by many projects. If wafPath (default ./waf) doesn’t - exist, it will copy the version of waf available in Nixpkgs. wafFlags - can be used to pass flags to the waf script. + Overrides the configure, build, and install phases. This will run the "waf" script used by many projects. If wafPath (default ./waf) doesn’t exist, it will copy the version of waf available in Nixpkgs. wafFlags can be used to pass flags to the waf script. @@ -2926,9 +2185,7 @@ postInstall = '' - Overrides the build, install, and check phases. This uses the scons - build system as a replacement for make. scons does not provide a - configure phase, so everything is managed at build and install time. + Overrides the build, install, and check phases. This uses the scons build system as a replacement for make. scons does not provide a configure phase, so everything is managed at build and install time. @@ -2939,40 +2196,26 @@ postInstall = '' Purity in Nixpkgs - [measures taken to prevent dependencies on packages outside the store, and - what you can do to prevent them] + [measures taken to prevent dependencies on packages outside the store, and what you can do to prevent them] - GCC doesn't search in locations such as /usr/include. - In fact, attempts to add such directories through the - flag are filtered out. Likewise, the linker (from GNU binutils) doesn't - search in standard locations such as /usr/lib. Programs - built on Linux are linked against a GNU C Library that likewise doesn't - search in the default system locations. + GCC doesn't search in locations such as /usr/include. In fact, attempts to add such directories through the flag are filtered out. Likewise, the linker (from GNU binutils) doesn't search in standard locations such as /usr/lib. Programs built on Linux are linked against a GNU C Library that likewise doesn't search in the default system locations.
Hardening in Nixpkgs - There are flags available to harden packages at compile or link-time. These - can be toggled using the stdenv.mkDerivation parameters - hardeningDisable and hardeningEnable. + There are flags available to harden packages at compile or link-time. These can be toggled using the stdenv.mkDerivation parameters hardeningDisable and hardeningEnable. - Both parameters take a list of flags as strings. The special - "all" flag can be passed to - hardeningDisable to turn off all hardening. These flags - can also be used as environment variables for testing or development - purposes. + Both parameters take a list of flags as strings. The special "all" flag can be passed to hardeningDisable to turn off all hardening. These flags can also be used as environment variables for testing or development purposes. - The following flags are enabled by default and might require disabling with - hardeningDisable if the program to package is - incompatible. + The following flags are enabled by default and might require disabling with hardeningDisable if the program to package is incompatible. @@ -2982,13 +2225,7 @@ postInstall = '' - Adds the compiler options. At present, this warns - about calls to printf and scanf - functions where the format string is not a string literal and there are - no format arguments, as in printf(foo);. This may be a - security hole if the format string came from untrusted input and contains - %n. + Adds the compiler options. At present, this warns about calls to printf and scanf functions where the format string is not a string literal and there are no format arguments, as in printf(foo);. This may be a security hole if the format string came from untrusted input and contains %n. This needs to be turned off or fixed for errors similar to: @@ -3007,12 +2244,7 @@ cc1plus: some warnings being treated as errors - Adds the compiler options. This adds safety checks - against stack overwrites rendering many potential code injection attacks - into aborting situations. In the best case this turns code injection - vulnerabilities into denial of service or into non-issues (depending on - the application). + Adds the compiler options. This adds safety checks against stack overwrites rendering many potential code injection attacks into aborting situations. In the best case this turns code injection vulnerabilities into denial of service or into non-issues (depending on the application). This needs to be turned off or fixed for errors similar to: @@ -3029,19 +2261,10 @@ bin/blib.a(bios_console.o): In function `bios_handle_cup': - Adds the compiler options. - During code generation the compiler knows a great deal of information - about buffer sizes (where possible), and attempts to replace insecure - unlimited length buffer function calls with length-limited ones. This is - especially useful for old, crufty code. Additionally, format strings in - writable memory that contain '%n' are blocked. If an application depends - on such a format string, it will need to be worked around. + Adds the compiler options. During code generation the compiler knows a great deal of information about buffer sizes (where possible), and attempts to replace insecure unlimited length buffer function calls with length-limited ones. This is especially useful for old, crufty code. Additionally, format strings in writable memory that contain '%n' are blocked. If an application depends on such a format string, it will need to be worked around. - Additionally, some warnings are enabled which might trigger build - failures if compiler warnings are treated as errors in the package build. - In this case, set to - . + Additionally, some warnings are enabled which might trigger build failures if compiler warnings are treated as errors in the package build. In this case, set to . This needs to be turned off or fixed for errors similar to: @@ -3070,15 +2293,10 @@ fcntl2.h:50:4: error: call to '__open_missing_mode' declared with attribute erro - Adds the compiler options. This options adds - support for position independent code in shared libraries and thus making - ASLR possible. + Adds the compiler options. This options adds support for position independent code in shared libraries and thus making ASLR possible. - Most notably, the Linux kernel, kernel modules and other code not running - in an operating system environment like boot loaders won't build with PIC - enabled. The compiler will is most cases complain that PIC is not - supported for a specific build. + Most notably, the Linux kernel, kernel modules and other code not running in an operating system environment like boot loaders won't build with PIC enabled. The compiler will is most cases complain that PIC is not supported for a specific build. This needs to be turned off or fixed for assembler errors similar to: @@ -3095,13 +2313,7 @@ ccbLfRgg.s:33: Error: missing or invalid displacement expression `private_key_le - Signed integer overflow is undefined behaviour according to the C - standard. If it happens, it is an error in the program as it should check - for overflow before it can happen, not afterwards. GCC provides built-in - functions to perform arithmetic with overflow checking, which are correct - and faster than any custom implementation. As a workaround, the option - makes gcc behave as if signed - integer overflows were defined. + Signed integer overflow is undefined behaviour according to the C standard. If it happens, it is an error in the program as it should check for overflow before it can happen, not afterwards. GCC provides built-in functions to perform arithmetic with overflow checking, which are correct and faster than any custom implementation. As a workaround, the option makes gcc behave as if signed integer overflows were defined. This flag should not trigger any build or runtime errors. @@ -3114,18 +2326,10 @@ ccbLfRgg.s:33: Error: missing or invalid displacement expression `private_key_le - Adds the linker option. During program load, - several ELF memory sections need to be written to by the linker, but can - be turned read-only before turning over control to the program. This - prevents some GOT (and .dtors) overwrite attacks, but at least the part - of the GOT used by the dynamic linker (.got.plt) is still vulnerable. + Adds the linker option. During program load, several ELF memory sections need to be written to by the linker, but can be turned read-only before turning over control to the program. This prevents some GOT (and .dtors) overwrite attacks, but at least the part of the GOT used by the dynamic linker (.got.plt) is still vulnerable. - This flag can break dynamic shared object loading. For instance, the - module systems of Xorg and OpenCV are incompatible with this flag. In - almost all cases the bindnow flag must also be - disabled and incompatible programs typically fail with similar errors at - runtime. + This flag can break dynamic shared object loading. For instance, the module systems of Xorg and OpenCV are incompatible with this flag. In almost all cases the bindnow flag must also be disabled and incompatible programs typically fail with similar errors at runtime. @@ -3135,18 +2339,10 @@ ccbLfRgg.s:33: Error: missing or invalid displacement expression `private_key_le - Adds the linker option. During program load, - all dynamic symbols are resolved, allowing for the complete GOT to be - marked read-only (due to relro). This prevents GOT - overwrite attacks. For very large applications, this can incur some - performance loss during initial load while symbols are resolved, but this - shouldn't be an issue for daemons. + Adds the linker option. During program load, all dynamic symbols are resolved, allowing for the complete GOT to be marked read-only (due to relro). This prevents GOT overwrite attacks. For very large applications, this can incur some performance loss during initial load while symbols are resolved, but this shouldn't be an issue for daemons. - This flag can break dynamic shared object loading. For instance, the - module systems of Xorg and PHP are incompatible with this flag. Programs - incompatible with this flag often fail at runtime due to missing symbols, - like: + This flag can break dynamic shared object loading. For instance, the module systems of Xorg and PHP are incompatible with this flag. Programs incompatible with this flag often fail at runtime due to missing symbols, like: intel_drv.so: undefined symbol: vgaHWFreeHWRec @@ -3156,9 +2352,7 @@ intel_drv.so: undefined symbol: vgaHWFreeHWRec - The following flags are disabled by default and should be enabled with - hardeningEnable for packages that take untrusted input - like network services. + The following flags are disabled by default and should be enabled with hardeningEnable for packages that take untrusted input like network services. @@ -3168,31 +2362,14 @@ intel_drv.so: undefined symbol: vgaHWFreeHWRec - Adds the compiler and linker - options. Position Independent Executables are needed to take advantage of - Address Space Layout Randomization, supported by modern kernel versions. - While ASLR can already be enforced for data areas in the stack and heap - (brk and mmap), the code areas must be compiled as position-independent. - Shared libraries already do this with the pic flag, so - they gain ASLR automatically, but binary .text regions need to be build - with pie to gain ASLR. When this happens, ROP attacks - are much harder since there are no static locations to bounce off of - during a memory corruption attack. + Adds the compiler and linker options. Position Independent Executables are needed to take advantage of Address Space Layout Randomization, supported by modern kernel versions. While ASLR can already be enforced for data areas in the stack and heap (brk and mmap), the code areas must be compiled as position-independent. Shared libraries already do this with the pic flag, so they gain ASLR automatically, but binary .text regions need to be build with pie to gain ASLR. When this happens, ROP attacks are much harder since there are no static locations to bounce off of during a memory corruption attack. - For more in-depth information on these hardening flags and hardening in - general, refer to the - Debian Wiki, - Ubuntu - Wiki, - Gentoo - Wiki, and the - - Arch Wiki. + For more in-depth information on these hardening flags and hardening in general, refer to the Debian Wiki, Ubuntu Wiki, Gentoo Wiki, and the Arch Wiki.
diff --git a/doc/submitting-changes.xml b/doc/submitting-changes.xml index a04ec08b0484..9c98abbe87ad 100644 --- a/doc/submitting-changes.xml +++ b/doc/submitting-changes.xml @@ -8,8 +8,7 @@ - Read Manual (How to - write packages for Nix). + Read Manual (How to write packages for Nix). @@ -23,15 +22,11 @@ - You can make branch from a commit of your local - nixos-version. That will help you to avoid - additional local compilations. Because you will receive packages from - binary cache. + You can make branch from a commit of your local nixos-version. That will help you to avoid additional local compilations. Because you will receive packages from binary cache. - For example: nixos-version returns - 15.05.git.0998212 (Dingo). So you can do: + For example: nixos-version returns 15.05.git.0998212 (Dingo). So you can do: @@ -55,9 +50,7 @@ - If you removed pkgs, made some major NixOS changes etc., write about - them in - nixos/doc/manual/release-notes/rl-unstable.xml. + If you removed pkgs, made some major NixOS changes etc., write about them in nixos/doc/manual/release-notes/rl-unstable.xml. @@ -65,8 +58,7 @@ - Check for unnecessary whitespace with git diff --check - before committing. + Check for unnecessary whitespace with git diff --check before committing. @@ -121,8 +113,7 @@ Additional information. - nix-env -i pkg-name -f <path to your local nixpkgs - folder> + nix-env -i pkg-name -f <path to your local nixpkgs folder> @@ -134,14 +125,12 @@ Additional information. - Make sure it's in - pkgs/top-level/all-packages.nix + Make sure it's in pkgs/top-level/all-packages.nix - nix-env -i pkg-name -f <path to your local nixpkgs - folder> + nix-env -i pkg-name -f <path to your local nixpkgs folder> @@ -149,15 +138,11 @@ Additional information. - If you don't want to install pkg in you - profile. + If you don't want to install pkg in you profile. - nix-build -A pkg-attribute-name <path to your local - nixpkgs folder>/default.nix and check results in the - folder result. It will appear in the same - directory where you did nix-build. + nix-build -A pkg-attribute-name <path to your local nixpkgs folder>/default.nix and check results in the folder result. It will appear in the same directory where you did nix-build. @@ -165,9 +150,7 @@ Additional information. - If you did nix-env -i pkg-name you can do - nix-env -e pkg-name to uninstall it from your - system. + If you did nix-env -i pkg-name you can do nix-env -e pkg-name to uninstall it from your system. @@ -179,10 +162,7 @@ Additional information. - You can add new module to your NixOS configuration file (usually - it's /etc/nixos/configuration.nix). And do - sudo nixos-rebuild test -I nixpkgs=<path to your local - nixpkgs folder> --fast. + You can add new module to your NixOS configuration file (usually it's /etc/nixos/configuration.nix). And do sudo nixos-rebuild test -I nixpkgs=<path to your local nixpkgs folder> --fast. @@ -193,9 +173,7 @@ Additional information. - If you have commits pkg-name: oh, forgot to insert - whitespace: squash commits in this case. Use git rebase - -i. + If you have commits pkg-name: oh, forgot to insert whitespace: squash commits in this case. Use git rebase -i. @@ -220,8 +198,7 @@ Additional information. - Write the title in format (pkg-name | nixos/<module>): - improvement. + Write the title in format (pkg-name | nixos/<module>): improvement. @@ -233,8 +210,7 @@ Additional information. - Write in comment if you have tested your patch. Do not rely much on - TravisCI. + Write in comment if you have tested your patch. Do not rely much on TravisCI. @@ -244,8 +220,7 @@ Additional information. - Notify maintainers of the package. For example add to the message: - cc @jagajaga @domenkozar. + Notify maintainers of the package. For example add to the message: cc @jagajaga @domenkozar. @@ -257,64 +232,39 @@ Additional information. Pull Request Template - The pull request template helps determine what steps have been made for a - contribution so far, and will help guide maintainers on the status of a - change. The motivation section of the PR should include any extra details - the title does not address and link any existing issues related to the pull - request. + The pull request template helps determine what steps have been made for a contribution so far, and will help guide maintainers on the status of a change. The motivation section of the PR should include any extra details the title does not address and link any existing issues related to the pull request. - When a PR is created, it will be pre-populated with some checkboxes detailed - below: + When a PR is created, it will be pre-populated with some checkboxes detailed below:
Tested using sandboxing - When sandbox builds are enabled, Nix will setup an isolated environment for - each build process. It is used to remove further hidden dependencies set by - the build environment to improve reproducibility. This includes access to - the network during the build outside of fetch* - functions and files outside the Nix store. Depending on the operating - system access to other resources are blocked as well (ex. inter process - communication is isolated on Linux); see - build-use-sandbox - in Nix manual for details. + When sandbox builds are enabled, Nix will setup an isolated environment for each build process. It is used to remove further hidden dependencies set by the build environment to improve reproducibility. This includes access to the network during the build outside of fetch* functions and files outside the Nix store. Depending on the operating system access to other resources are blocked as well (ex. inter process communication is isolated on Linux); see build-use-sandbox in Nix manual for details. - Sandboxing is not enabled by default in Nix due to a small performance hit - on each build. In pull requests for - nixpkgs - people are asked to test builds with sandboxing enabled (see - Tested using sandboxing in the pull request template) - because - inhttps://nixos.org/hydra/ - sandboxing is also used. + Sandboxing is not enabled by default in Nix due to a small performance hit on each build. In pull requests for nixpkgs people are asked to test builds with sandboxing enabled (see Tested using sandboxing in the pull request template) because inhttps://nixos.org/hydra/ sandboxing is also used. - Depending if you use NixOS or other platforms you can use one of the - following methods to enable sandboxing - before building the package: + Depending if you use NixOS or other platforms you can use one of the following methods to enable sandboxing before building the package: - Globally enable sandboxing on NixOS: - add the following to configuration.nix + Globally enable sandboxing on NixOS: add the following to configuration.nix nix.useSandbox = true; - Globally enable sandboxing on non-NixOS - platforms: add the following to: - /etc/nix/nix.conf + Globally enable sandboxing on non-NixOS platforms: add the following to: /etc/nix/nix.conf build-use-sandbox = true @@ -326,11 +276,7 @@ Additional information. Built on platform(s) - Many Nix packages are designed to run on multiple platforms. As such, it's - important to let the maintainer know which platforms your changes have been - tested on. It's not always practical to test a change on all platforms, and - is not required for a pull request to be merged. Only check the systems you - tested the build on in this section. + Many Nix packages are designed to run on multiple platforms. As such, it's important to let the maintainer know which platforms your changes have been tested on. It's not always practical to test a change on all platforms, and is not required for a pull request to be merged. Only check the systems you tested the build on in this section.
@@ -338,15 +284,8 @@ Additional information. Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests) - Packages with automated tests are much more likely to be merged in a timely - fashion because it doesn't require as much manual testing by the maintainer - to verify the functionality of the package. If there are existing tests for - the package, they should be run to verify your changes do not break the - tests. Tests only apply to packages with NixOS modules defined and can only - be run on Linux. For more details on writing and running tests, see the - section - in the NixOS manual. + Packages with automated tests are much more likely to be merged in a timely fashion because it doesn't require as much manual testing by the maintainer to verify the functionality of the package. If there are existing tests for the package, they should be run to verify your changes do not break the tests. Tests only apply to packages with NixOS modules defined and can only be run on Linux. For more details on writing and running tests, see the section in the NixOS manual.
@@ -354,11 +293,7 @@ Additional information. Tested compilation of all pkgs that depend on this change using <command>nix-review</command> - If you are updating a package's version, you can use nix-review to make - sure all packages that depend on the updated package still compile - correctly. The nix-review utility can look for and build - all dependencies either based on uncommited changes with the - wip option or specifying a github pull request number. + If you are updating a package's version, you can use nix-review to make sure all packages that depend on the updated package still compile correctly. The nix-review utility can look for and build all dependencies either based on uncommited changes with the wip option or specifying a github pull request number. @@ -376,13 +311,7 @@ Additional information. Tested execution of all binary files (usually in <filename>./result/bin/</filename>) - It's important to test any executables generated by a build when you change - or create a package in nixpkgs. This can be done by looking in - ./result/bin and running any files in there, or at a - minimum, the main executable for the package. For example, if you make a - change to texlive, you probably would only check the - binaries associated with the change you made rather than testing all of - them. + It's important to test any executables generated by a build when you change or create a package in nixpkgs. This can be done by looking in ./result/bin and running any files in there, or at a minimum, the main executable for the package. For example, if you make a change to texlive, you probably would only check the binaries associated with the change you made rather than testing all of them. @@ -390,14 +319,8 @@ Additional information. Meets Nixpkgs contribution standards - The last checkbox is fits - CONTRIBUTING.md. - The contributing document has detailed information on standards the Nix - community has for commit messages, reviews, licensing of contributions you - make to the project, etc... Everyone should read and understand the - standards the community has for contributing before submitting a pull - request. + The last checkbox is fits CONTRIBUTING.md. The contributing document has detailed information on standards the Nix community has for commit messages, reviews, licensing of contributions you make to the project, etc... Everyone should read and understand the standards the community has for contributing before submitting a pull request. @@ -435,22 +358,17 @@ Additional information. - Commits must be sufficiently tested before being merged, both for the - master and staging branches. + Commits must be sufficiently tested before being merged, both for the master and staging branches. - Hydra builds for master and staging should not be used as testing - platform, it's a build farm for changes that have been already tested. + Hydra builds for master and staging should not be used as testing platform, it's a build farm for changes that have been already tested. - When changing the bootloader installation process, extra care must be - taken. Grub installations cannot be rolled back, hence changes may break - people's installations forever. For any non-trivial change to the - bootloader please file a PR asking for review, especially from @edolstra. + When changing the bootloader installation process, extra care must be taken. Grub installations cannot be rolled back, hence changes may break people's installations forever. For any non-trivial change to the bootloader please file a PR asking for review, especially from @edolstra. @@ -473,20 +391,12 @@ Additional information. - 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. - Read - policy here. + 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. Read policy here. - 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. - Keep - an eye on the staging evaluations here. 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, merge into master, then resume development on staging. Keep an eye on the staging evaluations here. If any fixes for staging happen to be already in master, then master can be merged into staging. @@ -498,10 +408,7 @@ Additional information. - If you're cherry-picking a commit to a stable release branch, always use - git cherry-pick -xe 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, always use git cherry-pick -xe and ensure the message contains a clear description about why this needs to be included in the stable branch. An example of a cherry-picked commit would look like this: -- cgit 1.4.1 From ea6e8775bd69e4676c623a85c39f1da540d29ad1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 18 Sep 2019 22:13:35 +0200 Subject: nixos/doc: re-format --- nixos/doc/manual/administration/boot-problems.xml | 32 +- nixos/doc/manual/administration/cleaning-store.xml | 32 +- .../manual/administration/container-networking.xml | 26 +- nixos/doc/manual/administration/containers.xml | 19 +- nixos/doc/manual/administration/control-groups.xml | 33 +- .../administration/declarative-containers.xml | 31 +- .../administration/imperative-containers.xml | 57 +- nixos/doc/manual/administration/logging.xml | 19 +- .../doc/manual/administration/maintenance-mode.xml | 4 +- .../doc/manual/administration/network-problems.xml | 13 +- nixos/doc/manual/administration/rebooting.xml | 11 +- nixos/doc/manual/administration/rollback.xml | 15 +- nixos/doc/manual/administration/running.xml | 3 +- nixos/doc/manual/administration/service-mgmt.xml | 26 +- .../doc/manual/administration/store-corruption.xml | 17 +- .../doc/manual/administration/troubleshooting.xml | 3 +- nixos/doc/manual/administration/user-sessions.xml | 15 +- nixos/doc/manual/configuration/abstractions.xml | 48 +- .../manual/configuration/ad-hoc-network-config.xml | 5 +- nixos/doc/manual/configuration/ad-hoc-packages.xml | 26 +- .../configuration/adding-custom-packages.xml | 23 +- nixos/doc/manual/configuration/config-file.xml | 71 +- nixos/doc/manual/configuration/config-syntax.xml | 14 +- nixos/doc/manual/configuration/configuration.xml | 6 +- .../manual/configuration/customizing-packages.xml | 54 +- .../manual/configuration/declarative-packages.xml | 23 +- nixos/doc/manual/configuration/file-systems.xml | 28 +- nixos/doc/manual/configuration/firewall.xml | 15 +- nixos/doc/manual/configuration/ipv4-config.xml | 15 +- nixos/doc/manual/configuration/ipv6-config.xml | 13 +- nixos/doc/manual/configuration/kubernetes.xml | 74 +-- nixos/doc/manual/configuration/linux-kernel.xml | 59 +- .../doc/manual/configuration/luks-file-systems.xml | 12 +- nixos/doc/manual/configuration/matrix.xml | 73 +- nixos/doc/manual/configuration/modularity.xml | 63 +- nixos/doc/manual/configuration/network-manager.xml | 22 +- nixos/doc/manual/configuration/networking.xml | 3 +- nixos/doc/manual/configuration/package-mgmt.xml | 13 +- nixos/doc/manual/configuration/profiles.xml | 13 +- .../manual/configuration/profiles/all-hardware.xml | 10 +- nixos/doc/manual/configuration/profiles/base.xml | 6 +- .../manual/configuration/profiles/clone-config.xml | 10 +- nixos/doc/manual/configuration/profiles/demo.xml | 6 +- .../configuration/profiles/docker-container.xml | 7 +- .../manual/configuration/profiles/graphical.xml | 11 +- .../doc/manual/configuration/profiles/hardened.xml | 14 +- .../doc/manual/configuration/profiles/headless.xml | 6 +- .../configuration/profiles/installation-device.xml | 25 +- .../doc/manual/configuration/profiles/minimal.xml | 8 +- .../manual/configuration/profiles/qemu-guest.xml | 7 +- nixos/doc/manual/configuration/ssh.xml | 7 +- nixos/doc/manual/configuration/summary.xml | 8 +- nixos/doc/manual/configuration/user-mgmt.xml | 53 +- nixos/doc/manual/configuration/wireless.xml | 18 +- nixos/doc/manual/configuration/x-windows.xml | 151 ++--- nixos/doc/manual/configuration/xfce.xml | 21 +- nixos/doc/manual/development/assertions.xml | 18 +- nixos/doc/manual/development/building-nixos.xml | 11 +- nixos/doc/manual/development/building-parts.xml | 31 +- nixos/doc/manual/development/importing-modules.xml | 7 +- nixos/doc/manual/development/meta-attributes.xml | 19 +- nixos/doc/manual/development/nixos-tests.xml | 9 +- .../doc/manual/development/option-declarations.xml | 80 +-- nixos/doc/manual/development/option-def.xml | 34 +- nixos/doc/manual/development/option-types.xml | 208 ++---- nixos/doc/manual/development/releases.xml | 126 ++-- nixos/doc/manual/development/replace-modules.xml | 22 +- .../running-nixos-tests-interactively.xml | 14 +- .../doc/manual/development/running-nixos-tests.xml | 13 +- nixos/doc/manual/development/sources.xml | 48 +- nixos/doc/manual/development/testing-installer.xml | 6 +- .../manual/development/writing-documentation.xml | 74 +-- nixos/doc/manual/development/writing-modules.xml | 69 +- .../doc/manual/development/writing-nixos-tests.xml | 113 +--- nixos/doc/manual/installation/changing-config.xml | 53 +- nixos/doc/manual/installation/installation.xml | 3 +- .../installation/installing-behind-a-proxy.xml | 15 +- .../installation/installing-from-other-distro.xml | 152 ++--- nixos/doc/manual/installation/installing-pxe.xml | 25 +- nixos/doc/manual/installation/installing-usb.xml | 15 +- .../installation/installing-virtualbox-guest.xml | 29 +- nixos/doc/manual/installation/installing.xml | 230 ++----- nixos/doc/manual/installation/obtaining.xml | 38 +- nixos/doc/manual/installation/upgrading.xml | 82 +-- nixos/doc/manual/man-configuration.xml | 5 +- nixos/doc/manual/man-nixos-build-vms.xml | 41 +- nixos/doc/manual/man-nixos-enter.xml | 22 +- nixos/doc/manual/man-nixos-generate-config.xml | 64 +- nixos/doc/manual/man-nixos-install.xml | 95 +-- nixos/doc/manual/man-nixos-option.xml | 27 +- nixos/doc/manual/man-nixos-rebuild.xml | 309 +++------ nixos/doc/manual/man-nixos-version.xml | 23 +- nixos/doc/manual/manual.xml | 21 +- nixos/doc/manual/release-notes/release-notes.xml | 3 +- nixos/doc/manual/release-notes/rl-1404.xml | 83 +-- nixos/doc/manual/release-notes/rl-1412.xml | 81 +-- nixos/doc/manual/release-notes/rl-1509.xml | 208 ++---- nixos/doc/manual/release-notes/rl-1603.xml | 205 ++---- nixos/doc/manual/release-notes/rl-1609.xml | 161 +---- nixos/doc/manual/release-notes/rl-1703.xml | 193 ++---- nixos/doc/manual/release-notes/rl-1709.xml | 292 ++------ nixos/doc/manual/release-notes/rl-1803.xml | 266 ++------ nixos/doc/manual/release-notes/rl-1809.xml | 311 ++------- nixos/doc/manual/release-notes/rl-1903.xml | 448 +++---------- nixos/doc/manual/release-notes/rl-1909.xml | 731 +++++++++------------ nixos/doc/manual/release-notes/rl-2003.xml | 7 +- nixos/modules/i18n/input-method/default.xml | 74 +-- nixos/modules/programs/digitalbitbox/doc.xml | 33 +- nixos/modules/programs/plotinus.xml | 13 +- nixos/modules/programs/zsh/oh-my-zsh.xml | 62 +- nixos/modules/security/acme.xml | 30 +- nixos/modules/security/hidepid.xml | 11 +- nixos/modules/services/databases/foundationdb.xml | 197 ++---- nixos/modules/services/databases/postgresql.xml | 39 +- nixos/modules/services/desktops/flatpak.xml | 25 +- nixos/modules/services/editors/emacs.xml | 221 ++----- nixos/modules/services/hardware/trezord.xml | 10 +- nixos/modules/services/misc/gitlab.xml | 34 +- nixos/modules/services/misc/taskserver/doc.xml | 74 +-- nixos/modules/services/misc/weechat.xml | 21 +- .../services/monitoring/prometheus/exporters.xml | 51 +- .../modules/services/networking/dnscrypt-proxy.xml | 14 +- nixos/modules/services/web-apps/matomo-doc.xml | 56 +- nixos/modules/services/web-apps/nextcloud.xml | 55 +- 124 files changed, 1894 insertions(+), 5663 deletions(-) diff --git a/nixos/doc/manual/administration/boot-problems.xml b/nixos/doc/manual/administration/boot-problems.xml index de3d8ac21aeb..d6f9cb190fbf 100644 --- a/nixos/doc/manual/administration/boot-problems.xml +++ b/nixos/doc/manual/administration/boot-problems.xml @@ -6,12 +6,7 @@ Boot Problems - If NixOS fails to boot, there are a number of kernel command line parameters - that may help you to identify or fix the issue. You can add these parameters - in the GRUB boot menu by pressing “e” to modify the selected boot entry - and editing the line starting with linux. The following - are some useful kernel command line parameters that are recognised by the - NixOS boot scripts or by systemd: + If NixOS fails to boot, there are a number of kernel command line parameters that may help you to identify or fix the issue. You can add these parameters in the GRUB boot menu by pressing “e” to modify the selected boot entry and editing the line starting with linux. The following are some useful kernel command line parameters that are recognised by the NixOS boot scripts or by systemd: @@ -19,9 +14,7 @@ - Start a root shell if something goes wrong in stage 1 of the boot process - (the initial ramdisk). This is disabled by default because there is no - authentication for the root shell. + Start a root shell if something goes wrong in stage 1 of the boot process (the initial ramdisk). This is disabled by default because there is no authentication for the root shell. @@ -31,10 +24,7 @@ - Start an interactive shell in stage 1 before anything useful has been - done. That is, no modules have been loaded and no file systems have been - mounted, except for /proc and - /sys. + Start an interactive shell in stage 1 before anything useful has been done. That is, no modules have been loaded and no file systems have been mounted, except for /proc and /sys. @@ -54,11 +44,7 @@ - Boot into rescue mode (a.k.a. single user mode). This will cause systemd - to start nothing but the unit rescue.target, which - runs sulogin to prompt for the root password and start - a root login shell. Exiting the shell causes the system to continue with - the normal boot process. + Boot into rescue mode (a.k.a. single user mode). This will cause systemd to start nothing but the unit rescue.target, which runs sulogin to prompt for the root password and start a root login shell. Exiting the shell causes the system to continue with the normal boot process. @@ -68,8 +54,7 @@ - Make systemd very verbose and send log messages to the console instead of - the journal. + Make systemd very verbose and send log messages to the console instead of the journal. @@ -80,11 +65,6 @@ - If no login prompts or X11 login screens appear (e.g. due to hanging - dependencies), you can press Alt+ArrowUp. If you’re lucky, this will start - rescue mode (described above). (Also note that since most units have a - 90-second timeout before systemd gives up on them, the - agetty login prompts should appear eventually unless - something is very wrong.) + If no login prompts or X11 login screens appear (e.g. due to hanging dependencies), you can press Alt+ArrowUp. If you’re lucky, this will start rescue mode (described above). (Also note that since most units have a 90-second timeout before systemd gives up on them, the agetty login prompts should appear eventually unless something is very wrong.) diff --git a/nixos/doc/manual/administration/cleaning-store.xml b/nixos/doc/manual/administration/cleaning-store.xml index 526803e429ba..3cbc022cd33c 100644 --- a/nixos/doc/manual/administration/cleaning-store.xml +++ b/nixos/doc/manual/administration/cleaning-store.xml @@ -5,31 +5,22 @@ xml:id="sec-nix-gc"> Cleaning the Nix Store - Nix has a purely functional model, meaning that packages are never upgraded - in place. Instead new versions of packages end up in a different location in - the Nix store (/nix/store). You should periodically run - Nix’s garbage collector to remove old, unreferenced - packages. This is easy: + Nix has a purely functional model, meaning that packages are never upgraded in place. Instead new versions of packages end up in a different location in the Nix store (/nix/store). You should periodically run Nix’s garbage collector to remove old, unreferenced packages. This is easy: $ nix-collect-garbage - Alternatively, you can use a systemd unit that does the same in the - background: + Alternatively, you can use a systemd unit that does the same in the background: # systemctl start nix-gc.service - You can tell NixOS in configuration.nix to run this unit - automatically at certain points in time, for instance, every night at 03:15: + You can tell NixOS in configuration.nix to run this unit automatically at certain points in time, for instance, every night at 03:15: = true; = "03:15"; - The commands above do not remove garbage collector roots, such as old system - configurations. Thus they do not remove the ability to roll back to previous - configurations. The following command deletes old roots, removing the ability - to roll back to them: + The commands above do not remove garbage collector roots, such as old system configurations. Thus they do not remove the ability to roll back to previous configurations. The following command deletes old roots, removing the ability to roll back to them: $ nix-collect-garbage -d @@ -37,27 +28,20 @@ $ nix-env -p /nix/var/nix/profiles/per-user/eelco/profile --delete-generations old - Note that NixOS system configurations are stored in the profile - /nix/var/nix/profiles/system. + Note that NixOS system configurations are stored in the profile /nix/var/nix/profiles/system. - Another way to reclaim disk space (often as much as 40% of the size of the - Nix store) is to run Nix’s store optimiser, which seeks out identical files - in the store and replaces them with hard links to a single copy. + Another way to reclaim disk space (often as much as 40% of the size of the Nix store) is to run Nix’s store optimiser, which seeks out identical files in the store and replaces them with hard links to a single copy. $ nix-store --optimise - Since this command needs to read the entire Nix store, it can take quite a - while to finish. + Since this command needs to read the entire Nix store, it can take quite a while to finish.
NixOS Boot Entries - If your /boot partition runs out of space, after - clearing old profiles you must rebuild your system with - nixos-rebuild to update the /boot - partition and clear space. + If your /boot partition runs out of space, after clearing old profiles you must rebuild your system with nixos-rebuild to update the /boot partition and clear space.
diff --git a/nixos/doc/manual/administration/container-networking.xml b/nixos/doc/manual/administration/container-networking.xml index 42486f01fe8c..745fa524916b 100644 --- a/nixos/doc/manual/administration/container-networking.xml +++ b/nixos/doc/manual/administration/container-networking.xml @@ -6,10 +6,7 @@ Container Networking - When you create a container using nixos-container create, - it gets it own private IPv4 address in the range - 10.233.0.0/16. You can get the container’s IPv4 address - as follows: + When you create a container using nixos-container create, it gets it own private IPv4 address in the range 10.233.0.0/16. You can get the container’s IPv4 address as follows: # nixos-container show-ip foo 10.233.4.2 @@ -20,34 +17,21 @@ - Networking is implemented using a pair of virtual Ethernet devices. The - network interface in the container is called eth0, while - the matching interface in the host is called - ve-container-name (e.g., - ve-foo). The container has its own network namespace and - the CAP_NET_ADMIN capability, so it can perform arbitrary - network configuration such as setting up firewall rules, without affecting or - having access to the host’s network. + Networking is implemented using a pair of virtual Ethernet devices. The network interface in the container is called eth0, while the matching interface in the host is called ve-container-name (e.g., ve-foo). The container has its own network namespace and the CAP_NET_ADMIN capability, so it can perform arbitrary network configuration such as setting up firewall rules, without affecting or having access to the host’s network. - By default, containers cannot talk to the outside network. If you want that, - you should set up Network Address Translation (NAT) rules on the host to - rewrite container traffic to use your external IP address. This can be - accomplished using the following configuration on the host: + By default, containers cannot talk to the outside network. If you want that, you should set up Network Address Translation (NAT) rules on the host to rewrite container traffic to use your external IP address. This can be accomplished using the following configuration on the host: = true; = ["ve-+"]; = "eth0"; - where eth0 should be replaced with the desired external - interface. Note that ve-+ is a wildcard that matches all - container interfaces. + where eth0 should be replaced with the desired external interface. Note that ve-+ is a wildcard that matches all container interfaces. - If you are using Network Manager, you need to explicitly prevent it from - managing container interfaces: + If you are using Network Manager, you need to explicitly prevent it from managing container interfaces: networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; diff --git a/nixos/doc/manual/administration/containers.xml b/nixos/doc/manual/administration/containers.xml index 0d3355e56a58..2d5a6dd46a32 100644 --- a/nixos/doc/manual/administration/containers.xml +++ b/nixos/doc/manual/administration/containers.xml @@ -5,28 +5,15 @@ xml:id="ch-containers"> Container Management - NixOS allows you to easily run other NixOS instances as - containers. Containers are a light-weight approach to - virtualisation that runs software in the container at the same speed as in - the host system. NixOS containers share the Nix store of the host, making - container creation very efficient. + NixOS allows you to easily run other NixOS instances as containers. Containers are a light-weight approach to virtualisation that runs software in the container at the same speed as in the host system. NixOS containers share the Nix store of the host, making container creation very efficient. - Currently, NixOS containers are not perfectly isolated from the host system. - This means that a user with root access to the container can do things that - affect the host. So you should not give container root access to untrusted - users. + Currently, NixOS containers are not perfectly isolated from the host system. This means that a user with root access to the container can do things that affect the host. So you should not give container root access to untrusted users. - NixOS containers can be created in two ways: imperatively, using the command - nixos-container, and declaratively, by specifying them in - your configuration.nix. The declarative approach implies - that containers get upgraded along with your host system when you run - nixos-rebuild, which is often not what you want. By - contrast, in the imperative approach, containers are configured and updated - independently from the host system. + NixOS containers can be created in two ways: imperatively, using the command nixos-container, and declaratively, by specifying them in your configuration.nix. The declarative approach implies that containers get upgraded along with your host system when you run nixos-rebuild, which is often not what you want. By contrast, in the imperative approach, containers are configured and updated independently from the host system. diff --git a/nixos/doc/manual/administration/control-groups.xml b/nixos/doc/manual/administration/control-groups.xml index 16d03cc0d1ab..d6ae89da30c4 100644 --- a/nixos/doc/manual/administration/control-groups.xml +++ b/nixos/doc/manual/administration/control-groups.xml @@ -5,16 +5,10 @@ xml:id="sec-cgroups"> Control Groups - To keep track of the processes in a running system, systemd uses - control groups (cgroups). A control group is a set of - processes used to allocate resources such as CPU, memory or I/O bandwidth. - There can be multiple control group hierarchies, allowing each kind of - resource to be managed independently. + To keep track of the processes in a running system, systemd uses control groups (cgroups). A control group is a set of processes used to allocate resources such as CPU, memory or I/O bandwidth. There can be multiple control group hierarchies, allowing each kind of resource to be managed independently. - The command systemd-cgls lists all control groups in the - systemd hierarchy, which is what systemd uses to keep - track of the processes belonging to each service or user session: + The command systemd-cgls lists all control groups in the systemd hierarchy, which is what systemd uses to keep track of the processes belonging to each service or user session: $ systemd-cgls ├─user @@ -32,34 +26,19 @@ │ └─2376 dhcpcd --config /nix/store/f8dif8dsi2yaa70n03xir8r653776ka6-dhcpcd.conf └─ ... - Similarly, systemd-cgls cpu shows the cgroups in the CPU - hierarchy, which allows per-cgroup CPU scheduling priorities. By default, - every systemd service gets its own CPU cgroup, while all user sessions are in - the top-level CPU cgroup. This ensures, for instance, that a thousand - run-away processes in the httpd.service cgroup cannot - starve the CPU for one process in the postgresql.service - cgroup. (By contrast, it they were in the same cgroup, then the PostgreSQL - process would get 1/1001 of the cgroup’s CPU time.) You can limit a - service’s CPU share in configuration.nix: + Similarly, systemd-cgls cpu shows the cgroups in the CPU hierarchy, which allows per-cgroup CPU scheduling priorities. By default, every systemd service gets its own CPU cgroup, while all user sessions are in the top-level CPU cgroup. This ensures, for instance, that a thousand run-away processes in the httpd.service cgroup cannot starve the CPU for one process in the postgresql.service cgroup. (By contrast, it they were in the same cgroup, then the PostgreSQL process would get 1/1001 of the cgroup’s CPU time.) You can limit a service’s CPU share in configuration.nix: systemd.services.httpd.serviceConfig.CPUShares = 512; - By default, every cgroup has 1024 CPU shares, so this will halve the CPU - allocation of the httpd.service cgroup. + By default, every cgroup has 1024 CPU shares, so this will halve the CPU allocation of the httpd.service cgroup. - There also is a memory hierarchy that controls memory - allocation limits; by default, all processes are in the top-level cgroup, so - any service or session can exhaust all available memory. Per-cgroup memory - limits can be specified in configuration.nix; for - instance, to limit httpd.service to 512 MiB of RAM - (excluding swap): + There also is a memory hierarchy that controls memory allocation limits; by default, all processes are in the top-level cgroup, so any service or session can exhaust all available memory. Per-cgroup memory limits can be specified in configuration.nix; for instance, to limit httpd.service to 512 MiB of RAM (excluding swap): systemd.services.httpd.serviceConfig.MemoryLimit = "512M"; - The command systemd-cgtop shows a continuously updated - list of all cgroups with their CPU and memory usage. + The command systemd-cgtop shows a continuously updated list of all cgroups with their CPU and memory usage. diff --git a/nixos/doc/manual/administration/declarative-containers.xml b/nixos/doc/manual/administration/declarative-containers.xml index d03dbc4d7055..a463d2014784 100644 --- a/nixos/doc/manual/administration/declarative-containers.xml +++ b/nixos/doc/manual/administration/declarative-containers.xml @@ -6,10 +6,7 @@ Declarative Container Specification - You can also specify containers and their configuration in the host’s - configuration.nix. For example, the following specifies - that there shall be a container named database running - PostgreSQL: + You can also specify containers and their configuration in the host’s configuration.nix. For example, the following specifies that there shall be a container named database running PostgreSQL: containers.database = { config = @@ -19,18 +16,11 @@ containers.database = }; }; - If you run nixos-rebuild switch, the container will be - built. If the container was already running, it will be updated in place, - without rebooting. The container can be configured to start automatically by - setting containers.database.autoStart = true in its - configuration. + If you run nixos-rebuild switch, the container will be built. If the container was already running, it will be updated in place, without rebooting. The container can be configured to start automatically by setting containers.database.autoStart = true in its configuration. - By default, declarative containers share the network namespace of the host, - meaning that they can listen on (privileged) ports. However, they cannot - change the network configuration. You can give a container its own network as - follows: + By default, declarative containers share the network namespace of the host, meaning that they can listen on (privileged) ports. However, they cannot change the network configuration. You can give a container its own network as follows: containers.database = { privateNetwork = true; @@ -38,23 +28,14 @@ containers.database = { localAddress = "192.168.100.11"; }; - This gives the container a private virtual Ethernet interface with IP address - 192.168.100.11, which is hooked up to a virtual Ethernet - interface on the host with IP address 192.168.100.10. (See - the next section for details on container networking.) + This gives the container a private virtual Ethernet interface with IP address 192.168.100.11, which is hooked up to a virtual Ethernet interface on the host with IP address 192.168.100.10. (See the next section for details on container networking.) - To disable the container, just remove it from - configuration.nix and run nixos-rebuild - switch. Note that this will not delete the root directory of the - container in /var/lib/containers. Containers can be - destroyed using the imperative method: nixos-container destroy - foo. + To disable the container, just remove it from configuration.nix and run nixos-rebuild switch. Note that this will not delete the root directory of the container in /var/lib/containers. Containers can be destroyed using the imperative method: nixos-container destroy foo. - Declarative containers can be started and stopped using the corresponding - systemd service, e.g. systemctl start container@database. + Declarative containers can be started and stopped using the corresponding systemd service, e.g. systemctl start container@database. diff --git a/nixos/doc/manual/administration/imperative-containers.xml b/nixos/doc/manual/administration/imperative-containers.xml index 7ded0c11786e..d5da6bf2017e 100644 --- a/nixos/doc/manual/administration/imperative-containers.xml +++ b/nixos/doc/manual/administration/imperative-containers.xml @@ -6,9 +6,7 @@ Imperative Container Management - We’ll cover imperative container management using - nixos-container first. Be aware that container management - is currently only possible as root. + We’ll cover imperative container management using nixos-container first. Be aware that container management is currently only possible as root. @@ -16,23 +14,14 @@ # nixos-container create foo - This creates the container’s root directory in - /var/lib/containers/foo and a small configuration file - in /etc/containers/foo.conf. It also builds the - container’s initial system configuration and stores it in - /nix/var/nix/profiles/per-container/foo/system. You can - modify the initial configuration of the container on the command line. For - instance, to create a container that has sshd running, - with the given public key for root: + This creates the container’s root directory in /var/lib/containers/foo and a small configuration file in /etc/containers/foo.conf. It also builds the container’s initial system configuration and stores it in /nix/var/nix/profiles/per-container/foo/system. You can modify the initial configuration of the container on the command line. For instance, to create a container that has sshd running, with the given public key for root: # nixos-container create foo --config ' = true; users.users.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"]; ' - By default the next free address in the 10.233.0.0/16 subnet will be chosen - as container IP. This behavior can be altered by setting --host-address and - --local-address: + By default the next free address in the 10.233.0.0/16 subnet will be chosen as container IP. This behavior can be altered by setting --host-address and --local-address: # nixos-container create test --config-file test-container.nix \ --local-address 10.235.1.2 --host-address 10.235.1.1 @@ -44,35 +33,25 @@ # nixos-container start foo - This command will return as soon as the container has booted and has reached - multi-user.target. On the host, the container runs within - a systemd unit called - container@container-name.service. - Thus, if something went wrong, you can get status info using - systemctl: + This command will return as soon as the container has booted and has reached multi-user.target. On the host, the container runs within a systemd unit called container@container-name.service. Thus, if something went wrong, you can get status info using systemctl: # systemctl status container@foo - If the container has started successfully, you can log in as root using the - root-login operation: + If the container has started successfully, you can log in as root using the root-login operation: # nixos-container root-login foo [root@foo:~]# - Note that only root on the host can do this (since there is no - authentication). You can also get a regular login prompt using the - login operation, which is available to all users on the - host: + Note that only root on the host can do this (since there is no authentication). You can also get a regular login prompt using the login operation, which is available to all users on the host: # nixos-container login foo foo login: alice Password: *** - With nixos-container run, you can execute arbitrary - commands in the container: + With nixos-container run, you can execute arbitrary commands in the container: # nixos-container run foo -- uname -a Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux @@ -80,15 +59,11 @@ Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux - There are several ways to change the configuration of the container. First, - on the host, you can edit - /var/lib/container/name/etc/nixos/configuration.nix, - and run + There are several ways to change the configuration of the container. First, on the host, you can edit /var/lib/container/name/etc/nixos/configuration.nix, and run # nixos-container update foo - This will build and activate the new configuration. You can also specify a - new configuration on the command line: + This will build and activate the new configuration. You can also specify a new configuration on the command line: # nixos-container update foo --config ' = true; @@ -99,23 +74,15 @@ Linux foo 3.4.82 #1-NixOS SMP Thu Mar 20 14:44:05 UTC 2014 x86_64 GNU/Linux # curl http://$(nixos-container show-ip foo)/ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">… - However, note that this will overwrite the container’s - /etc/nixos/configuration.nix. + However, note that this will overwrite the container’s /etc/nixos/configuration.nix. - Alternatively, you can change the configuration from within the container - itself by running nixos-rebuild switch inside the - container. Note that the container by default does not have a copy of the - NixOS channel, so you should run nix-channel --update - first. + Alternatively, you can change the configuration from within the container itself by running nixos-rebuild switch inside the container. Note that the container by default does not have a copy of the NixOS channel, so you should run nix-channel --update first. - Containers can be stopped and started using nixos-container - stop and nixos-container start, respectively, or - by using systemctl on the container’s service unit. To - destroy a container, including its file system, do + Containers can be stopped and started using nixos-container stop and nixos-container start, respectively, or by using systemctl on the container’s service unit. To destroy a container, including its file system, do # nixos-container destroy foo diff --git a/nixos/doc/manual/administration/logging.xml b/nixos/doc/manual/administration/logging.xml index da4877fcdf08..8089b457786c 100644 --- a/nixos/doc/manual/administration/logging.xml +++ b/nixos/doc/manual/administration/logging.xml @@ -5,18 +5,11 @@ xml:id="sec-logging"> Logging - System-wide logging is provided by systemd’s journal, - which subsumes traditional logging daemons such as syslogd and klogd. Log - entries are kept in binary files in /var/log/journal/. - The command journalctl allows you to see the contents of - the journal. For example, + System-wide logging is provided by systemd’s journal, which subsumes traditional logging daemons such as syslogd and klogd. Log entries are kept in binary files in /var/log/journal/. The command journalctl allows you to see the contents of the journal. For example, $ journalctl -b - shows all journal entries since the last reboot. (The output of - journalctl is piped into less by - default.) You can use various options and match operators to restrict output - to messages of interest. For instance, to get all messages from PostgreSQL: + shows all journal entries since the last reboot. (The output of journalctl is piped into less by default.) You can use various options and match operators to restrict output to messages of interest. For instance, to get all messages from PostgreSQL: $ journalctl -u postgresql.service -- Logs begin at Mon, 2013-01-07 13:28:01 CET, end at Tue, 2013-01-08 01:09:57 CET. -- @@ -26,8 +19,7 @@ Jan 07 15:44:14 hagbard postgres[2681]: [2-1] LOG: database system is shut down Jan 07 15:45:10 hagbard postgres[2532]: [1-1] LOG: database system was shut down at 2013-01-07 15:44:14 CET Jan 07 15:45:13 hagbard postgres[2500]: [1-1] LOG: database system is ready to accept connections - Or to get all messages since the last reboot that have at least a - “critical” severity level: + Or to get all messages since the last reboot that have at least a “critical” severity level: $ journalctl -b -p crit Dec 17 21:08:06 mandark sudo[3673]: pam_unix(sudo:auth): auth could not identify password for [alice] @@ -35,9 +27,6 @@ Dec 29 01:30:22 mandark kernel[6131]: [1053513.909444] CPU6: Core temperature ab - The system journal is readable by root and by users in the - wheel and systemd-journal groups. All - users have a private journal that can be read using - journalctl. + The system journal is readable by root and by users in the wheel and systemd-journal groups. All users have a private journal that can be read using journalctl. diff --git a/nixos/doc/manual/administration/maintenance-mode.xml b/nixos/doc/manual/administration/maintenance-mode.xml index 71e3f9ea665d..dc11316dc1a1 100644 --- a/nixos/doc/manual/administration/maintenance-mode.xml +++ b/nixos/doc/manual/administration/maintenance-mode.xml @@ -9,8 +9,6 @@ You can enter rescue mode by running: # systemctl rescue - This will eventually give you a single-user root shell. Systemd will stop - (almost) all system services. To get out of maintenance mode, just exit from - the rescue shell. + This will eventually give you a single-user root shell. Systemd will stop (almost) all system services. To get out of maintenance mode, just exit from the rescue shell. diff --git a/nixos/doc/manual/administration/network-problems.xml b/nixos/doc/manual/administration/network-problems.xml index 570f58358845..1d41e5c29957 100644 --- a/nixos/doc/manual/administration/network-problems.xml +++ b/nixos/doc/manual/administration/network-problems.xml @@ -6,20 +6,11 @@ Network Problems - Nix uses a so-called binary cache to optimise building a - package from source into downloading it as a pre-built binary. That is, - whenever a command like nixos-rebuild needs a path in the - Nix store, Nix will try to download that path from the Internet rather than - build it from source. The default binary cache is - https://cache.nixos.org/. If this cache is unreachable, Nix - operations may take a long time due to HTTP connection timeouts. You can - disable the use of the binary cache by adding , e.g. + Nix uses a so-called binary cache to optimise building a package from source into downloading it as a pre-built binary. That is, whenever a command like nixos-rebuild needs a path in the Nix store, Nix will try to download that path from the Internet rather than build it from source. The default binary cache is https://cache.nixos.org/. If this cache is unreachable, Nix operations may take a long time due to HTTP connection timeouts. You can disable the use of the binary cache by adding , e.g. # nixos-rebuild switch --option use-binary-caches false - If you have an alternative binary cache at your disposal, you can use it - instead: + If you have an alternative binary cache at your disposal, you can use it instead: # nixos-rebuild switch --option binary-caches http://my-cache.example.org/ diff --git a/nixos/doc/manual/administration/rebooting.xml b/nixos/doc/manual/administration/rebooting.xml index a5abd6f02588..989712b20faf 100644 --- a/nixos/doc/manual/administration/rebooting.xml +++ b/nixos/doc/manual/administration/rebooting.xml @@ -16,20 +16,15 @@ # reboot - which is equivalent to systemctl reboot. Alternatively, - you can quickly reboot the system using kexec, which - bypasses the BIOS by directly loading the new kernel into memory: + which is equivalent to systemctl reboot. Alternatively, you can quickly reboot the system using kexec, which bypasses the BIOS by directly loading the new kernel into memory: # systemctl kexec - The machine can be suspended to RAM (if supported) using systemctl - suspend, and suspended to disk using systemctl - hibernate. + The machine can be suspended to RAM (if supported) using systemctl suspend, and suspended to disk using systemctl hibernate. - These commands can be run by any user who is logged in locally, i.e. on a - virtual console or in X11; otherwise, the user is asked for authentication. + These commands can be run by any user who is logged in locally, i.e. on a virtual console or in X11; otherwise, the user is asked for authentication. diff --git a/nixos/doc/manual/administration/rollback.xml b/nixos/doc/manual/administration/rollback.xml index fb87810ba461..aa6d3c956766 100644 --- a/nixos/doc/manual/administration/rollback.xml +++ b/nixos/doc/manual/administration/rollback.xml @@ -6,19 +6,11 @@ Rolling Back Configuration Changes - After running nixos-rebuild to switch to a new - configuration, you may find that the new configuration doesn’t work very - well. In that case, there are several ways to return to a previous - configuration. + After running nixos-rebuild to switch to a new configuration, you may find that the new configuration doesn’t work very well. In that case, there are several ways to return to a previous configuration. - First, the GRUB boot manager allows you to boot into any previous - configuration that hasn’t been garbage-collected. These configurations can - be found under the GRUB submenu “NixOS - All configurations”. This is - especially useful if the new configuration fails to boot. After the system - has booted, you can make the selected configuration the default for - subsequent boots: + First, the GRUB boot manager allows you to boot into any previous configuration that hasn’t been garbage-collected. These configurations can be found under the GRUB submenu “NixOS - All configurations”. This is especially useful if the new configuration fails to boot. After the system has booted, you can make the selected configuration the default for subsequent boots: # /run/current-system/bin/switch-to-configuration boot @@ -30,8 +22,7 @@ This is equivalent to running: # /nix/var/nix/profiles/system-N-link/bin/switch-to-configuration switch - where N is the number of the NixOS system - configuration. To get a list of the available configurations, do: + where N is the number of the NixOS system configuration. To get a list of the available configurations, do: $ ls -l /nix/var/nix/profiles/system-*-link ... diff --git a/nixos/doc/manual/administration/running.xml b/nixos/doc/manual/administration/running.xml index 19bec1f7794d..12512a003c8e 100644 --- a/nixos/doc/manual/administration/running.xml +++ b/nixos/doc/manual/administration/running.xml @@ -6,8 +6,7 @@ Administration - This chapter describes various aspects of managing a running NixOS system, - such as how to use the systemd service manager. + This chapter describes various aspects of managing a running NixOS system, such as how to use the systemd service manager. diff --git a/nixos/doc/manual/administration/service-mgmt.xml b/nixos/doc/manual/administration/service-mgmt.xml index 1b9c745eb59f..4ad30ce55a86 100644 --- a/nixos/doc/manual/administration/service-mgmt.xml +++ b/nixos/doc/manual/administration/service-mgmt.xml @@ -5,21 +5,10 @@ xml:id="sec-systemctl"> Service Management - In NixOS, all system services are started and monitored using the systemd - program. Systemd is the “init” process of the system (i.e. PID 1), the - parent of all other processes. It manages a set of so-called “units”, - which can be things like system services (programs), but also mount points, - swap files, devices, targets (groups of units) and more. Units can have - complex dependencies; for instance, one unit can require that another unit - must be successfully started before the first unit can be started. When the - system boots, it starts a unit named default.target; the - dependencies of this unit cause all system services to be started, file - systems to be mounted, swap files to be activated, and so on. + In NixOS, all system services are started and monitored using the systemd program. Systemd is the “init” process of the system (i.e. PID 1), the parent of all other processes. It manages a set of so-called “units”, which can be things like system services (programs), but also mount points, swap files, devices, targets (groups of units) and more. Units can have complex dependencies; for instance, one unit can require that another unit must be successfully started before the first unit can be started. When the system boots, it starts a unit named default.target; the dependencies of this unit cause all system services to be started, file systems to be mounted, swap files to be activated, and so on. - The command systemctl is the main way to interact with - systemd. Without any arguments, it shows the status of - active units: + The command systemctl is the main way to interact with systemd. Without any arguments, it shows the status of active units: $ systemctl -.mount loaded active mounted / @@ -30,8 +19,7 @@ graphical.target loaded active active Graphical Interface - You can ask for detailed status information about a unit, for instance, the - PostgreSQL database service: + You can ask for detailed status information about a unit, for instance, the PostgreSQL database service: $ systemctl status postgresql.service postgresql.service - PostgreSQL Server @@ -51,9 +39,7 @@ Jan 07 15:55:57 hagbard postgres[2390]: [1-1] LOG: database system is ready to Jan 07 15:55:57 hagbard postgres[2420]: [1-1] LOG: autovacuum launcher started Jan 07 15:55:57 hagbard systemd[1]: Started PostgreSQL Server. - Note that this shows the status of the unit (active and running), all the - processes belonging to the service, as well as the most recent log messages - from the service. + Note that this shows the status of the unit (active and running), all the processes belonging to the service, as well as the most recent log messages from the service. Units can be stopped, started or restarted: @@ -62,9 +48,7 @@ Jan 07 15:55:57 hagbard systemd[1]: Started PostgreSQL Server. # systemctl start postgresql.service # systemctl restart postgresql.service - These operations are synchronous: they wait until the service has finished - starting or stopping (or has failed). Starting a unit will cause the - dependencies of that unit to be started as well (if necessary). + These operations are synchronous: they wait until the service has finished starting or stopping (or has failed). Starting a unit will cause the dependencies of that unit to be started as well (if necessary). users.users.alice.openssh.authorizedKeys.keys = diff --git a/nixos/doc/manual/configuration/summary.xml b/nixos/doc/manual/configuration/summary.xml index ea980254a8fc..c9c8b67b0cfc 100644 --- a/nixos/doc/manual/configuration/summary.xml +++ b/nixos/doc/manual/configuration/summary.xml @@ -6,12 +6,8 @@ Syntax Summary - Below is a summary of the most important syntactic constructs in the Nix - expression language. It’s not complete. In particular, there are many other - built-in functions. See the - Nix - manual for the rest. + Below is a summary of the most important syntactic constructs in the Nix expression language. It’s not complete. In particular, there are many other built-in functions. See the Nix manual for the rest. diff --git a/nixos/doc/manual/configuration/user-mgmt.xml b/nixos/doc/manual/configuration/user-mgmt.xml index 4b1710f3a2b1..db8323ec4d4f 100644 --- a/nixos/doc/manual/configuration/user-mgmt.xml +++ b/nixos/doc/manual/configuration/user-mgmt.xml @@ -5,10 +5,7 @@ xml:id="sec-user-management"> User Management - NixOS supports both declarative and imperative styles of user management. In - the declarative style, users are specified in - configuration.nix. For instance, the following states - that a user account named alice shall exist: + NixOS supports both declarative and imperative styles of user management. In the declarative style, users are specified in configuration.nix. For instance, the following states that a user account named alice shall exist: .alice = { isNormalUser = true; @@ -18,60 +15,33 @@ openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3Nza... alice@foobar" ]; }; - Note that alice is a member of the - wheel and networkmanager groups, which - allows her to use sudo to execute commands as - root and to configure the network, respectively. Also note - the SSH public key that allows remote logins with the corresponding private - key. Users created in this way do not have a password by default, so they - cannot log in via mechanisms that require a password. However, you can use - the passwd program to set a password, which is retained - across invocations of nixos-rebuild. + Note that alice is a member of the wheel and networkmanager groups, which allows her to use sudo to execute commands as root and to configure the network, respectively. Also note the SSH public key that allows remote logins with the corresponding private key. Users created in this way do not have a password by default, so they cannot log in via mechanisms that require a password. However, you can use the passwd program to set a password, which is retained across invocations of nixos-rebuild. - If you set to false, then the - contents of /etc/passwd and /etc/group - will be congruent to your NixOS configuration. For instance, if you remove a - user from and run nixos-rebuild, the user - account will cease to exist. Also, imperative commands for managing users and - groups, such as useradd, are no longer available. Passwords may still be - assigned by setting the user's - hashedPassword - option. A hashed password can be generated using mkpasswd -m - sha-512 after installing the mkpasswd package. + If you set to false, then the contents of /etc/passwd and /etc/group will be congruent to your NixOS configuration. For instance, if you remove a user from and run nixos-rebuild, the user account will cease to exist. Also, imperative commands for managing users and groups, such as useradd, are no longer available. Passwords may still be assigned by setting the user's hashedPassword option. A hashed password can be generated using mkpasswd -m sha-512 after installing the mkpasswd package. - A user ID (uid) is assigned automatically. You can also specify a uid - manually by adding + A user ID (uid) is assigned automatically. You can also specify a uid manually by adding uid = 1000; to the user specification. - Groups can be specified similarly. The following states that a group named - students shall exist: + Groups can be specified similarly. The following states that a group named students shall exist: .students.gid = 1000; - As with users, the group ID (gid) is optional and will be assigned - automatically if it’s missing. + As with users, the group ID (gid) is optional and will be assigned automatically if it’s missing. - In the imperative style, users and groups are managed by commands such as - useradd, groupmod and so on. For - instance, to create a user account named alice: + In the imperative style, users and groups are managed by commands such as useradd, groupmod and so on. For instance, to create a user account named alice: # useradd -m alice - To make all nix tools available to this new user use `su - USER` which opens - a login shell (==shell that loads the profile) for given user. This will - create the ~/.nix-defexpr symlink. So run: + To make all nix tools available to this new user use `su - USER` which opens a login shell (==shell that loads the profile) for given user. This will create the ~/.nix-defexpr symlink. So run: # su - alice -c "true" - The flag causes the creation of a home directory for the - new user, which is generally what you want. The user does not have an initial - password and therefore cannot log in. A password can be set using the - passwd utility: + The flag causes the creation of a home directory for the new user, which is generally what you want. The user does not have an initial password and therefore cannot log in. A password can be set using the passwd utility: # passwd alice Enter new UNIX password: *** @@ -80,9 +50,6 @@ Retype new UNIX password: *** A user can be deleted using userdel: # userdel -r alice - The flag deletes the user’s home directory. Accounts - can be modified using usermod. Unix groups can be managed - using groupadd, groupmod and - groupdel. + The flag deletes the user’s home directory. Accounts can be modified using usermod. Unix groups can be managed using groupadd, groupmod and groupdel. diff --git a/nixos/doc/manual/configuration/wireless.xml b/nixos/doc/manual/configuration/wireless.xml index 9c0e3a8d7aa4..5c2034239977 100644 --- a/nixos/doc/manual/configuration/wireless.xml +++ b/nixos/doc/manual/configuration/wireless.xml @@ -6,9 +6,7 @@ Wireless Networks - For a desktop installation using NetworkManager (e.g., GNOME), you just have - to make sure the user is in the networkmanager group and you can - skip the rest of this section on wireless networks. + For a desktop installation using NetworkManager (e.g., GNOME), you just have to make sure the user is in the networkmanager group and you can skip the rest of this section on wireless networks. @@ -25,17 +23,13 @@ "free.wifi" = {}; }; - Be aware that keys will be written to the nix store in plaintext! When no - networks are set, it will default to using a configuration file at - /etc/wpa_supplicant.conf. You should edit this file - yourself to define wireless networks, WPA keys and so on (see + Be aware that keys will be written to the nix store in plaintext! When no networks are set, it will default to using a configuration file at /etc/wpa_supplicant.conf. You should edit this file yourself to define wireless networks, WPA keys and so on (see wpa_supplicant.conf 5 ).
- If you are using WPA2 you can generate pskRaw key using - wpa_passphrase: + If you are using WPA2 you can generate pskRaw key using wpa_passphrase: $ wpa_passphrase ESSID PSK network={ @@ -51,12 +45,10 @@ network={ }; }
- or you can use it to directly generate the - wpa_supplicant.conf: + or you can use it to directly generate the wpa_supplicant.conf: # wpa_passphrase ESSID PSK > /etc/wpa_supplicant.conf - After you have edited the wpa_supplicant.conf, you need to - restart the wpa_supplicant service. + After you have edited the wpa_supplicant.conf, you need to restart the wpa_supplicant service. # systemctl restart wpa_supplicant.service diff --git a/nixos/doc/manual/configuration/x-windows.xml b/nixos/doc/manual/configuration/x-windows.xml index f6f659b02afa..2d65ba479aab 100644 --- a/nixos/doc/manual/configuration/x-windows.xml +++ b/nixos/doc/manual/configuration/x-windows.xml @@ -5,23 +5,18 @@ xml:id="sec-x11"> X Window System - The X Window System (X11) provides the basis of NixOS’ graphical user - interface. It can be enabled as follows: + The X Window System (X11) provides the basis of NixOS’ graphical user interface. It can be enabled as follows: = true; - The X server will automatically detect and use the appropriate video driver - from a set of X.org drivers (such as vesa and - intel). You can also specify a driver manually, e.g. + The X server will automatically detect and use the appropriate video driver from a set of X.org drivers (such as vesa and intel). You can also specify a driver manually, e.g. = [ "r128" ]; to enable X.org’s xf86-video-r128 driver. - You also need to enable at least one desktop or window manager. Otherwise, - you can only log into a plain undecorated xterm window. - Thus you should pick one or more of the following lines: + You also need to enable at least one desktop or window manager. Otherwise, you can only log into a plain undecorated xterm window. Thus you should pick one or more of the following lines: = true; = true; @@ -34,9 +29,7 @@ - NixOS’s default display manager (the program that - provides a graphical login prompt and manages the X server) is LightDM. You - can select an alternative one by picking one of the following lines: + NixOS’s default display manager (the program that provides a graphical login prompt and manages the X server) is LightDM. You can select an alternative one by picking one of the following lines: = true; = true; @@ -50,8 +43,7 @@ - The X server is started automatically at boot time. If you don’t want this - to happen, you can set: + The X server is started automatically at boot time. If you don’t want this to happen, you can set: = false; @@ -61,8 +53,7 @@ - On 64-bit systems, if you want OpenGL for 32-bit programs such as in Wine, - you should also set the following: + On 64-bit systems, if you want OpenGL for 32-bit programs such as in Wine, you should also set the following: = true; @@ -70,23 +61,18 @@ Auto-login - The x11 login screen can be skipped entirely, automatically logging you into - your window manager and desktop environment when you boot your computer. + The x11 login screen can be skipped entirely, automatically logging you into your window manager and desktop environment when you boot your computer. - This is especially helpful if you have disk encryption enabled. Since you - already have to provide a password to decrypt your disk, entering a second - password to login can be redundant. + This is especially helpful if you have disk encryption enabled. Since you already have to provide a password to decrypt your disk, entering a second password to login can be redundant. - To enable auto-login, you need to define your default window manager and - desktop environment. If you wanted no desktop environment and i3 as your your - window manager, you'd define: + To enable auto-login, you need to define your default window manager and desktop environment. If you wanted no desktop environment and i3 as your your window manager, you'd define: = "none"; = "i3"; - And, finally, to enable auto-login for a user johndoe: + And, finally, to enable auto-login for a user johndoe: = true; = "johndoe"; @@ -96,9 +82,7 @@ Proprietary NVIDIA drivers - NVIDIA provides a proprietary driver for its graphics cards that has better - 3D performance than the X.org drivers. It is not enabled by default because - it’s not free software. You can enable it as follows: + NVIDIA provides a proprietary driver for its graphics cards that has better 3D performance than the X.org drivers. It is not enabled by default because it’s not free software. You can enable it as follows: = [ "nvidia" ]; @@ -109,76 +93,51 @@ = [ "nvidiaLegacy304" ]; = [ "nvidiaLegacy173" ]; - You may need to reboot after enabling this driver to prevent a clash with - other kernel modules. + You may need to reboot after enabling this driver to prevent a clash with other kernel modules. Proprietary AMD drivers - AMD provides a proprietary driver for its graphics cards that has better 3D - performance than the X.org drivers. It is not enabled by default because - it’s not free software. You can enable it as follows: + AMD provides a proprietary driver for its graphics cards that has better 3D performance than the X.org drivers. It is not enabled by default because it’s not free software. You can enable it as follows: = [ "ati_unfree" ]; - You will need to reboot after enabling this driver to prevent a clash with - other kernel modules. + You will need to reboot after enabling this driver to prevent a clash with other kernel modules. - - For recent AMD GPUs you most likely want to keep either the defaults - or "amdgpu" (both free). - + + For recent AMD GPUs you most likely want to keep either the defaults or "amdgpu" (both free). + Touchpads - Support for Synaptics touchpads (found in many laptops such as the Dell - Latitude series) can be enabled as follows: + Support for Synaptics touchpads (found in many laptops such as the Dell Latitude series) can be enabled as follows: = true; - The driver has many options (see ). For - instance, the following disables tap-to-click behavior: + The driver has many options (see ). For instance, the following disables tap-to-click behavior: = false; - Note: the use of services.xserver.synaptics is deprecated - since NixOS 17.09. + Note: the use of services.xserver.synaptics is deprecated since NixOS 17.09. GTK/Qt themes - GTK themes can be installed either to user profile or system-wide (via - environment.systemPackages). To make Qt 5 applications - look similar to GTK2 ones, you can install qt5.qtbase.gtk - package into your system environment. It should work for all Qt 5 library - versions. + GTK themes can be installed either to user profile or system-wide (via environment.systemPackages). To make Qt 5 applications look similar to GTK2 ones, you can install qt5.qtbase.gtk package into your system environment. It should work for all Qt 5 library versions. Custom XKB layouts - It is possible to install custom - - XKB - - keyboard layouts using the option - . - As a first example, we are going to create a layout based on the basic US - layout, with an additional layer to type some greek symbols by pressing the - right-alt key. + It is possible to install custom XKB keyboard layouts using the option . As a first example, we are going to create a layout based on the basic US layout, with an additional layer to type some greek symbols by pressing the right-alt key. - To do this we are going to create a us-greek file - with a xkb_symbols section. + To do this we are going to create a us-greek file with a xkb_symbols section. xkb_symbols "us-greek" @@ -194,8 +153,7 @@ xkb_symbols "us-greek" }; - To install the layout, the filepath, a description and the list of - languages must be given: + To install the layout, the filepath, a description and the list of languages must be given: .us-greek = { @@ -205,32 +163,18 @@ xkb_symbols "us-greek" } - - The name should match the one given to the - xkb_symbols block. - + + The name should match the one given to the xkb_symbols block. + - The layout should now be installed and ready to use: try it by - running setxkbmap us-greek and type - <alt>+a. To change the default the usual - - option can still be used. + The layout should now be installed and ready to use: try it by running setxkbmap us-greek and type <alt>+a. To change the default the usual option can still be used. - A layout can have several other components besides - xkb_symbols, for example we will define new - keycodes for some multimedia key and bind these to some symbol. + A layout can have several other components besides xkb_symbols, for example we will define new keycodes for some multimedia key and bind these to some symbol. - Use the xev utility from - pkgs.xorg.xev to find the codes of the keys of - interest, then create a media-key file to hold - the keycodes definitions + Use the xev utility from pkgs.xorg.xev to find the codes of the keys of interest, then create a media-key file to hold the keycodes definitions xkb_keycodes "media" @@ -240,7 +184,7 @@ xkb_keycodes "media" } - Now use the newly define keycodes in media-sym: + Now use the newly define keycodes in media-sym: xkb_symbols "media" @@ -251,7 +195,7 @@ xkb_symbols "media" } - As before, to install the layout do + As before, to install the layout do .media = { @@ -262,37 +206,22 @@ xkb_symbols "media" }; - - The function pkgs.writeText <filename> <content> - can be useful if you prefer to keep the layout definitions - inside the NixOS configuration. - + + The function pkgs.writeText <filename> <content> can be useful if you prefer to keep the layout definitions inside the NixOS configuration. + - Unfortunately, the Xorg server does not (currently) support setting a - keymap directly but relies instead on XKB rules to select the matching - components (keycodes, types, ...) of a layout. This means that components - other than symbols won't be loaded by default. As a workaround, you - can set the keymap using setxkbmap at the start of the - session with: + Unfortunately, the Xorg server does not (currently) support setting a keymap directly but relies instead on XKB rules to select the matching components (keycodes, types, ...) of a layout. This means that components other than symbols won't be loaded by default. As a workaround, you can set the keymap using setxkbmap at the start of the session with: = "setxkbmap -keycodes media"; - If you are manually starting the X server, you should set the argument - -xkbdir /etc/X11/xkb, otherwise X won't find your layout files. - For example with xinit run - $ xinit -- -xkbdir /etc/X11/xkb + If you are manually starting the X server, you should set the argument -xkbdir /etc/X11/xkb, otherwise X won't find your layout files. For example with xinit run +$ xinit -- -xkbdir /etc/X11/xkb - To learn how to write layouts take a look at the XKB - - documentation - . More example layouts can also be found - - here - . + To learn how to write layouts take a look at the XKB documentation . More example layouts can also be found here . - + diff --git a/nixos/doc/manual/configuration/xfce.xml b/nixos/doc/manual/configuration/xfce.xml index 6ac99c6b2bee..7a93a452fd9d 100644 --- a/nixos/doc/manual/configuration/xfce.xml +++ b/nixos/doc/manual/configuration/xfce.xml @@ -14,8 +14,7 @@ - Optionally, compton can be enabled for nice graphical - effects, some example settings: + Optionally, compton can be enabled for nice graphical effects, some example settings: services.compton = { enable = true; @@ -27,9 +26,7 @@ - Some Xfce programs are not installed automatically. To install them manually - (system wide), put them into your - . + Some Xfce programs are not installed automatically. To install them manually (system wide), put them into your . Thunar Volume Support @@ -44,25 +41,17 @@ Polkit Authentication Agent - There is no authentication agent automatically installed alongside Xfce. To - allow mounting of local (non-removable) filesystems, you will need to - install one. Installing polkit_gnome, a rebuild, logout - and login did the trick. + There is no authentication agent automatically installed alongside Xfce. To allow mounting of local (non-removable) filesystems, you will need to install one. Installing polkit_gnome, a rebuild, logout and login did the trick. Troubleshooting - Even after enabling udisks2, volume management might not work. Thunar and/or - the desktop takes time to show up. Thunar will spit out this kind of message - on start (look at journalctl --user -b). + Even after enabling udisks2, volume management might not work. Thunar and/or the desktop takes time to show up. Thunar will spit out this kind of message on start (look at journalctl --user -b). Thunar:2410): GVFS-RemoteVolumeMonitor-WARNING **: remote volume monitor with dbus name org.gtk.Private.UDisks2VolumeMonitor is not supported - This is caused by some needed GNOME services not running. This is all fixed - by enabling "Launch GNOME services on startup" in the Advanced tab of the - Session and Startup settings panel. Alternatively, you can run this command - to do the same thing. + This is caused by some needed GNOME services not running. This is all fixed by enabling "Launch GNOME services on startup" in the Advanced tab of the Session and Startup settings panel. Alternatively, you can run this command to do the same thing. $ xfconf-query -c xfce4-session -p /compat/LaunchGNOME -s true diff --git a/nixos/doc/manual/development/assertions.xml b/nixos/doc/manual/development/assertions.xml index 32f90cf2e7c4..c7d5b960aa6b 100644 --- a/nixos/doc/manual/development/assertions.xml +++ b/nixos/doc/manual/development/assertions.xml @@ -6,18 +6,11 @@ Warnings and Assertions - When configuration problems are detectable in a module, it is a good idea to - write an assertion or warning. Doing so provides clear feedback to the user - and prevents errors after the build. + When configuration problems are detectable in a module, it is a good idea to write an assertion or warning. Doing so provides clear feedback to the user and prevents errors after the build. - Although Nix has the abort and - builtins.trace - functions - to perform such tasks, they are not ideally suited for NixOS modules. Instead - of these functions, you can declare your warnings and assertions using the - NixOS module system. + Although Nix has the abort and builtins.trace functions to perform such tasks, they are not ideally suited for NixOS modules. Instead of these functions, you can declare your warnings and assertions using the NixOS module system.
@@ -48,12 +41,7 @@ Assertions - This example, extracted from the - - syslogd module shows how to use - assertions. Since there can only be one active syslog - daemon at a time, an assertion is useful to prevent such a broken system - from being built. + This example, extracted from the syslogd module shows how to use assertions. Since there can only be one active syslog daemon at a time, an assertion is useful to prevent such a broken system from being built. diff --git a/nixos/doc/manual/development/building-nixos.xml b/nixos/doc/manual/development/building-nixos.xml index 56a596baed00..a4bb18656e00 100644 --- a/nixos/doc/manual/development/building-nixos.xml +++ b/nixos/doc/manual/development/building-nixos.xml @@ -5,22 +5,17 @@ xml:id="sec-building-cd"> Building Your Own NixOS CD - Building a NixOS CD is as easy as configuring your own computer. The idea is - to use another module which will replace your - configuration.nix to configure the system that would be - installed on the CD. + Building a NixOS CD is as easy as configuring your own computer. The idea is to use another module which will replace your configuration.nix to configure the system that would be installed on the CD. - Default CD/DVD configurations are available inside - nixos/modules/installer/cd-dvd. + Default CD/DVD configurations are available inside nixos/modules/installer/cd-dvd. $ git clone https://github.com/NixOS/nixpkgs.git $ cd nixpkgs/nixos $ nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-minimal.nix default.nix - Before burning your CD/DVD, you can check the content of the image by - mounting anywhere like suggested by the following command: + Before burning your CD/DVD, you can check the content of the image by mounting anywhere like suggested by the following command: # mount -o loop -t iso9660 ./result/iso/cd.iso /mnt/iso diff --git a/nixos/doc/manual/development/building-parts.xml b/nixos/doc/manual/development/building-parts.xml index 88369fb891b3..e05a1342b7aa 100644 --- a/nixos/doc/manual/development/building-parts.xml +++ b/nixos/doc/manual/development/building-parts.xml @@ -5,14 +5,11 @@ xml:id="sec-building-parts"> Building Specific Parts of NixOS - With the command nix-build, you can build specific parts - of your NixOS configuration. This is done as follows: + With the command nix-build, you can build specific parts of your NixOS configuration. This is done as follows: $ cd /path/to/nixpkgs/nixos $ nix-build -A config.option - where option is a NixOS option with type - “derivation” (i.e. something that can be built). Attributes of interest - include: + where option is a NixOS option with type “derivation” (i.e. something that can be built). Attributes of interest include: @@ -20,10 +17,7 @@ - The top-level option that builds the entire NixOS system. Everything else - in your configuration is indirectly pulled in by this option. This is - what nixos-rebuild builds and what - /run/current-system points to afterwards. + The top-level option that builds the entire NixOS system. Everything else in your configuration is indirectly pulled in by this option. This is what nixos-rebuild builds and what /run/current-system points to afterwards. A shortcut to build this is: @@ -48,8 +42,7 @@ - A tree of symlinks that form the static parts of - /etc. + A tree of symlinks that form the static parts of /etc. @@ -62,9 +55,7 @@ - The initial ramdisk and kernel of the system. This allows a quick way to - test whether the kernel and the initial ramdisk boot correctly, by using - QEMU’s and options: + The initial ramdisk and kernel of the system. This allows a quick way to test whether the kernel and the initial ramdisk boot correctly, by using QEMU’s and options: $ nix-build -A config.system.build.initialRamdisk -o initrd $ nix-build -A config.system.build.kernel -o kernel @@ -95,24 +86,18 @@ - This builds the unit with the specified name. Note that since unit names - contain dots (e.g. httpd.service), you need to put - them between quotes, like this: + This builds the unit with the specified name. Note that since unit names contain dots (e.g. httpd.service), you need to put them between quotes, like this: $ nix-build -A 'config.systemd.units."httpd.service".unit' - You can also test individual units, without rebuilding the whole system, - by putting them in /run/systemd/system: + You can also test individual units, without rebuilding the whole system, by putting them in /run/systemd/system: $ cp $(nix-build -A 'config.systemd.units."httpd.service".unit')/httpd.service \ /run/systemd/system/tmp-httpd.service # systemctl daemon-reload # systemctl start tmp-httpd.service - Note that the unit must not have the same name as any unit in - /etc/systemd/system since those take precedence over - /run/systemd/system. That’s why the unit is - installed as tmp-httpd.service here. + Note that the unit must not have the same name as any unit in /etc/systemd/system since those take precedence over /run/systemd/system. That’s why the unit is installed as tmp-httpd.service here. diff --git a/nixos/doc/manual/development/importing-modules.xml b/nixos/doc/manual/development/importing-modules.xml index 1c6a5671eda8..0d57681783e2 100644 --- a/nixos/doc/manual/development/importing-modules.xml +++ b/nixos/doc/manual/development/importing-modules.xml @@ -6,8 +6,7 @@ Importing Modules - Sometimes NixOS modules need to be used in configuration but exist outside of - Nixpkgs. These modules can be imported: + Sometimes NixOS modules need to be used in configuration but exist outside of Nixpkgs. These modules can be imported: @@ -25,9 +24,7 @@ - The environment variable NIXOS_EXTRA_MODULE_PATH is an - absolute path to a NixOS module that is included alongside the Nixpkgs NixOS - modules. Like any NixOS module, this module can import additional modules: + The environment variable NIXOS_EXTRA_MODULE_PATH is an absolute path to a NixOS module that is included alongside the Nixpkgs NixOS modules. Like any NixOS module, this module can import additional modules: diff --git a/nixos/doc/manual/development/meta-attributes.xml b/nixos/doc/manual/development/meta-attributes.xml index 3d019a4987e1..fd15bd3638fd 100644 --- a/nixos/doc/manual/development/meta-attributes.xml +++ b/nixos/doc/manual/development/meta-attributes.xml @@ -6,18 +6,12 @@ Meta Attributes - Like Nix packages, NixOS modules can declare meta-attributes to provide extra - information. Module meta attributes are defined in the - meta.nix - special module. + Like Nix packages, NixOS modules can declare meta-attributes to provide extra information. Module meta attributes are defined in the meta.nix special module. - meta is a top level attribute like - options and config. Available - meta-attributes are maintainers and - doc. + meta is a top level attribute like options and config. Available meta-attributes are maintainers and doc. @@ -51,11 +45,8 @@ - doc points to a valid DocBook file containing the module - documentation. Its contents is automatically added to - . Changes to a module documentation - have to be checked to not break building the NixOS manual: + doc points to a valid DocBook file containing the module documentation. Its contents is automatically added to . Changes to a module documentation have to be checked to not break building the NixOS manual: $ nix-build nixos/release.nix -A manual diff --git a/nixos/doc/manual/development/nixos-tests.xml b/nixos/doc/manual/development/nixos-tests.xml index 2695082e3867..aedc40e93a6d 100644 --- a/nixos/doc/manual/development/nixos-tests.xml +++ b/nixos/doc/manual/development/nixos-tests.xml @@ -5,13 +5,8 @@ xml:id="sec-nixos-tests"> NixOS Tests - When you add some feature to NixOS, you should write a test for it. NixOS - tests are kept in the directory - nixos/tests, - and are executed (using Nix) by a testing framework that automatically starts - one or more virtual machines containing the NixOS system(s) required for the - test. + When you add some feature to NixOS, you should write a test for it. NixOS tests are kept in the directory nixos/tests, and are executed (using Nix) by a testing framework that automatically starts one or more virtual machines containing the NixOS system(s) required for the test. diff --git a/nixos/doc/manual/development/option-declarations.xml b/nixos/doc/manual/development/option-declarations.xml index eee81bf64263..d6fb3f8f687d 100644 --- a/nixos/doc/manual/development/option-declarations.xml +++ b/nixos/doc/manual/development/option-declarations.xml @@ -6,9 +6,7 @@ Option Declarations - An option declaration specifies the name, type and description of a NixOS - configuration option. It is invalid to define an option that hasn’t been - declared in any module. An option declaration generally looks like this: + An option declaration specifies the name, type and description of a NixOS configuration option. It is invalid to define an option that hasn’t been declared in any module. An option declaration generally looks like this: options = { name = mkOption { @@ -19,13 +17,8 @@ options = { }; }; - The attribute names within the name attribute path - must be camel cased in general but should, as an exception, match the - - package attribute name when referencing a Nixpkgs package. For - example, the option services.nix-serve.bindAddress - references the nix-serve Nixpkgs package. + The attribute names within the name attribute path must be camel cased in general but should, as an exception, match the package attribute name when referencing a Nixpkgs package. For example, the option services.nix-serve.bindAddress references the nix-serve Nixpkgs package. @@ -37,9 +30,7 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming"> - The type of the option (see ). It may - be omitted, but that’s not advisable since it may lead to errors that - are hard to diagnose. + The type of the option (see ). It may be omitted, but that’s not advisable since it may lead to errors that are hard to diagnose. @@ -49,10 +40,7 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming"> - The default value used if no value is defined by any module. A default is - not required; but if a default is not given, then users of the module - will have to define the value of the option, otherwise an error will be - thrown. + The default value used if no value is defined by any module. A default is not required; but if a default is not given, then users of the module will have to define the value of the option, otherwise an error will be thrown. @@ -72,8 +60,7 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming"> - A textual description of the option, in DocBook format, that will be - included in the NixOS manual. + A textual description of the option, in DocBook format, that will be included in the NixOS manual. @@ -84,22 +71,15 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming"> Extensible Option Types - Extensible option types is a feature that allow to extend certain types - declaration through multiple module files. This feature only work with a - restricted set of types, namely enum and - submodules and any composed forms of them. + Extensible option types is a feature that allow to extend certain types declaration through multiple module files. This feature only work with a restricted set of types, namely enum and submodules and any composed forms of them. - Extensible option types can be used for enum options that - affects multiple modules, or as an alternative to related - enable options. + Extensible option types can be used for enum options that affects multiple modules, or as an alternative to related enable options. - 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 - per display manager backend (slim, sddm, gdm ...). + 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 per display manager backend (slim, sddm, gdm ...). @@ -107,14 +87,12 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming"> - Managing the display managers independently by adding an enable option to - every display manager module backend. (NixOS) + Managing the display managers independently by adding an enable option to every display manager module backend. (NixOS) - Managing the display managers in the central module by adding an option - to select which display manager backend to use. + Managing the display managers in the central module by adding an option to select which display manager backend to use. @@ -125,37 +103,22 @@ xlink:href="https://nixos.org/nixpkgs/manual/#sec-package-naming"> - Making backends independent can quickly become hard to manage. For display - managers, there can be only one enabled at a time, but the type system can - not enforce this restriction as there is no relation between each backend - enable option. As a result, this restriction has to be - done explicitely by adding assertions in each display manager backend - module. + Making backends independent can quickly become hard to manage. For display managers, there can be only one enabled at a time, but the type system can not enforce this restriction as there is no relation between each backend enable option. As a result, this restriction has to be done explicitely by adding assertions in each display manager backend module. - On the other hand, managing the display managers backends in the central - module will require to change the central module option every time a new - backend is added or removed. + On the other hand, managing the display managers backends in the central module will require to change the central module option every time a new backend is added or removed. - By using extensible option types, it is possible to create a placeholder - option in the central module - (), and to extend - it in each backend module - (, - ), and to extend it in each backend module (, ). - As a result, displayManager.enable option values can be - added without changing the main service module file and the type system - automatically enforce that there can only be a single display manager - enabled. + As a result, displayManager.enable option values can be added without changing the main service module file and the type system automatically enforce that there can only be a single display manager enabled. @@ -184,16 +147,11 @@ services.xserver.displayManager.enable = mkOption { - The placeholder declaration is a standard mkOption - declaration, but it is important that extensible option declarations only - use the type argument. + The placeholder declaration is a standard mkOption declaration, but it is important that extensible option declarations only use the type argument. - Extensible option types work with any of the composed variants of - enum such as with types; nullOr (enum [ "foo" - "bar" ]) or with types; listOf (enum [ "foo" "bar" - ]). + Extensible option types work with any of the composed variants of enum such as with types; nullOr (enum [ "foo" "bar" ]) or with types; listOf (enum [ "foo" "bar" ]).
diff --git a/nixos/doc/manual/development/option-def.xml b/nixos/doc/manual/development/option-def.xml index 50a705d0cb8e..883778c7eb96 100644 --- a/nixos/doc/manual/development/option-def.xml +++ b/nixos/doc/manual/development/option-def.xml @@ -6,33 +6,26 @@ Option Definitions - Option definitions are generally straight-forward bindings of values to - option names, like + Option definitions are generally straight-forward bindings of values to option names, like config = { services.httpd.enable = true; }; - However, sometimes you need to wrap an option definition or set of option - definitions in a property to achieve certain effects: + However, sometimes you need to wrap an option definition or set of option definitions in a property to achieve certain effects: Delaying Conditionals - If a set of option definitions is conditional on the value of another - option, you may need to use mkIf. Consider, for instance: + If a set of option definitions is conditional on the value of another option, you may need to use mkIf. Consider, for instance: config = if config.services.httpd.enable then { environment.systemPackages = [ ... ]; ... } else {}; - This definition will cause Nix to fail with an “infinite recursion” - error. Why? Because the value of - depends on the value being - constructed here. After all, you could also write the clearly circular and - contradictory: + This definition will cause Nix to fail with an “infinite recursion” error. Why? Because the value of depends on the value being constructed here. After all, you could also write the clearly circular and contradictory: config = if config.services.httpd.enable then { services.httpd.enable = false; @@ -47,9 +40,7 @@ config = mkIf config.services.httpd.enable { ... }; - The special function mkIf causes the evaluation of the - conditional to be “pushed down” into the individual definitions, as if - you had written: + The special function mkIf causes the evaluation of the conditional to be “pushed down” into the individual definitions, as if you had written: config = { environment.systemPackages = if config.services.httpd.enable then [ ... ] else []; @@ -62,27 +53,18 @@ config = { Setting Priorities - A module can override the definitions of an option in other modules by - setting a priority. All option definitions that do not - have the lowest priority value are discarded. By default, option definitions - have priority 1000. You can specify an explicit priority by using - mkOverride, e.g. + A module can override the definitions of an option in other modules by setting a priority. All option definitions that do not have the lowest priority value are discarded. By default, option definitions have priority 1000. You can specify an explicit priority by using mkOverride, e.g. services.openssh.enable = mkOverride 10 false; - This definition causes all other definitions with priorities above 10 to be - discarded. The function mkForce is equal to - mkOverride 50. + This definition causes all other definitions with priorities above 10 to be discarded. The function mkForce is equal to mkOverride 50. Merging Configurations - In conjunction with mkIf, it is sometimes useful for a - module to return multiple sets of option definitions, to be merged together - as if they were declared in separate modules. This can be done using - mkMerge: + In conjunction with mkIf, it is sometimes useful for a module to return multiple sets of option definitions, to be merged together as if they were declared in separate modules. This can be done using mkMerge: config = mkMerge [ # Unconditional stuff. diff --git a/nixos/doc/manual/development/option-types.xml b/nixos/doc/manual/development/option-types.xml index 8fcbb627342b..7cd26e4c937d 100644 --- a/nixos/doc/manual/development/option-types.xml +++ b/nixos/doc/manual/development/option-types.xml @@ -6,18 +6,14 @@ Options Types - Option types are a way to put constraints on the values a module option can - take. Types are also responsible of how values are merged in case of multiple - value definitions. + Option types are a way to put constraints on the values a module option can take. Types are also responsible of how values are merged in case of multiple value definitions.
Basic Types - Basic types are the simplest available types in the module system. Basic - types include multiple string types that mainly differ in how definition - merging is handled. + Basic types are the simplest available types in the module system. Basic types include multiple string types that mainly differ in how definition merging is handled. @@ -37,8 +33,7 @@ - A boolean, its values can be true or - false. + A boolean, its values can be true or false. @@ -48,9 +43,7 @@ - A filesystem path, defined as anything that when coerced to a string - starts with a slash. Even if derivations can be considered as path, the - more specific types.package should be preferred. + A filesystem path, defined as anything that when coerced to a string starts with a slash. Even if derivations can be considered as path, the more specific types.package should be preferred. @@ -87,12 +80,7 @@ - Signed integers with a fixed length (8, 16 or 32 bits). They go from - −2n/2 - to - 2n/2−1 - respectively (e.g. −128 to - 127 for 8 bits). + Signed integers with a fixed length (8, 16 or 32 bits). They go from −2n/2 to 2n/2−1 respectively (e.g. −128 to 127 for 8 bits). @@ -112,12 +100,7 @@ - Unsigned integers with a fixed length (8, 16 or 32 bits). They go from - 0 to - - 2n−1 - respectively (e.g. 0 to - 255 for 8 bits). + Unsigned integers with a fixed length (8, 16 or 32 bits). They go from 0 to 2n−1 respectively (e.g. 0 to 255 for 8 bits). @@ -137,8 +120,7 @@ - A port number. This type is an alias to - types.ints.u16. + A port number. This type is an alias to types.ints.u16. @@ -165,8 +147,7 @@ - A string. Multiple definitions are concatenated with a new line - "\n". + A string. Multiple definitions are concatenated with a new line "\n". @@ -176,8 +157,7 @@ - A string. Multiple definitions are concatenated with a comma - ",". + A string. Multiple definitions are concatenated with a comma ",". @@ -187,8 +167,7 @@ - A string. Multiple definitions are concatenated with a collon - ":". + A string. Multiple definitions are concatenated with a collon ":". @@ -198,9 +177,7 @@ - A string matching a specific regular expression. Multiple definitions - cannot be merged. The regular expression is processed using - builtins.match. + A string matching a specific regular expression. Multiple definitions cannot be merged. The regular expression is processed using builtins.match. @@ -221,9 +198,7 @@ - One element of the list l, e.g. - types.enum [ "left" "right" ]. Multiple definitions - cannot be merged. + One element of the list l, e.g. types.enum [ "left" "right" ]. Multiple definitions cannot be merged. @@ -233,8 +208,7 @@ - A string with a custom separator sep, e.g. - types.separatedString "|". + A string with a custom separator sep, e.g. types.separatedString "|". @@ -244,9 +218,7 @@ - An integer between lowest and - highest (both inclusive). Useful for creating - types like types.port. + An integer between lowest and highest (both inclusive). Useful for creating types like types.port. @@ -256,11 +228,7 @@ - A set of sub options o. - o can be an attribute set or a function - returning an attribute set. Submodules are used in composed types to - create modular options. Submodule are detailed in - o. o can be an attribute set or a function returning an attribute set. Submodules are used in composed types to create modular options. Submodule are detailed in . @@ -272,9 +240,7 @@ Composed Types - Composed types are types that take a type as parameter. listOf - int and either int str are examples of composed - types. + Composed types are types that take a type as parameter. listOf int and either int str are examples of composed types. @@ -284,8 +250,7 @@ - A list of t type, e.g. types.listOf - int. Multiple definitions are merged with list concatenation. + A list of t type, e.g. types.listOf int. Multiple definitions are merged with list concatenation. @@ -295,9 +260,7 @@ - An attribute set of where all the values are of - t type. Multiple definitions result in the - joined attribute set. + An attribute set of where all the values are of t type. Multiple definitions result in the joined attribute set. @@ -307,8 +270,7 @@ - An attribute set or a list of t type. Multiple - definitions are merged according to the value. + An attribute set or a list of t type. Multiple definitions are merged according to the value. @@ -318,8 +280,7 @@ - null or type t. Multiple - definitions are merged according to type t. + null or type t. Multiple definitions are merged according to type t. @@ -329,8 +290,7 @@ - Ensures that type t cannot be merged. It is - used to ensure option definitions are declared only once. + Ensures that type t cannot be merged. It is used to ensure option definitions are declared only once. @@ -340,9 +300,7 @@ - Type t1 or type t2, - e.g. with types; either int str. Multiple definitions - cannot be merged. + Type t1 or type t2, e.g. with types; either int str. Multiple definitions cannot be merged. @@ -352,9 +310,7 @@ - Type t1 or type t2 and so forth, - e.g. with types; oneOf [ int str bool ]. Multiple definitions - cannot be merged. + Type t1 or type t2 and so forth, e.g. with types; oneOf [ int str bool ]. Multiple definitions cannot be merged. @@ -364,12 +320,7 @@ - Type to or type - from which will be coerced to type - to using function f - which takes an argument of type from and - return a value of type to. Can be used to - preserve backwards compatibility of an option if its type was changed. + Type to or type from which will be coerced to type to using function f which takes an argument of type from and return a value of type to. Can be used to preserve backwards compatibility of an option if its type was changed. @@ -380,22 +331,15 @@ Submodule - submodule is a very powerful type that defines a set of - sub-options that are handled like a separate module. + submodule is a very powerful type that defines a set of sub-options that are handled like a separate module. - It takes a parameter o, that should be a set, or - a function returning a set with an options key defining - the sub-options. Submodule option definitions are type-checked accordingly - to the options declarations. Of course, you can nest - submodule option definitons for even higher modularity. + It takes a parameter o, that should be a set, or a function returning a set with an options key defining the sub-options. Submodule option definitions are type-checked accordingly to the options declarations. Of course, you can nest submodule option definitons for even higher modularity. - The option set can be defined directly - () or as reference - (). + The option set can be defined directly () or as reference (). @@ -438,12 +382,7 @@ options.mod = mkOption { - The submodule type is especially interesting when used - with composed types like attrsOf or - listOf. When composed with listOf - (), - submodule allows multiple definitions of the submodule - option set (). + The submodule type is especially interesting when used with composed types like attrsOf or listOf. When composed with listOf (), submodule allows multiple definitions of the submodule option set (). @@ -474,10 +413,7 @@ config.mod = [ - When composed with attrsOf - (), - submodule allows multiple named definitions of the - submodule option set (). + When composed with attrsOf (), submodule allows multiple named definitions of the submodule option set (). @@ -510,8 +446,7 @@ config.mod.two = { foo = 2; bar = "two"; }; Extending types - Types are mainly characterized by their check and - merge functions. + Types are mainly characterized by their check and merge functions. @@ -521,13 +456,8 @@ config.mod.two = { foo = 2; bar = "two"; }; - The function to type check the value. Takes a value as parameter and - return a boolean. It is possible to extend a type check with the - addCheck function - (), or to fully - override the check function - (). + The function to type check the value. Takes a value as parameter and return a boolean. It is possible to extend a type check with the addCheck function (), or to fully override the check function (). Adding a type check @@ -555,11 +485,7 @@ nixThings = mkOption { - Function to merge the options values when multiple values are set. The - function takes two parameters, loc the option path as - a list of strings, and defs the list of defined values - as a list. It is possible to override a type merge function for custom - needs. + Function to merge the options values when multiple values are set. The function takes two parameters, loc the option path as a list of strings, and defs the list of defined values as a list. It is possible to override a type merge function for custom needs. @@ -570,12 +496,8 @@ nixThings = mkOption { Custom Types - Custom types can be created with the mkOptionType - function. As type creation includes some more complex topics such as - submodule handling, it is recommended to get familiar with - types.nix - code before creating a new type. + Custom types can be created with the mkOptionType function. As type creation includes some more complex topics such as submodule handling, it is recommended to get familiar with types.nix code before creating a new type. @@ -599,8 +521,7 @@ nixThings = mkOption { - Description of the type used in documentation. Give information of the - type and any of its arguments. + Description of the type used in documentation. Give information of the type and any of its arguments. @@ -610,10 +531,7 @@ nixThings = mkOption { - A function to type check the definition value. Takes the definition value - as a parameter and returns a boolean indicating the type check result, - true for success and false for - failure. + A function to type check the definition value. Takes the definition value as a parameter and returns a boolean indicating the type check result, true for success and false for failure. @@ -632,8 +550,7 @@ nixThings = mkOption { - The option path as a list of strings, e.g. ["boot" "loader - "grub" "enable"]. + The option path as a list of strings, e.g. ["boot" "loader "grub" "enable"]. @@ -643,12 +560,7 @@ nixThings = mkOption { - The list of sets of defined value and - file where the value was defined, e.g. [ { - file = "/foo.nix"; value = 1; } { file = "/bar.nix"; value = 2 } - ]. The merge function should return the - merged value or throw an error in case the values are impossible or - not meant to be merged. + The list of sets of defined value and file where the value was defined, e.g. [ { file = "/foo.nix"; value = 1; } { file = "/bar.nix"; value = 2 } ]. The merge function should return the merged value or throw an error in case the values are impossible or not meant to be merged. @@ -661,13 +573,7 @@ nixThings = mkOption { - For composed types that can take a submodule as type parameter, this - function generate sub-options documentation. It takes the current option - prefix as a list and return the set of sub-options. Usually defined in a - recursive manner by adding a term to the prefix, e.g. prefix: - elemType.getSubOptions (prefix ++ - ["prefix"]) where - "prefix" is the newly added prefix. + For composed types that can take a submodule as type parameter, this function generate sub-options documentation. It takes the current option prefix as a list and return the set of sub-options. Usually defined in a recursive manner by adding a term to the prefix, e.g. prefix: elemType.getSubOptions (prefix ++ ["prefix"]) where "prefix" is the newly added prefix. @@ -677,11 +583,7 @@ nixThings = mkOption { - For composed types that can take a submodule as type parameter, this - function should return the type parameters submodules. If the type - parameter is called elemType, the function should just - recursively look into submodules by returning - elemType.getSubModules;. + For composed types that can take a submodule as type parameter, this function should return the type parameters submodules. If the type parameter is called elemType, the function should just recursively look into submodules by returning elemType.getSubModules;. @@ -691,14 +593,7 @@ nixThings = mkOption { - For composed types that can take a submodule as type parameter, this - function can be used to substitute the parameter of a submodule type. It - takes a module as parameter and return the type with the submodule - options substituted. It is usually defined as a type function call with a - recursive call to substSubModules, e.g for a type - composedType that take an elemtype - type parameter, this function should be defined as m: - composedType (elemType.substSubModules m). + For composed types that can take a submodule as type parameter, this function can be used to substitute the parameter of a submodule type. It takes a module as parameter and return the type with the submodule options substituted. It is usually defined as a type function call with a recursive call to substSubModules, e.g for a type composedType that take an elemtype type parameter, this function should be defined as m: composedType (elemType.substSubModules m). @@ -708,9 +603,7 @@ nixThings = mkOption { - A function to merge multiple type declarations. Takes the type to merge - functor as parameter. A null return - value means that type cannot be merged. + A function to merge multiple type declarations. Takes the type to merge functor as parameter. A null return value means that type cannot be merged. @@ -725,8 +618,7 @@ nixThings = mkOption { - Note: There is a generic defaultTypeMerge that work - with most of value and composed types. + Note: There is a generic defaultTypeMerge that work with most of value and composed types. @@ -736,8 +628,7 @@ nixThings = mkOption { - An attribute set representing the type. It is used for type operations - and has the following keys: + An attribute set representing the type. It is used for type operations and has the following keys: @@ -766,10 +657,7 @@ nixThings = mkOption { - Holds the value parameter for value types. The types that have a - payload are the enum, - separatedString and submodule - types. + Holds the value parameter for value types. The types that have a payload are the enum, separatedString and submodule types. @@ -779,9 +667,7 @@ nixThings = mkOption { - A binary operation that can merge the payloads of two same types. - Defined as a function that take two payloads as parameters and return - the payloads merged. + A binary operation that can merge the payloads of two same types. Defined as a function that take two payloads as parameters and return the payloads merged. diff --git a/nixos/doc/manual/development/releases.xml b/nixos/doc/manual/development/releases.xml index 1cdec64f69b0..8cc4490ff540 100755 --- a/nixos/doc/manual/development/releases.xml +++ b/nixos/doc/manual/development/releases.xml @@ -17,15 +17,12 @@ - Send an email to the nix-devel mailinglist as a warning about upcoming - beta "feature freeze" in a month. + Send an email to the nix-devel mailinglist as a warning about upcoming beta "feature freeze" in a month. - Discuss with Eelco Dolstra and the community (via IRC, ML) about what - will reach the deadline. Any issue or Pull Request targeting the release - should be included in the release milestone. + Discuss with Eelco Dolstra and the community (via IRC, ML) about what will reach the deadline. Any issue or Pull Request targeting the release should be included in the release milestone. @@ -37,42 +34,32 @@ - Create - an issue for tracking Zero Hydra Failures progress. ZHF is an effort to - get build failures down to zero. + Create an issue for tracking Zero Hydra Failures progress. ZHF is an effort to get build failures down to zero. - git tag -a -s -m "Release 17.09-beta" 17.09-beta - && git push --tags + git tag -a -s -m "Release 17.09-beta" 17.09-beta && git push --tags - From the master branch run git checkout -B - release-17.09. + From the master branch run git checkout -B release-17.09. - - Make sure a channel is created at http://nixos.org/channels/. + Make sure a channel is created at http://nixos.org/channels/. - - Bump the system.defaultChannel attribute in - nixos/modules/misc/version.nix + Bump the system.defaultChannel attribute in nixos/modules/misc/version.nix - - Update versionSuffix in - nixos/release.nix, use git log - --format=%an|wc -l to get the commit count + Update versionSuffix in nixos/release.nix, use git log --format=%an|wc -l to get the commit count @@ -82,44 +69,32 @@ - - Pick a new name for the unstable branch. + Pick a new name for the unstable branch. - Create a new release notes file for the upcoming release + 1, in this - case rl-1803.xml. + Create a new release notes file for the upcoming release + 1, in this case rl-1803.xml. - Create two Hydra jobsets: release-17.09 and release-17.09-small with - stableBranch set to false. + Create two Hydra jobsets: release-17.09 and release-17.09-small with stableBranch set to false. - Remove attributes that we know we will not be able to support, - especially if there is a stable alternative. E.g. Check that our - Linux kernels' - - projected end-of-life are after our release projected - end-of-life + Remove attributes that we know we will not be able to support, especially if there is a stable alternative. E.g. Check that our Linux kernels' projected end-of-life are after our release projected end-of-life - Edit changelog at - nixos/doc/manual/release-notes/rl-1709.xml (double - check desktop versions are noted) + Edit changelog at nixos/doc/manual/release-notes/rl-1709.xml (double check desktop versions are noted) - Get all new NixOS modules git diff - release-17.03..release-17.09 nixos/modules/module-list.nix|grep - ^+ + Get all new NixOS modules git diff release-17.03..release-17.09 nixos/modules/module-list.nix|grep ^+ @@ -138,8 +113,7 @@ - Monitor the master branch for bugfixes and minor updates and cherry-pick - them to the release branch. + Monitor the master branch for bugfixes and minor updates and cherry-pick them to the release branch. @@ -156,21 +130,17 @@ - Release Nix (currently only Eelco Dolstra can do that). - - Make sure fallback is updated. + Release Nix (currently only Eelco Dolstra can do that). Make sure fallback is updated. - - Update README.md with new stable NixOS version information. + Update README.md with new stable NixOS version information. - Change stableBranch to true and wait for channel to - update. + Change stableBranch to true and wait for channel to update. @@ -187,34 +157,27 @@ - Update "Chapter 4. Upgrading NixOS" section of the manual to match - new stable release version. + Update "Chapter 4. Upgrading NixOS" section of the manual to match new stable release version. - Update http://nixos.org/nixos/download.html and - http://nixos.org/nixos/manual in - https://github.com/NixOS/nixos-org-configurations + Update http://nixos.org/nixos/download.html and http://nixos.org/nixos/manual in https://github.com/NixOS/nixos-org-configurations - Get number of commits for the release: git log - release-14.04..release-14.12 --format=%an|wc -l + Get number of commits for the release: git log release-14.04..release-14.12 --format=%an|wc -l - Commits by contributor: git log release-14.04..release-14.12 - --format=%an|sort|uniq -c|sort -rn + Commits by contributor: git log release-14.04..release-14.12 --format=%an|sort|uniq -c|sort -rn - Send an email to nix-dev to announce the release with above information. - Best to check how previous email was formulated to see what needs to be - included. + Send an email to nix-dev to announce the release with above information. Best to check how previous email was formulated to see what needs to be included. @@ -222,26 +185,45 @@
Release Management Team + - For each release there are two release managers. After each release the - release manager having managed two releases steps down and the release - management team of the last release appoints a new release manager. + For each release there are two release managers. After each release the release manager having managed two releases steps down and the release management team of the last release appoints a new release manager. + - This makes sure a release management team always consists of one release - manager who already has managed one release and one release manager being - introduced to their role, making it easier to pass on knowledge and - experience. + This makes sure a release management team always consists of one release manager who already has managed one release and one release manager being introduced to their role, making it easier to pass on knowledge and experience. + A release manager's role and responsibilities are: + - manage the release process - start discussions about features and changes for a given release - create a roadmap - release in cooperation with Eelco Dolstra - decide which bug fixes, features, etc... get backported after a release + + + manage the release process + + + + + start discussions about features and changes for a given release + + + + + create a roadmap + + + + + release in cooperation with Eelco Dolstra + + + + + decide which bug fixes, features, etc... get backported after a release + +
diff --git a/nixos/doc/manual/development/replace-modules.xml b/nixos/doc/manual/development/replace-modules.xml index 7b103c36d907..9940143de8e4 100644 --- a/nixos/doc/manual/development/replace-modules.xml +++ b/nixos/doc/manual/development/replace-modules.xml @@ -6,27 +6,15 @@ Replace Modules - Modules that are imported can also be disabled. The option declarations and - config implementation of a disabled module will be ignored, allowing another - to take it's place. This can be used to import a set of modules from another - channel while keeping the rest of the system on a stable release. + Modules that are imported can also be disabled. The option declarations and config implementation of a disabled module will be ignored, allowing another to take it's place. This can be used to import a set of modules from another channel while keeping the rest of the system on a stable release. - disabledModules is a top level attribute like - imports, options and - config. It contains a list of modules that will be - disabled. This can either be the full path to the module or a string with the - filename relative to the modules path (eg. <nixpkgs/nixos/modules> for - nixos). + disabledModules is a top level attribute like imports, options and config. It contains a list of modules that will be disabled. This can either be the full path to the module or a string with the filename relative to the modules path (eg. <nixpkgs/nixos/modules> for nixos). - This example will replace the existing postgresql module with the version - defined in the nixos-unstable channel while keeping the rest of the modules - and packages from the original nixos channel. This only overrides the module - definition, this won't use postgresql from nixos-unstable unless explicitly - configured to do so. + This example will replace the existing postgresql module with the version defined in the nixos-unstable channel while keeping the rest of the modules and packages from the original nixos channel. This only overrides the module definition, this won't use postgresql from nixos-unstable unless explicitly configured to do so. @@ -46,9 +34,7 @@ - This example shows how to define a custom module as a replacement for an - existing module. Importing this module will disable the original module - without having to know it's implementation details. + This example shows how to define a custom module as a replacement for an existing module. Importing this module will disable the original module without having to know it's implementation details. diff --git a/nixos/doc/manual/development/running-nixos-tests-interactively.xml b/nixos/doc/manual/development/running-nixos-tests-interactively.xml index e390d62fde2f..e4ded136ca66 100644 --- a/nixos/doc/manual/development/running-nixos-tests-interactively.xml +++ b/nixos/doc/manual/development/running-nixos-tests-interactively.xml @@ -6,8 +6,7 @@ Running Tests interactively - The test itself can be run interactively. This is particularly useful when - developing or debugging a test: + The test itself can be run interactively. This is particularly useful when developing or debugging a test: $ nix-build nixos/tests/login.nix -A driver $ ./result/bin/nixos-test-driver @@ -21,10 +20,7 @@ starting VDE switch for network 1 > $machine->succeed("touch /tmp/foo") > print($machine->succeed("pwd")) # Show stdout of command - The function testScript executes the entire test script - 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 - the test script). + The function testScript executes the entire test script 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 the test script). @@ -33,12 +29,10 @@ starting VDE switch for network 1 $ nix-build nixos/tests/login.nix -A driver $ ./result/bin/nixos-run-vms - The script nixos-run-vms starts the virtual machines - defined by test. + The script nixos-run-vms starts the virtual machines defined by test. - The machine state is kept across VM restarts in - /tmp/vm-state-machinename. + The machine state is kept across VM restarts in /tmp/vm-state-machinename.
diff --git a/nixos/doc/manual/development/running-nixos-tests.xml b/nixos/doc/manual/development/running-nixos-tests.xml index 13ae1ed93699..7d81be9b1c6a 100644 --- a/nixos/doc/manual/development/running-nixos-tests.xml +++ b/nixos/doc/manual/development/running-nixos-tests.xml @@ -6,11 +6,8 @@ Running Tests - You can run tests using nix-build. For example, to run the - test - login.nix, - you just do: + You can run tests using nix-build. For example, to run the test login.nix, you just do: $ nix-build '<nixpkgs/nixos/tests/login.nix>' @@ -24,11 +21,7 @@ machine: QEMU running (pid 8841) … 6 out of 6 tests succeeded - After building/downloading all required dependencies, this will perform a - build that starts a QEMU/KVM virtual machine containing a NixOS system. The - virtual machine mounts the Nix store of the host; this makes VM creation very - fast, as no disk image needs to be created. Afterwards, you can view a - pretty-printed log of the test: + After building/downloading all required dependencies, this will perform a build that starts a QEMU/KVM virtual machine containing a NixOS system. The virtual machine mounts the Nix store of the host; this makes VM creation very fast, as no disk image needs to be created. Afterwards, you can view a pretty-printed log of the test: $ firefox result/log.html diff --git a/nixos/doc/manual/development/sources.xml b/nixos/doc/manual/development/sources.xml index 3c30c782746d..71441feb1ff7 100644 --- a/nixos/doc/manual/development/sources.xml +++ b/nixos/doc/manual/development/sources.xml @@ -5,77 +5,47 @@ xml:id="sec-getting-sources"> Getting the Sources - By default, NixOS’s nixos-rebuild command uses the NixOS - and Nixpkgs sources provided by the nixos channel (kept in - /nix/var/nix/profiles/per-user/root/channels/nixos). To - modify NixOS, however, you should check out the latest sources from Git. This - is as follows: + By default, NixOS’s nixos-rebuild command uses the NixOS and Nixpkgs sources provided by the nixos channel (kept in /nix/var/nix/profiles/per-user/root/channels/nixos). To modify NixOS, however, you should check out the latest sources from Git. This is as follows: $ git clone https://github.com/NixOS/nixpkgs $ cd nixpkgs $ git remote add channels https://github.com/NixOS/nixpkgs-channels $ git remote update channels - This will check out the latest Nixpkgs sources to - ./nixpkgs the NixOS sources to - ./nixpkgs/nixos. (The NixOS source tree lives in a - subdirectory of the Nixpkgs repository.) The remote - channels refers to a read-only repository that tracks the - Nixpkgs/NixOS channels (see for more - information about channels). Thus, the Git branch - channels/nixos-17.03 will contain the latest built and - tested version available in the nixos-17.03 channel. + This will check out the latest Nixpkgs sources to ./nixpkgs the NixOS sources to ./nixpkgs/nixos. (The NixOS source tree lives in a subdirectory of the Nixpkgs repository.) The remote channels refers to a read-only repository that tracks the Nixpkgs/NixOS channels (see for more information about channels). Thus, the Git branch channels/nixos-17.03 will contain the latest built and tested version available in the nixos-17.03 channel. - It’s often inconvenient to develop directly on the master branch, since if - somebody has just committed (say) a change to GCC, then the binary cache may - not have caught up yet and you’ll have to rebuild everything from source. - So you may want to create a local branch based on your current NixOS version: + It’s often inconvenient to develop directly on the master branch, since if somebody has just committed (say) a change to GCC, then the binary cache may not have caught up yet and you’ll have to rebuild everything from source. So you may want to create a local branch based on your current NixOS version: $ nixos-version 17.09pre104379.6e0b727 (Hummingbird) $ git checkout -b local 6e0b727 - Or, to base your local branch on the latest version available in a NixOS - channel: + Or, to base your local branch on the latest version available in a NixOS channel: $ git remote update channels $ git checkout -b local channels/nixos-17.03 - (Replace nixos-17.03 with the name of the channel you want - to use.) You can use git merge or git - rebase to keep your local branch in sync with the channel, e.g. + (Replace nixos-17.03 with the name of the channel you want to use.) You can use git merge or git rebase to keep your local branch in sync with the channel, e.g. $ git remote update channels $ git merge channels/nixos-17.03 - You can use git cherry-pick to copy commits from your - local branch to the upstream branch. + You can use git cherry-pick to copy commits from your local branch to the upstream branch. - If you want to rebuild your system using your (modified) sources, you need to - tell nixos-rebuild about them using the - flag: + If you want to rebuild your system using your (modified) sources, you need to tell nixos-rebuild about them using the flag: # nixos-rebuild switch -I nixpkgs=/my/sources/nixpkgs - If you want nix-env to use the expressions in - /my/sources, use nix-env -f - /my/sources/nixpkgs, or change the - default by adding a symlink in ~/.nix-defexpr: + If you want nix-env to use the expressions in /my/sources, use nix-env -f /my/sources/nixpkgs, or change the default by adding a symlink in ~/.nix-defexpr: $ ln -s /my/sources/nixpkgs ~/.nix-defexpr/nixpkgs - You may want to delete the symlink - ~/.nix-defexpr/channels_root to prevent root’s NixOS - channel from clashing with your own tree (this may break the - command-not-found utility though). If you want to go back to the default - state, you may just remove the ~/.nix-defexpr directory - completely, log out and log in again and it should have been recreated with a - link to the root channels. + You may want to delete the symlink ~/.nix-defexpr/channels_root to prevent root’s NixOS channel from clashing with your own tree (this may break the command-not-found utility though). If you want to go back to the default state, you may just remove the ~/.nix-defexpr directory completely, log out and log in again and it should have been recreated with a link to the root channels. - nixos-rebuild reconfigure a NixOS machine - - nixos-rebuild + nixos-rebuild - + - + - + - + - + - + - + - + @@ -56,34 +54,33 @@ - + - + - + - + - + builder-spec - - + - + @@ -93,56 +90,67 @@ + - - path + path + - - - - + + + + + + + + + + - - - - - number + + + + + + + + + number + - - - - + + + + + + + + + + - - - - + + + + + + + + + - Description - - This command updates the system so that it corresponds to the configuration - specified in /etc/nixos/configuration.nix. Thus, every - time you modify /etc/nixos/configuration.nix or any - NixOS module, you must run nixos-rebuild to make the - changes take effect. It builds the new system in - /nix/store, runs its activation script, and stop and - (re)starts any system services if needed. Please note that user services need - to be started manually as they aren't detected by the activation script at the moment. + This command updates the system so that it corresponds to the configuration specified in /etc/nixos/configuration.nix. Thus, every time you modify /etc/nixos/configuration.nix or any NixOS module, you must run nixos-rebuild to make the changes take effect. It builds the new system in /nix/store, runs its activation script, and stop and (re)starts any system services if needed. Please note that user services need to be started manually as they aren't detected by the activation script at the moment. - - This command has one required argument, which specifies the desired - operation. It must be one of the following: - + This command has one required argument, which specifies the desired operation. It must be one of the following: @@ -150,91 +158,64 @@ - Build and activate the new configuration, and make it the boot default. - That is, the configuration is added to the GRUB boot menu as the default - menu entry, so that subsequent reboots will boot the system into the new - configuration. Previous configurations activated with - nixos-rebuild switch or nixos-rebuild - boot remain available in the GRUB menu. + Build and activate the new configuration, and make it the boot default. That is, the configuration is added to the GRUB boot menu as the default menu entry, so that subsequent reboots will boot the system into the new configuration. Previous configurations activated with nixos-rebuild switch or nixos-rebuild boot remain available in the GRUB menu. - - Build the new configuration and make it the boot default (as with - nixos-rebuild switch), but do not activate it. That - is, the system continues to run the previous configuration until the - next reboot. + Build the new configuration and make it the boot default (as with nixos-rebuild switch), but do not activate it. That is, the system continues to run the previous configuration until the next reboot. - - Build and activate the new configuration, but do not add it to the GRUB - boot menu. Thus, if you reboot the system (or if it crashes), you will - automatically revert to the default configuration (i.e. the - configuration resulting from the last call to nixos-rebuild - switch or nixos-rebuild boot). + Build and activate the new configuration, but do not add it to the GRUB boot menu. Thus, if you reboot the system (or if it crashes), you will automatically revert to the default configuration (i.e. the configuration resulting from the last call to nixos-rebuild switch or nixos-rebuild boot). - - Build the new configuration, but neither activate it nor add it to the - GRUB boot menu. It leaves a symlink named result in - the current directory, which points to the output of the top-level - “system” derivation. This is essentially the same as doing + Build the new configuration, but neither activate it nor add it to the GRUB boot menu. It leaves a symlink named result in the current directory, which points to the output of the top-level “system” derivation. This is essentially the same as doing $ nix-build /path/to/nixpkgs/nixos -A system - Note that you do not need to be root to run - nixos-rebuild build. + Note that you do not need to be root to run nixos-rebuild build. - - Show what store paths would be built or downloaded by any of the - operations above, but otherwise do nothing. + Show what store paths would be built or downloaded by any of the operations above, but otherwise do nothing. - - Build the new configuration, but instead of activating it, show what - changes would be performed by the activation (i.e. by - nixos-rebuild test). For instance, this command will - print which systemd units would be restarted. The list of changes is not - guaranteed to be complete. + Build the new configuration, but instead of activating it, show what changes would be performed by the activation (i.e. by nixos-rebuild test). For instance, this command will print which systemd units would be restarted. The list of changes is not guaranteed to be complete. - @@ -245,80 +226,49 @@ - - Build a script that starts a NixOS virtual machine with the desired - configuration. It leaves a symlink result in the - current directory that points (under - result/bin/run-hostname-vm) - at the script that starts the VM. Thus, to test a NixOS configuration in - a virtual machine, you should do the following: + Build a script that starts a NixOS virtual machine with the desired configuration. It leaves a symlink result in the current directory that points (under result/bin/run-hostname-vm) at the script that starts the VM. Thus, to test a NixOS configuration in a virtual machine, you should do the following: $ nixos-rebuild build-vm $ ./result/bin/run-*-vm - - The VM is implemented using the qemu package. For - best performance, you should load the kvm-intel or - kvm-amd kernel modules to get hardware - virtualisation. + The VM is implemented using the qemu package. For best performance, you should load the kvm-intel or kvm-amd kernel modules to get hardware virtualisation. - - The VM mounts the Nix store of the host through the 9P file system. The - host Nix store is read-only, so Nix commands that modify the Nix store - will not work in the VM. This includes commands such as - nixos-rebuild; to change the VM’s configuration, - you must halt the VM and re-run the commands above. + The VM mounts the Nix store of the host through the 9P file system. The host Nix store is read-only, so Nix commands that modify the Nix store will not work in the VM. This includes commands such as nixos-rebuild; to change the VM’s configuration, you must halt the VM and re-run the commands above. - - The VM has its own ext3 root file system, which is - automatically created when the VM is first started, and is persistent - across reboots of the VM. It is stored in - ./hostname.qcow2. + The VM has its own ext3 root file system, which is automatically created when the VM is first started, and is persistent across reboots of the VM. It is stored in ./hostname.qcow2. - - Like , but boots using the regular boot loader - of your configuration (e.g., GRUB 1 or 2), rather than booting directly - into the kernel and initial ramdisk of the system. This allows you to - test whether the boot loader works correctly. However, it does not - guarantee that your NixOS configuration will boot successfully on the - host hardware (i.e., after running nixos-rebuild - switch), because the hardware and boot loader configuration in - the VM are different. The boot loader is installed on an automatically - generated virtual disk containing a /boot - partition, which is mounted read-only in the VM. + Like , but boots using the regular boot loader of your configuration (e.g., GRUB 1 or 2), rather than booting directly into the kernel and initial ramdisk of the system. This allows you to test whether the boot loader works correctly. However, it does not guarantee that your NixOS configuration will boot successfully on the host hardware (i.e., after running nixos-rebuild switch), because the hardware and boot loader configuration in the VM are different. The boot loader is installed on an automatically generated virtual disk containing a /boot partition, which is mounted read-only in the VM. - Options This command accepts the following options: - @@ -330,84 +280,56 @@
- - Causes the boot loader to be (re)installed on the device specified by the - relevant configuration options. + Causes the boot loader to be (re)installed on the device specified by the relevant configuration options. - - Normally, nixos-rebuild first builds the - nixUnstable attribute in Nixpkgs, and uses the - resulting instance of the Nix package manager to build the new system - configuration. This is necessary if the NixOS modules use features not - provided by the currently installed version of Nix. This option disables - building a new Nix. + Normally, nixos-rebuild first builds the nixUnstable attribute in Nixpkgs, and uses the resulting instance of the Nix package manager to build the new system configuration. This is necessary if the NixOS modules use features not provided by the currently installed version of Nix. This option disables building a new Nix. - - Equivalent to - . This option is useful if you call - nixos-rebuild frequently (e.g. if you’re hacking on - a NixOS module). + Equivalent to . This option is useful if you call nixos-rebuild frequently (e.g. if you’re hacking on a NixOS module). - - Instead of building a new configuration as specified by - /etc/nixos/configuration.nix, roll back to the - previous configuration. (The previous configuration is defined as the one - before the “current” generation of the Nix profile - /nix/var/nix/profiles/system.) + Instead of building a new configuration as specified by /etc/nixos/configuration.nix, roll back to the previous configuration. (The previous configuration is defined as the one before the “current” generation of the Nix profile /nix/var/nix/profiles/system.) - builder-spec - Allow ad-hoc remote builders for building the new system. This requires - the user executing nixos-rebuild (usually root) to be - configured as a trusted user in the Nix daemon. This can be achieved by - using the nix.trustedUsers NixOS option. Examples - values for that option are described in the Remote builds - chapter in the Nix manual, (i.e. --builders - "ssh://bigbrother x86_64-linux"). By specifying an empty string - existing builders specified in /etc/nix/machines can - be ignored: --builders "" for example when they are - not reachable due to network connectivity. + Allow ad-hoc remote builders for building the new system. This requires the user executing nixos-rebuild (usually root) to be configured as a trusted user in the Nix daemon. This can be achieved by using the nix.trustedUsers NixOS option. Examples values for that option are described in the Remote builds chapter in the Nix manual, (i.e. --builders "ssh://bigbrother x86_64-linux"). By specifying an empty string existing builders specified in /etc/nix/machines can be ignored: --builders "" for example when they are not reachable due to network connectivity. - @@ -417,97 +339,56 @@ - Instead of using the Nix profile - /nix/var/nix/profiles/system to keep track of the - current and previous system configurations, use - /nix/var/nix/profiles/system-profiles/name. - When you use GRUB 2, for every system profile created with this flag, - NixOS will create a submenu named “NixOS - Profile - 'name'” in GRUB’s boot menu, containing - the current and previous configurations of this profile. + Instead of using the Nix profile /nix/var/nix/profiles/system to keep track of the current and previous system configurations, use /nix/var/nix/profiles/system-profiles/name. When you use GRUB 2, for every system profile created with this flag, NixOS will create a submenu named “NixOS - Profile 'name'” in GRUB’s boot menu, containing the current and previous configurations of this profile. - For instance, if you want to test a configuration file named - test.nix without affecting the default system - profile, you would do: + For instance, if you want to test a configuration file named test.nix without affecting the default system profile, you would do: $ nixos-rebuild switch -p test -I nixos-config=./test.nix - The new configuration will appear in the GRUB 2 submenu “NixOS - - Profile 'test'”. + The new configuration will appear in the GRUB 2 submenu “NixOS - Profile 'test'”. - - Instead of building the new configuration locally, use the specified host - to perform the build. The host needs to be accessible with ssh, and must - be able to perform Nix builds. If the option - is not set, the build will be copied back - to the local machine when done. + Instead of building the new configuration locally, use the specified host to perform the build. The host needs to be accessible with ssh, and must be able to perform Nix builds. If the option is not set, the build will be copied back to the local machine when done. - Note that, if is not specified, Nix will - be built both locally and remotely. This is because the configuration - will always be evaluated locally even though the building might be - performed remotely. + Note that, if is not specified, Nix will be built both locally and remotely. This is because the configuration will always be evaluated locally even though the building might be performed remotely. - You can include a remote user name in the host name - (user@host). You can also set ssh options by - defining the NIX_SSHOPTS environment variable. + You can include a remote user name in the host name (user@host). You can also set ssh options by defining the NIX_SSHOPTS environment variable. - - Specifies the NixOS target host. By setting this to something other than - localhost, the system activation will happen - on the remote host instead of the local machine. The remote host needs to - be accessible over ssh, and for the commands , - and you need root access. + Specifies the NixOS target host. By setting this to something other than localhost, the system activation will happen on the remote host instead of the local machine. The remote host needs to be accessible over ssh, and for the commands , and you need root access. - - If is not explicitly specified, - will implicitly be set to the same value as - . So, if you only specify - both building and activation will take - place remotely (and no build artifacts will be copied to the local - machine). + If is not explicitly specified, will implicitly be set to the same value as . So, if you only specify both building and activation will take place remotely (and no build artifacts will be copied to the local machine). - - You can include a remote user name in the host name - (user@host). You can also set ssh options by - defining the NIX_SSHOPTS environment variable. + You can include a remote user name in the host name (user@host). You can also set ssh options by defining the NIX_SSHOPTS environment variable. - - In addition, nixos-rebuild accepts various Nix-related - flags, including / , - , , - and / - . See the Nix manual for details. + In addition, nixos-rebuild accepts various Nix-related flags, including / , , , and / . See the Nix manual for details. - Environment - @@ -515,31 +396,25 @@ - Path to the main NixOS configuration module. Defaults to - /etc/nixos/configuration.nix. + Path to the main NixOS configuration module. Defaults to /etc/nixos/configuration.nix. - NIX_SSHOPTS - Additional options to be passed to ssh on the command - line. + Additional options to be passed to ssh on the command line. - Files - - /run/current-system @@ -550,22 +425,18 @@
- /nix/var/nix/profiles/system - The Nix profile that contains the current and previous system - configurations. Used to generate the GRUB boot menu. + The Nix profile that contains the current and previous system configurations. Used to generate the GRUB boot menu. - - Bugs diff --git a/nixos/doc/manual/man-nixos-version.xml b/nixos/doc/manual/man-nixos-version.xml index 931c4a5ad029..cb844da10f01 100644 --- a/nixos/doc/manual/man-nixos-version.xml +++ b/nixos/doc/manual/man-nixos-version.xml @@ -25,8 +25,7 @@ Description - This command shows the version of the currently active NixOS configuration. - For example: + This command shows the version of the currently active NixOS configuration. For example: $ nixos-version 16.03.1011.6317da4 (Emu) @@ -38,8 +37,7 @@ - The NixOS release, indicating the year and month in which it was - released (e.g. March 2016). + The NixOS release, indicating the year and month in which it was released (e.g. March 2016). @@ -49,12 +47,7 @@ - The number of commits in the Nixpkgs Git repository between the start of - the release branch and the commit from which this version was built. - This ensures that NixOS versions are monotonically increasing. It is - git when the current NixOS configuration was built - from a checkout of the Nixpkgs Git repository rather than from a NixOS - channel. + The number of commits in the Nixpkgs Git repository between the start of the release branch and the commit from which this version was built. This ensures that NixOS versions are monotonically increasing. It is git when the current NixOS configuration was built from a checkout of the Nixpkgs Git repository rather than from a NixOS channel. @@ -64,8 +57,7 @@ - The first 7 characters of the commit in the Nixpkgs Git repository from - which this version was built. + The first 7 characters of the commit in the Nixpkgs Git repository from which this version was built. @@ -75,9 +67,7 @@ - The code name of the NixOS release. The first letter of the code name - indicates that this is the N'th stable NixOS release; for example, Emu - is the fifth release. + The code name of the NixOS release. The first letter of the code name indicates that this is the N'th stable NixOS release; for example, Emu is the fifth release. @@ -99,8 +89,7 @@ - Show the full SHA1 hash of the Git commit from which this configuration - was built, e.g. + Show the full SHA1 hash of the Git commit from which this configuration was built, e.g. $ nixos-version --hash 6317da40006f6bc2480c6781999c52d88dde2acf diff --git a/nixos/doc/manual/manual.xml b/nixos/doc/manual/manual.xml index 12f52e1997c8..9f7260b24954 100644 --- a/nixos/doc/manual/manual.xml +++ b/nixos/doc/manual/manual.xml @@ -11,26 +11,17 @@ Preface - This manual describes how to install, use and extend NixOS, a Linux - distribution based on the purely functional package management system Nix. + This manual describes how to install, use and extend NixOS, a Linux distribution based on the purely functional package management system Nix. - If you encounter problems, please report them on the - Discourse or - on the - #nixos channel on Freenode. Bugs should be - reported in - NixOS’ - GitHub issue tracker. + If you encounter problems, please report them on the Discourse or on the #nixos channel on Freenode. Bugs should be reported in NixOS’ GitHub issue tracker. - Commands prefixed with # have to be run as root, either - requiring to login as root user or temporarily switching to it using - sudo for example. + Commands prefixed with # have to be run as root, either requiring to login as root user or temporarily switching to it using sudo for example. diff --git a/nixos/doc/manual/release-notes/release-notes.xml b/nixos/doc/manual/release-notes/release-notes.xml index 444862c5739b..198f8eb34818 100644 --- a/nixos/doc/manual/release-notes/release-notes.xml +++ b/nixos/doc/manual/release-notes/release-notes.xml @@ -5,8 +5,7 @@ xml:id="ch-release-notes"> Release Notes - This section lists the release notes for each stable version of NixOS and - current unstable revision. + This section lists the release notes for each stable version of NixOS and current unstable revision. diff --git a/nixos/doc/manual/release-notes/rl-1404.xml b/nixos/doc/manual/release-notes/rl-1404.xml index 8d8cea4303a3..26dc5bb252e0 100644 --- a/nixos/doc/manual/release-notes/rl-1404.xml +++ b/nixos/doc/manual/release-notes/rl-1404.xml @@ -6,23 +6,16 @@ Release 14.04 (“Baboon”, 2014/04/30) - This is the second stable release branch of NixOS. In addition to numerous - new and upgraded packages and modules, this release has the following - highlights: + This is the second stable release branch of NixOS. In addition to numerous new and upgraded packages and modules, this release has the following highlights: - Installation on UEFI systems is now supported. See - for details. + Installation on UEFI systems is now supported. See for details. - Systemd has been updated to version 212, which has - numerous - improvements. NixOS now automatically starts systemd user instances - when you log in. You can define global user units through the - options. + Systemd has been updated to version 212, which has numerous improvements. NixOS now automatically starts systemd user instances when you log in. You can define global user units through the options. @@ -47,47 +40,28 @@ - Nix has been updated to 1.7 - (details). - NixOS now supports fully declarative management of users and groups. If - you set to false, - then the contents of /etc/passwd and - /etc/group will be - congruent - to your NixOS configuration. For instance, if you remove a user from - and run - nixos-rebuild, the user account will cease to exist. - Also, imperative commands for managing users and groups, such as - useradd, are no longer available. If - is true (the - default), then behaviour is unchanged from NixOS 13.10. + NixOS now supports fully declarative management of users and groups. If you set to false, then the contents of /etc/passwd and /etc/group will be congruent to your NixOS configuration. For instance, if you remove a user from and run nixos-rebuild, the user account will cease to exist. Also, imperative commands for managing users and groups, such as useradd, are no longer available. If is true (the default), then behaviour is unchanged from NixOS 13.10. - NixOS now has basic container support, meaning you can easily run a NixOS - instance as a container in a NixOS host system. These containers are - suitable for testing and experimentation but not production use, since - they’re not fully isolated from the host. See - for details. + NixOS now has basic container support, meaning you can easily run a NixOS instance as a container in a NixOS host system. These containers are suitable for testing and experimentation but not production use, since they’re not fully isolated from the host. See for details. - Systemd units provided by packages can now be overridden from the NixOS - configuration. For instance, if a package foo provides - systemd units, you can say: + Systemd units provided by packages can now be overridden from the NixOS configuration. For instance, if a package foo provides systemd units, you can say: systemd.packages = [ pkgs.foo ]; - to enable those units. You can then set or override unit options in the - usual way, e.g. + to enable those units. You can then set or override unit options in the usual way, e.g. systemd.services.foo.wantedBy = [ "multi-user.target" ]; systemd.services.foo.serviceConfig.MemoryLimit = "512M"; @@ -98,14 +72,11 @@ systemd.services.foo.serviceConfig.MemoryLimit = "512M"; - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: - Nixpkgs no longer exposes unfree packages by default. If your NixOS - configuration requires unfree packages from Nixpkgs, you need to enable - support for them explicitly by setting: + Nixpkgs no longer exposes unfree packages by default. If your NixOS configuration requires unfree packages from Nixpkgs, you need to enable support for them explicitly by setting: nixpkgs.config.allowUnfree = true; @@ -118,8 +89,7 @@ error: package ‘nvidia-x11-331.49-3.12.17’ in ‘…/nvidia-x11/default.nix: - The Adobe Flash player is no longer enabled by default in the Firefox and - Chromium wrappers. To enable it, you must set: + The Adobe Flash player is no longer enabled by default in the Firefox and Chromium wrappers. To enable it, you must set: nixpkgs.config.allowUnfree = true; nixpkgs.config.firefox.enableAdobeFlash = true; # for Firefox @@ -129,8 +99,7 @@ nixpkgs.config.chromium.enableAdobeFlash = true; # for Chromium - The firewall is now enabled by default. If you don’t want this, you need - to disable it explicitly: + The firewall is now enabled by default. If you don’t want this, you need to disable it explicitly: networking.firewall.enable = false; @@ -138,40 +107,22 @@ networking.firewall.enable = false; - The option has been renamed to - . + The option has been renamed to . - The mysql55 service has been merged into the - mysql service, which no longer sets a default for the - option . + The mysql55 service has been merged into the mysql service, which no longer sets a default for the option . - Package variants are now differentiated by suffixing the name, rather than - the version. For instance, sqlite-3.8.4.3-interactive - is now called sqlite-interactive-3.8.4.3. This - ensures that nix-env -i sqlite is unambiguous, and that - nix-env -u won’t “upgrade” - sqlite to sqlite-interactive or vice - versa. Notably, this change affects the Firefox wrapper (which provides - plugins), as it is now called firefox-wrapper. So when - using nix-env, you should do nix-env -e - firefox; nix-env -i firefox-wrapper if you want to keep using - the wrapper. This change does not affect declarative package management, - since attribute names like pkgs.firefoxWrapper were - already unambiguous. + Package variants are now differentiated by suffixing the name, rather than the version. For instance, sqlite-3.8.4.3-interactive is now called sqlite-interactive-3.8.4.3. This ensures that nix-env -i sqlite is unambiguous, and that nix-env -u won’t “upgrade” sqlite to sqlite-interactive or vice versa. Notably, this change affects the Firefox wrapper (which provides plugins), as it is now called firefox-wrapper. So when using nix-env, you should do nix-env -e firefox; nix-env -i firefox-wrapper if you want to keep using the wrapper. This change does not affect declarative package management, since attribute names like pkgs.firefoxWrapper were already unambiguous. - The symlink /etc/ca-bundle.crt is gone. Programs - should instead use the environment variable - OPENSSL_X509_CERT_FILE (which points to - /etc/ssl/certs/ca-bundle.crt). + The symlink /etc/ca-bundle.crt is gone. Programs should instead use the environment variable OPENSSL_X509_CERT_FILE (which points to /etc/ssl/certs/ca-bundle.crt). diff --git a/nixos/doc/manual/release-notes/rl-1412.xml b/nixos/doc/manual/release-notes/rl-1412.xml index 139f61c2a550..af17e166322d 100644 --- a/nixos/doc/manual/release-notes/rl-1412.xml +++ b/nixos/doc/manual/release-notes/rl-1412.xml @@ -6,19 +6,16 @@ Release 14.12 (“Caterpillar”, 2014/12/30) - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: - Systemd has been updated to version 217, which has numerous - improvements. + Systemd has been updated to version 217, which has numerous improvements. - - Nix has been updated to 1.8. + Nix has been updated to 1.8. @@ -38,13 +35,7 @@ - If is enabled (the default), changes - made to the declaration of a user or group will be correctly realised when - running nixos-rebuild. For instance, removing a user - specification from configuration.nix will cause the - actual user account to be deleted. If - is disabled, it is no longer necessary to specify UIDs or GIDs; if - omitted, they are allocated dynamically. + If is enabled (the default), changes made to the declaration of a user or group will be correctly realised when running nixos-rebuild. For instance, removing a user specification from configuration.nix will cause the actual user account to be deleted. If is disabled, it is no longer necessary to specify UIDs or GIDs; if omitted, they are allocated dynamically. @@ -362,18 +353,12 @@ - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: - The default version of Apache httpd is now 2.4. If you use the - option to pass literal Apache configuration - text, you may need to update it — see - Apache’s - documentation for details. If you wish to continue to use httpd - 2.2, add the following line to your NixOS configuration: + The default version of Apache httpd is now 2.4. If you use the option to pass literal Apache configuration text, you may need to update it — see Apache’s documentation for details. If you wish to continue to use httpd 2.2, add the following line to your NixOS configuration: services.httpd.package = pkgs.apacheHttpd_2_2; @@ -381,85 +366,57 @@ services.httpd.package = pkgs.apacheHttpd_2_2; - PHP 5.3 has been removed because it is no longer supported by the PHP - project. A migration - guide is available. + PHP 5.3 has been removed because it is no longer supported by the PHP project. A migration guide is available. - The host side of a container virtual Ethernet pair is now called - ve-container-name rather - than c-container-name. + The host side of a container virtual Ethernet pair is now called ve-container-name rather than c-container-name. - GNOME 3.10 support has been dropped. The default GNOME version is now - 3.12. + GNOME 3.10 support has been dropped. The default GNOME version is now 3.12. - VirtualBox has been upgraded to 4.3.20 release. Users may be required to - run rm -rf /tmp/.vbox*. The line imports = [ - <nixpkgs/nixos/modules/programs/virtualbox.nix> ] is no - longer necessary, use services.virtualboxHost.enable = - true instead. + VirtualBox has been upgraded to 4.3.20 release. Users may be required to run rm -rf /tmp/.vbox*. The line imports = [ <nixpkgs/nixos/modules/programs/virtualbox.nix> ] is no longer necessary, use services.virtualboxHost.enable = true instead. - Also, hardening mode is now enabled by default, which means that unless - you want to use USB support, you no longer need to be a member of the - vboxusers group. + Also, hardening mode is now enabled by default, which means that unless you want to use USB support, you no longer need to be a member of the vboxusers group. - Chromium has been updated to 39.0.2171.65. - is now enabled by default. - chromium*Wrapper packages no longer exist, because - upstream removed NSAPI support. chromium-stable has - been renamed to chromium. + Chromium has been updated to 39.0.2171.65. is now enabled by default. chromium*Wrapper packages no longer exist, because upstream removed NSAPI support. chromium-stable has been renamed to chromium. - Python packaging documentation is now part of nixpkgs manual. To override - the python packages available to a custom python you now use - pkgs.pythonFull.buildEnv.override instead of - pkgs.pythonFull.override. + Python packaging documentation is now part of nixpkgs manual. To override the python packages available to a custom python you now use pkgs.pythonFull.buildEnv.override instead of pkgs.pythonFull.override. - boot.resumeDevice = "8:6" is no longer supported. Most - users will want to leave it undefined, which takes the swap partitions - automatically. There is an evaluation assertion to ensure that the string - starts with a slash. + boot.resumeDevice = "8:6" is no longer supported. Most users will want to leave it undefined, which takes the swap partitions automatically. There is an evaluation assertion to ensure that the string starts with a slash. - The system-wide default timezone for NixOS installations changed from - CET to UTC. To choose a different - timezone for your system, configure time.timeZone in - configuration.nix. A fairly complete list of possible - values for that setting is available at - CET to UTC. To choose a different timezone for your system, configure time.timeZone in configuration.nix. A fairly complete list of possible values for that setting is available at . - GNU screen has been updated to 4.2.1, which breaks the ability to connect - to sessions created by older versions of screen. + GNU screen has been updated to 4.2.1, which breaks the ability to connect to sessions created by older versions of screen. - The Intel GPU driver was updated to the 3.x prerelease version (used by - most distributions) and supports DRI3 now. + The Intel GPU driver was updated to the 3.x prerelease version (used by most distributions) and supports DRI3 now. diff --git a/nixos/doc/manual/release-notes/rl-1509.xml b/nixos/doc/manual/release-notes/rl-1509.xml index 5c4d99701785..5e162c3f0f73 100644 --- a/nixos/doc/manual/release-notes/rl-1509.xml +++ b/nixos/doc/manual/release-notes/rl-1509.xml @@ -6,42 +6,23 @@ Release 15.09 (“Dingo”, 2015/09/30) - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: - The Haskell packages - infrastructure has been re-designed from the ground up ("Haskell - NG"). NixOS now distributes the latest version of every single package - registered on - Hackage -- well - in excess of 8,000 Haskell packages. Detailed instructions on how to use - that infrastructure can be found in the - User's - Guide to the Haskell Infrastructure. Users migrating from an earlier - release may find helpful information below, in the list of - backwards-incompatible changes. Furthermore, we distribute 51(!) additional - Haskell package sets that provide every single - LTS Haskell release - since version 0.0 as well as the most recent - Stackage Nightly - snapshot. The announcement - "Full - Stackage Support in Nixpkgs" gives additional details. + The Haskell packages infrastructure has been re-designed from the ground up ("Haskell NG"). NixOS now distributes the latest version of every single package registered on Hackage -- well in excess of 8,000 Haskell packages. Detailed instructions on how to use that infrastructure can be found in the User's Guide to the Haskell Infrastructure. Users migrating from an earlier release may find helpful information below, in the list of backwards-incompatible changes. Furthermore, we distribute 51(!) additional Haskell package sets that provide every single LTS Haskell release since version 0.0 as well as the most recent Stackage Nightly snapshot. The announcement "Full Stackage Support in Nixpkgs" gives additional details. - Nix has been updated to version 1.10, which among other improvements - enables cryptographic signatures on binary caches for improved security. + Nix has been updated to version 1.10, which among other improvements enables cryptographic signatures on binary caches for improved security. @@ -50,8 +31,7 @@ system.autoUpgrade.enable = true; - This will cause the system to periodically check for updates in your - current channel and run nixos-rebuild. + This will cause the system to periodically check for updates in your current channel and run nixos-rebuild. @@ -71,8 +51,7 @@ system.autoUpgrade.enable = true; - KDE 5 has been upgraded to KDE Frameworks 5.10, Plasma 5.3.2 and - Applications 15.04.3. KDE 4 has been updated to kdelibs-4.14.10. + KDE 5 has been upgraded to KDE Frameworks 5.10, Plasma 5.3.2 and Applications 15.04.3. KDE 4 has been updated to kdelibs-4.14.10. @@ -424,93 +403,61 @@ system.autoUpgrade.enable = true; - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: - sshd no longer supports DSA and ECDSA host keys by - default. If you have existing systems with such host keys and want to - continue to use them, please set + sshd no longer supports DSA and ECDSA host keys by default. If you have existing systems with such host keys and want to continue to use them, please set system.stateVersion = "14.12"; - The new option ensures that certain - configuration changes that could break existing systems (such as the - sshd host key setting) will maintain compatibility with - the specified NixOS release. NixOps sets the state version of existing - deployments automatically. + The new option ensures that certain configuration changes that could break existing systems (such as the sshd host key setting) will maintain compatibility with the specified NixOS release. NixOps sets the state version of existing deployments automatically. - cron is no longer enabled by default, unless you have a - non-empty . To force - cron to be enabled, set . + cron is no longer enabled by default, unless you have a non-empty . To force cron to be enabled, set . - Nix now requires binary caches to be cryptographically signed. If you have - unsigned binary caches that you want to continue to use, you should set - . + Nix now requires binary caches to be cryptographically signed. If you have unsigned binary caches that you want to continue to use, you should set . - Steam now doesn't need root rights to work. Instead of using - *-steam-chrootenv, you should now just run - steam. steamChrootEnv package was - renamed to steam, and old steam - package -- to steamOriginal. + Steam now doesn't need root rights to work. Instead of using *-steam-chrootenv, you should now just run steam. steamChrootEnv package was renamed to steam, and old steam package -- to steamOriginal. - CMPlayer has been renamed to bomi upstream. Package - cmplayer was accordingly renamed to - bomi + CMPlayer has been renamed to bomi upstream. Package cmplayer was accordingly renamed to bomi - Atom Shell has been renamed to Electron upstream. Package - atom-shell was accordingly renamed to - electron + Atom Shell has been renamed to Electron upstream. Package atom-shell was accordingly renamed to electron - Elm is not released on Hackage anymore. You should now use - elmPackages.elm which contains the latest Elm platform. + Elm is not released on Hackage anymore. You should now use elmPackages.elm which contains the latest Elm platform. - The CUPS printing service has been updated to version - 2.0.2. Furthermore its systemd service has been renamed - to cups.service. + The CUPS printing service has been updated to version 2.0.2. Furthermore its systemd service has been renamed to cups.service. - Local printers are no longer shared or advertised by default. This - behavior can be changed by enabling - or - respectively. + Local printers are no longer shared or advertised by default. This behavior can be changed by enabling or respectively. - The VirtualBox host and guest options have been named more consistently. - They can now found in - instead of and - instead of - . + The VirtualBox host and guest options have been named more consistently. They can now found in instead of and instead of . - Also, there now is support for the vboxsf file system - using the configuration attribute. An example - of how this can be used in a configuration: + Also, there now is support for the vboxsf file system using the configuration attribute. An example of how this can be used in a configuration: fileSystems."/shiny" = { device = "myshinysharedfolder"; @@ -521,15 +468,7 @@ fileSystems."/shiny" = { - "nix-env -qa" no longer discovers Haskell - packages by name. The only packages visible in the global scope are - ghc, cabal-install, and - stack, but all other packages are hidden. The reason - for this inconvenience is the sheer size of the Haskell package set. - Name-based lookups are expensive, and most nix-env -qa - operations would become much slower if we'd add the entire Hackage - database into the top level attribute set. Instead, the list of Haskell - packages can be displayed by running: + "nix-env -qa" no longer discovers Haskell packages by name. The only packages visible in the global scope are ghc, cabal-install, and stack, but all other packages are hidden. The reason for this inconvenience is the sheer size of the Haskell package set. Name-based lookups are expensive, and most nix-env -qa operations would become much slower if we'd add the entire Hackage database into the top level attribute set. Instead, the list of Haskell packages can be displayed by running: nix-env -f "<nixpkgs>" -qaP -A haskellPackages @@ -541,91 +480,56 @@ nix-env -f "<nixpkgs>" -qaP -A haskellPackages nix-env -f "<nixpkgs>" -iA haskellPackages.pandoc - Installing Haskell libraries this way, however, is no - longer supported. See the next item for more details. + Installing Haskell libraries this way, however, is no longer supported. See the next item for more details. - Previous versions of NixOS came with a feature called - ghc-wrapper, a small script that allowed GHC to - transparently pick up on libraries installed in the user's profile. This - feature has been deprecated; ghc-wrapper was removed - from the distribution. The proper way to register Haskell libraries with - the compiler now is the haskellPackages.ghcWithPackages - function. The - User's - Guide to the Haskell Infrastructure provides more information about - this subject. + Previous versions of NixOS came with a feature called ghc-wrapper, a small script that allowed GHC to transparently pick up on libraries installed in the user's profile. This feature has been deprecated; ghc-wrapper was removed from the distribution. The proper way to register Haskell libraries with the compiler now is the haskellPackages.ghcWithPackages function. The User's Guide to the Haskell Infrastructure provides more information about this subject. - All Haskell builds that have been generated with version 1.x of the - cabal2nix utility are now invalid and need to be - re-generated with a current version of cabal2nix to - function. The most recent version of this tool can be installed by running - nix-env -i cabal2nix. + All Haskell builds that have been generated with version 1.x of the cabal2nix utility are now invalid and need to be re-generated with a current version of cabal2nix to function. The most recent version of this tool can be installed by running nix-env -i cabal2nix. - The haskellPackages set in Nixpkgs used to have a - function attribute called extension that users could - override in their ~/.nixpkgs/config.nix files to - configure additional attributes, etc. That function still exists, but it's - now called overrides. + The haskellPackages set in Nixpkgs used to have a function attribute called extension that users could override in their ~/.nixpkgs/config.nix files to configure additional attributes, etc. That function still exists, but it's now called overrides. - The OpenBLAS library has been updated to version - 0.2.14. Support for the - x86_64-darwin platform was added. Dynamic architecture - detection was enabled; OpenBLAS now selects microarchitecture-optimized - routines at runtime, so optimal performance is achieved without the need - to rebuild OpenBLAS locally. OpenBLAS has replaced ATLAS in most packages - which use an optimized BLAS or LAPACK implementation. + The OpenBLAS library has been updated to version 0.2.14. Support for the x86_64-darwin platform was added. Dynamic architecture detection was enabled; OpenBLAS now selects microarchitecture-optimized routines at runtime, so optimal performance is achieved without the need to rebuild OpenBLAS locally. OpenBLAS has replaced ATLAS in most packages which use an optimized BLAS or LAPACK implementation. - The phpfpm is now using the default PHP version - (pkgs.php) instead of PHP 5.4 - (pkgs.php54). + The phpfpm is now using the default PHP version (pkgs.php) instead of PHP 5.4 (pkgs.php54). - The locate service no longer indexes the Nix store by - default, preventing packages with potentially numerous versions from - cluttering the output. Indexing the store can be activated by setting - . + The locate service no longer indexes the Nix store by default, preventing packages with potentially numerous versions from cluttering the output. Indexing the store can be activated by setting . - The Nix expression search path (NIX_PATH) no longer - contains /etc/nixos/nixpkgs by default. You can - override NIX_PATH by setting . + The Nix expression search path (NIX_PATH) no longer contains /etc/nixos/nixpkgs by default. You can override NIX_PATH by setting . - Python 2.6 has been marked as broken (as it no longer receives security - updates from upstream). + Python 2.6 has been marked as broken (as it no longer receives security updates from upstream). - Any use of module arguments such as pkgs to access - library functions, or to define imports attributes will - now lead to an infinite loop at the time of the evaluation. + Any use of module arguments such as pkgs to access library functions, or to define imports attributes will now lead to an infinite loop at the time of the evaluation. - In case of an infinite loop, use the --show-trace - command line argument and read the line just above the error message. + In case of an infinite loop, use the --show-trace command line argument and read the line just above the error message. $ nixos-rebuild build --show-trace … @@ -634,9 +538,7 @@ infinite recursion encountered - Any use of pkgs.lib, should be replaced by - lib, after adding it as argument of the module. The - following module + Any use of pkgs.lib, should be replaced by lib, after adding it as argument of the module. The following module { config, pkgs, ... }: @@ -664,9 +566,7 @@ with lib; - When pkgs is used to download other projects to import - their modules, and only in such cases, it should be replaced by - (import <nixpkgs> {}). The following module + When pkgs is used to download other projects to import their modules, and only in such cases, it should be replaced by (import <nixpkgs> {}). The following module { config, pkgs, ... }: @@ -706,43 +606,25 @@ in - The nixos and nixpkgs channels were unified, so one - can use nix-env -iA nixos.bash - instead of nix-env -iA nixos.pkgs.bash. See - the - commit for details. + The nixos and nixpkgs channels were unified, so one can use nix-env -iA nixos.bash instead of nix-env -iA nixos.pkgs.bash. See the commit for details. - Users running an SSH server who worry about the quality of their - /etc/ssh/moduli file with respect to the - vulnerabilities - discovered in the Diffie-Hellman key exchange can now replace - OpenSSH's default version with one they generated themselves using the new - option. + Users running an SSH server who worry about the quality of their /etc/ssh/moduli file with respect to the vulnerabilities discovered in the Diffie-Hellman key exchange can now replace OpenSSH's default version with one they generated themselves using the new option. - A newly packaged TeX Live 2015 is provided in - pkgs.texlive, split into 6500 nix packages. For basic - user documentation see - the - source. Beware of - an - issue when installing a too large package set. The plan is to - deprecate and maybe delete the original TeX packages until the next - release. + A newly packaged TeX Live 2015 is provided in pkgs.texlive, split into 6500 nix packages. For basic user documentation see the source. Beware of an issue when installing a too large package set. The plan is to deprecate and maybe delete the original TeX packages until the next release. - on all Python interpreters is now available - for nix-shell interoperability. + on all Python interpreters is now available for nix-shell interoperability. diff --git a/nixos/doc/manual/release-notes/rl-1603.xml b/nixos/doc/manual/release-notes/rl-1603.xml index 9b512c4b1e58..94808b360764 100644 --- a/nixos/doc/manual/release-notes/rl-1603.xml +++ b/nixos/doc/manual/release-notes/rl-1603.xml @@ -6,17 +6,14 @@ Release 16.03 (“Emu”, 2016/03/31) - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: - Systemd 229, bringing - numerous - improvements over 217. + Systemd 229, bringing numerous improvements over 217. @@ -26,11 +23,8 @@ - GCC 5.3 (was 4.9). Note that GCC 5 - changes - the C++ ABI in an incompatible way; this may cause problems if you - try to link objects compiled with different versions of GCC. + GCC 5.3 (was 4.9). Note that GCC 5 changes the C++ ABI in an incompatible way; this may cause problems if you try to link objects compiled with different versions of GCC. @@ -45,20 +39,10 @@ - Improved support for ensuring - bitwise - reproducible builds. For example, stdenv now sets - the environment variable - SOURCE_DATE_EPOCH - to a deterministic value, and Nix has - gained - an option to repeat a build a number of times to test determinism. - An ongoing project, the goal of exact reproducibility is to allow binaries - to be verified independently (e.g., a user might only trust binaries that - appear in three independent binary caches). + Improved support for ensuring bitwise reproducible builds. For example, stdenv now sets the environment variable SOURCE_DATE_EPOCH to a deterministic value, and Nix has gained an option to repeat a build a number of times to test determinism. An ongoing project, the goal of exact reproducibility is to allow binaries to be verified independently (e.g., a user might only trust binaries that appear in three independent binary caches). @@ -335,56 +319,38 @@ - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: - We no longer produce graphical ISO images and VirtualBox images for - i686-linux. A minimal ISO image is still provided. + We no longer produce graphical ISO images and VirtualBox images for i686-linux. A minimal ISO image is still provided. - Firefox and similar browsers are now wrapped by - default. The package and attribute names are plain - firefox or midori, etc. - Backward-compatibility attributes were set up, but note that - nix-env -u will not update your - current firefox-with-plugins; you have to uninstall it - and install firefox instead. + Firefox and similar browsers are now wrapped by default. The package and attribute names are plain firefox or midori, etc. Backward-compatibility attributes were set up, but note that nix-env -u will not update your current firefox-with-plugins; you have to uninstall it and install firefox instead. - wmiiSnap has been replaced with - wmii_hg, but - services.xserver.windowManager.wmii.enable has been - updated respectively so this only affects you if you have explicitly - installed wmiiSnap. + wmiiSnap has been replaced with wmii_hg, but services.xserver.windowManager.wmii.enable has been updated respectively so this only affects you if you have explicitly installed wmiiSnap. - jobs NixOS option has been removed. It served as - compatibility layer between Upstart jobs and SystemD services. All services - have been rewritten to use systemd.services + jobs NixOS option has been removed. It served as compatibility layer between Upstart jobs and SystemD services. All services have been rewritten to use systemd.services - wmiimenu is removed, as it has been removed by the - developers upstream. Use wimenu from the - wmii-hg package. + wmiimenu is removed, as it has been removed by the developers upstream. Use wimenu from the wmii-hg package. - Gitit is no longer automatically added to the module list in NixOS and as - such there will not be any manual entries for it. You will need to add an - import statement to your NixOS configuration in order to use it, e.g. + Gitit is no longer automatically added to the module list in NixOS and as such there will not be any manual entries for it. You will need to add an import statement to your NixOS configuration in order to use it, e.g. ]; @@ -395,10 +361,7 @@ - nginx does not accept flags for enabling and disabling - modules anymore. Instead it accepts modules argument, - which is a list of modules to be built in. All modules now reside in - nginxModules set. Example configuration: + nginx does not accept flags for enabling and disabling modules anymore. Instead it accepts modules argument, which is a list of modules to be built in. All modules now reside in nginxModules set. Example configuration: - s3sync is removed, as it hasn't been developed by - upstream for 4 years and only runs with ruby 1.8. For an actively-developer - alternative look at tarsnap and others. + s3sync is removed, as it hasn't been developed by upstream for 4 years and only runs with ruby 1.8. For an actively-developer alternative look at tarsnap and others. - ruby_1_8 has been removed as it's not supported from - upstream anymore and probably contains security issues. + ruby_1_8 has been removed as it's not supported from upstream anymore and probably contains security issues. - tidy-html5 package is removed. Upstream only provided - (lib)tidy5 during development, and now they went back to - (lib)tidy to work as a drop-in replacement of the - original package that has been unmaintained for years. You can (still) use - the html-tidy package, which got updated to a stable - release from this new upstream. + tidy-html5 package is removed. Upstream only provided (lib)tidy5 during development, and now they went back to (lib)tidy to work as a drop-in replacement of the original package that has been unmaintained for years. You can (still) use the html-tidy package, which got updated to a stable release from this new upstream. - extraDeviceOptions argument is removed from - bumblebee package. Instead there are now two separate - arguments: extraNvidiaDeviceOptions and - extraNouveauDeviceOptions for setting extra X11 options - for nvidia and nouveau drivers, respectively. + extraDeviceOptions argument is removed from bumblebee package. Instead there are now two separate arguments: extraNvidiaDeviceOptions and extraNouveauDeviceOptions for setting extra X11 options for nvidia and nouveau drivers, respectively. - The Ctrl+Alt+Backspace key combination no longer kills - the X server by default. There's a new option - allowing to enable - the combination again. + The Ctrl+Alt+Backspace key combination no longer kills the X server by default. There's a new option allowing to enable the combination again. - emacsPackagesNg now contains all packages from the ELPA, - MELPA, and MELPA Stable repositories. + emacsPackagesNg now contains all packages from the ELPA, MELPA, and MELPA Stable repositories. - Data directory for Postfix MTA server is moved from - /var/postfix to /var/lib/postfix. - Old configurations are migrated automatically. - service.postfix module has also received many - improvements, such as correct directories' access rights, new - aliasFiles and mapFiles options and - more. + Data directory for Postfix MTA server is moved from /var/postfix to /var/lib/postfix. Old configurations are migrated automatically. service.postfix module has also received many improvements, such as correct directories' access rights, new aliasFiles and mapFiles options and more. - Filesystem options should now be configured as a list of strings, not a - comma-separated string. The old style will continue to work, but print a - warning, until the 16.09 release. An example of the new style: + Filesystem options should now be configured as a list of strings, not a comma-separated string. The old style will continue to work, but print a warning, until the 16.09 release. An example of the new style: fileSystems."/example" = { device = "/dev/sdc"; @@ -479,44 +418,20 @@ fileSystems."/example" = { - CUPS, installed by services.printing module, now has its - data directory in /var/lib/cups. Old configurations - from /etc/cups are moved there automatically, but - there might be problems. Also configuration options - services.printing.cupsdConf and - services.printing.cupsdFilesConf were removed because - they had been allowing one to override configuration variables required for - CUPS to work at all on NixOS. For most use cases, - services.printing.extraConf and new option - services.printing.extraFilesConf should be enough; if - you encounter a situation when they are not, please file a bug. + CUPS, installed by services.printing module, now has its data directory in /var/lib/cups. Old configurations from /etc/cups are moved there automatically, but there might be problems. Also configuration options services.printing.cupsdConf and services.printing.cupsdFilesConf were removed because they had been allowing one to override configuration variables required for CUPS to work at all on NixOS. For most use cases, services.printing.extraConf and new option services.printing.extraFilesConf should be enough; if you encounter a situation when they are not, please file a bug. - There are also Gutenprint improvements; in particular, a new option - services.printing.gutenprint is added to enable - automatic updating of Gutenprint PPMs; it's greatly recommended to enable - it instead of adding gutenprint to the - drivers list. + There are also Gutenprint improvements; in particular, a new option services.printing.gutenprint is added to enable automatic updating of Gutenprint PPMs; it's greatly recommended to enable it instead of adding gutenprint to the drivers list. - services.xserver.vaapiDrivers has been removed. Use - hardware.opengl.extraPackages{,32} instead. You can also - specify VDPAU drivers there. + services.xserver.vaapiDrivers has been removed. Use hardware.opengl.extraPackages{,32} instead. You can also specify VDPAU drivers there. - programs.ibus moved to - i18n.inputMethod.ibus. The option - programs.ibus.plugins changed to - i18n.inputMethod.ibus.engines and the option to enable - ibus changed from programs.ibus.enable to - i18n.inputMethod.enabled. - i18n.inputMethod.enabled should be set to the used input - method name, "ibus" for ibus. An example of the new - style: + programs.ibus moved to i18n.inputMethod.ibus. The option programs.ibus.plugins changed to i18n.inputMethod.ibus.engines and the option to enable ibus changed from programs.ibus.enable to i18n.inputMethod.enabled. i18n.inputMethod.enabled should be set to the used input method name, "ibus" for ibus. An example of the new style: i18n.inputMethod.enabled = "ibus"; i18n.inputMethod.ibus.engines = with pkgs.ibus-engines; [ anthy mozc ]; @@ -530,26 +445,17 @@ programs.ibus.plugins = with pkgs; [ ibus-anthy mozc ]; - services.udev.extraRules option now writes rules to - 99-local.rules instead of - 10-local.rules. This makes all the user rules apply - after others, so their results wouldn't be overriden by anything else. + services.udev.extraRules option now writes rules to 99-local.rules instead of 10-local.rules. This makes all the user rules apply after others, so their results wouldn't be overriden by anything else. - Large parts of the services.gitlab module has been been - rewritten. There are new configuration options available. The - stateDir option was renamned to - statePath and the satellitesDir - option was removed. Please review the currently available options. + Large parts of the services.gitlab module has been been rewritten. There are new configuration options available. The stateDir option was renamned to statePath and the satellitesDir option was removed. Please review the currently available options. - The option no longer - interpret the dollar sign ($) as a shell variable, as such it should not be - escaped anymore. Thus the following zone data: + The option no longer interpret the dollar sign ($) as a shell variable, as such it should not be escaped anymore. Thus the following zone data: \$ORIGIN example.com. @@ -567,9 +473,7 @@ $TTL 1800 - service.syncthing.dataDir options now has to point to - exact folder where syncthing is writing to. Example configuration should - look something like: + service.syncthing.dataDir options now has to point to exact folder where syncthing is writing to. Example configuration should look something like: services.syncthing = { @@ -581,45 +485,24 @@ services.syncthing = { - networking.firewall.allowPing is now enabled by default. - Users are encouraged to configure an appropriate rate limit for their - machines using the Kernel interface at - /proc/sys/net/ipv4/icmp_ratelimit and - /proc/sys/net/ipv6/icmp/ratelimit or using the - firewall itself, i.e. by setting the NixOS option - networking.firewall.pingLimit. + networking.firewall.allowPing is now enabled by default. Users are encouraged to configure an appropriate rate limit for their machines using the Kernel interface at /proc/sys/net/ipv4/icmp_ratelimit and /proc/sys/net/ipv6/icmp/ratelimit or using the firewall itself, i.e. by setting the NixOS option networking.firewall.pingLimit. - Systems with some broadcom cards used to result into a generated config - that is no longer accepted. If you get errors like + Systems with some broadcom cards used to result into a generated config that is no longer accepted. If you get errors like error: path ‘/nix/store/*-broadcom-sta-*’ does not exist and cannot be created - you should either re-run nixos-generate-config or - manually replace - "${config.boot.kernelPackages.broadcom_sta}" by - config.boot.kernelPackages.broadcom_sta in your - /etc/nixos/hardware-configuration.nix. More discussion - is on the - github issue. + you should either re-run nixos-generate-config or manually replace "${config.boot.kernelPackages.broadcom_sta}" by config.boot.kernelPackages.broadcom_sta in your /etc/nixos/hardware-configuration.nix. More discussion is on the github issue. - The services.xserver.startGnuPGAgent option has been - removed. GnuPG 2.1.x changed the way the gpg-agent works, and that new - approach no longer requires (or even supports) the "start everything as a - child of the agent" scheme we've implemented in NixOS for older versions. - To configure the gpg-agent for your X session, add the following code to - ~/.bashrc or some file that’s sourced when your - shell is started: + The services.xserver.startGnuPGAgent option has been removed. GnuPG 2.1.x changed the way the gpg-agent works, and that new approach no longer requires (or even supports) the "start everything as a child of the agent" scheme we've implemented in NixOS for older versions. To configure the gpg-agent for your X session, add the following code to ~/.bashrc or some file that’s sourced when your shell is started: GPG_TTY=$(tty) export GPG_TTY - If you want to use gpg-agent for SSH, too, add the following to your - session initialization (e.g. - displayManager.sessionCommands) + If you want to use gpg-agent for SSH, too, add the following to your session initialization (e.g. displayManager.sessionCommands) gpg-connect-agent /bye unset SSH_AGENT_PID @@ -629,15 +512,11 @@ export SSH_AUTH_SOCK="''${HOME}/.gnupg/S.gpg-agent.ssh" enable-ssh-support - is included in your ~/.gnupg/gpg-agent.conf. You will - need to use ssh-add to re-add your ssh keys. If gpg’s - automatic transformation of the private keys to the new format fails, you - will need to re-import your private keyring as well: + is included in your ~/.gnupg/gpg-agent.conf. You will need to use ssh-add to re-add your ssh keys. If gpg’s automatic transformation of the private keys to the new format fails, you will need to re-import your private keyring as well: gpg --import ~/.gnupg/secring.gpg - The gpg-agent(1) man page has more details about this - subject, i.e. in the "EXAMPLES" section. + The gpg-agent(1) man page has more details about this subject, i.e. in the "EXAMPLES" section. @@ -661,9 +540,7 @@ gpg --import ~/.gnupg/secring.gpg - Input method support was improved. New NixOS modules (fcitx, nabi and - uim), fcitx engines (chewing, hangul, m17n, mozc and table-other) and ibus - engines (hangul and m17n) have been added. + Input method support was improved. New NixOS modules (fcitx, nabi and uim), fcitx engines (chewing, hangul, m17n, mozc and table-other) and ibus engines (hangul and m17n) have been added. diff --git a/nixos/doc/manual/release-notes/rl-1609.xml b/nixos/doc/manual/release-notes/rl-1609.xml index 4a2343edc970..95e8fe3abcbc 100644 --- a/nixos/doc/manual/release-notes/rl-1609.xml +++ b/nixos/doc/manual/release-notes/rl-1609.xml @@ -6,48 +6,36 @@ Release 16.09 (“Flounder”, 2016/09/30) - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: - Many NixOS configurations and Nix packages now use significantly less disk - space, thanks to the - extensive - work on closure size reduction. For example, the closure size of a - minimal NixOS container went down from ~424 MiB in 16.03 to ~212 MiB in - 16.09, while the closure size of Firefox went from ~651 MiB to ~259 MiB. + Many NixOS configurations and Nix packages now use significantly less disk space, thanks to the extensive work on closure size reduction. For example, the closure size of a minimal NixOS container went down from ~424 MiB in 16.03 to ~212 MiB in 16.09, while the closure size of Firefox went from ~651 MiB to ~259 MiB. - To improve security, packages are now - built - using various hardening features. See the Nixpkgs manual for more - information. + To improve security, packages are now built using various hardening features. See the Nixpkgs manual for more information. Support for PXE netboot. See - for documentation. + linkend="sec-booting-from-pxe" /> for documentation. - X.org server 1.18. If you use the ati_unfree driver, - 1.17 is still used due to an ABI incompatibility. + X.org server 1.18. If you use the ati_unfree driver, 1.17 is still used due to an ABI incompatibility. - This release is based on Glibc 2.24, GCC 5.4.0 and systemd 231. The default - Linux kernel remains 4.4. + This release is based on Glibc 2.24, GCC 5.4.0 and systemd 231. The default Linux kernel remains 4.4. @@ -65,122 +53,71 @@
- When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: - A large number of packages have been converted to use the multiple outputs - feature of Nix to greatly reduce the amount of required disk space, as - mentioned above. This may require changes to any custom packages to make - them build again; see the relevant chapter in the Nixpkgs manual for more - information. (Additional caveat to packagers: some packaging conventions - related to multiple-output packages - were - changed late (August 2016) in the release cycle and differ from the - initial introduction of multiple outputs.) + A large number of packages have been converted to use the multiple outputs feature of Nix to greatly reduce the amount of required disk space, as mentioned above. This may require changes to any custom packages to make them build again; see the relevant chapter in the Nixpkgs manual for more information. (Additional caveat to packagers: some packaging conventions related to multiple-output packages were changed late (August 2016) in the release cycle and differ from the initial introduction of multiple outputs.) - Previous versions of Nixpkgs had support for all versions of the LTS - Haskell package set. That support has been dropped. The previously provided - haskell.packages.lts-x_y package sets still exist in - name to aviod breaking user code, but these package sets don't actually - contain the versions mandated by the corresponding LTS release. Instead, - our package set it loosely based on the latest available LTS release, i.e. - LTS 7.x at the time of this writing. New releases of NixOS and Nixpkgs will - drop those old names entirely. - The - motivation for this change has been discussed at length on the - nix-dev mailing list and in - Github - issue #14897. Development strategies for Haskell hackers who want to - rely on Nix and NixOS have been described in - another - nix-dev article. + Previous versions of Nixpkgs had support for all versions of the LTS Haskell package set. That support has been dropped. The previously provided haskell.packages.lts-x_y package sets still exist in name to aviod breaking user code, but these package sets don't actually contain the versions mandated by the corresponding LTS release. Instead, our package set it loosely based on the latest available LTS release, i.e. LTS 7.x at the time of this writing. New releases of NixOS and Nixpkgs will drop those old names entirely. The motivation for this change has been discussed at length on the nix-dev mailing list and in Github issue #14897. Development strategies for Haskell hackers who want to rely on Nix and NixOS have been described in another nix-dev article. - Shell aliases for systemd sub-commands - were - dropped: start, stop, - restart, status. + Shell aliases for systemd sub-commands were dropped: start, stop, restart, status. - Redis now binds to 127.0.0.1 only instead of listening to all network - interfaces. This is the default behavior of Redis 3.2 + Redis now binds to 127.0.0.1 only instead of listening to all network interfaces. This is the default behavior of Redis 3.2 - /var/empty is now immutable. Activation script runs - chattr +i to forbid any modifications inside the folder. - See the - pull request for what bugs this caused. + /var/empty is now immutable. Activation script runs chattr +i to forbid any modifications inside the folder. See the pull request for what bugs this caused. - Gitlab's maintainance script gitlab-runner was removed - and split up into the more clearer gitlab-run and - gitlab-rake scripts, because - gitlab-runner is a component of Gitlab CI. + Gitlab's maintainance script gitlab-runner was removed and split up into the more clearer gitlab-run and gitlab-rake scripts, because gitlab-runner is a component of Gitlab CI. - services.xserver.libinput.accelProfile default changed - from flat to adaptive, as per - - official documentation. + services.xserver.libinput.accelProfile default changed from flat to adaptive, as per official documentation. - fonts.fontconfig.ultimate.rendering was removed because - our presets were obsolete for some time. New presets are hardcoded into - FreeType; you can select a preset via - fonts.fontconfig.ultimate.preset. You can customize - those presets via ordinary environment variables, using - environment.variables. + fonts.fontconfig.ultimate.rendering was removed because our presets were obsolete for some time. New presets are hardcoded into FreeType; you can select a preset via fonts.fontconfig.ultimate.preset. You can customize those presets via ordinary environment variables, using environment.variables. - The audit service is no longer enabled by default. Use - security.audit.enable = true to explicitly enable it. + The audit service is no longer enabled by default. Use security.audit.enable = true to explicitly enable it. - pkgs.linuxPackages.virtualbox now contains only the - kernel modules instead of the VirtualBox user space binaries. If you want - to reference the user space binaries, you have to use the new - pkgs.virtualbox instead. + pkgs.linuxPackages.virtualbox now contains only the kernel modules instead of the VirtualBox user space binaries. If you want to reference the user space binaries, you have to use the new pkgs.virtualbox instead. - goPackages was replaced with separated Go applications - in appropriate nixpkgs categories. Each Go package uses - its own dependency set. There's also a new go2nix tool - introduced to generate a Go package definition from its Go source - automatically. + goPackages was replaced with separated Go applications in appropriate nixpkgs categories. Each Go package uses its own dependency set. There's also a new go2nix tool introduced to generate a Go package definition from its Go source automatically. - services.mongodb.extraConfig configuration format was - changed to YAML. + services.mongodb.extraConfig configuration format was changed to YAML. @@ -197,70 +134,42 @@ - Revamped grsecurity/PaX support. There is now only a single general-purpose - distribution kernel and the configuration interface has been streamlined. - Desktop users should be able to simply set + Revamped grsecurity/PaX support. There is now only a single general-purpose distribution kernel and the configuration interface has been streamlined. Desktop users should be able to simply set security.grsecurity.enable = true - to get a reasonably secure system without having to sacrifice too much - functionality. + to get a reasonably secure system without having to sacrifice too much functionality. - Special filesystems, like /proc, /run - and others, now have the same mount options as recommended by systemd and - are unified across different places in NixOS. Mount options are updated - during nixos-rebuild switch if possible. One benefit - from this is improved security — most such filesystems are now mounted - with noexec, nodev and/or - nosuid options. + Special filesystems, like /proc, /run and others, now have the same mount options as recommended by systemd and are unified across different places in NixOS. Mount options are updated during nixos-rebuild switch if possible. One benefit from this is improved security — most such filesystems are now mounted with noexec, nodev and/or nosuid options. - The reverse path filter was interfering with DHCPv4 server operation in the - past. An exception for DHCPv4 and a new option to log packets that were - dropped due to the reverse path filter was added - (networking.firewall.logReversePathDrops) for easier - debugging. + The reverse path filter was interfering with DHCPv4 server operation in the past. An exception for DHCPv4 and a new option to log packets that were dropped due to the reverse path filter was added (networking.firewall.logReversePathDrops) for easier debugging. - Containers configuration within - containers.<name>.config is - now - properly typed and checked. In particular, partial configurations - are merged correctly. + Containers configuration within containers.<name>.config is now properly typed and checked. In particular, partial configurations are merged correctly. - The directory container setuid wrapper programs, - /var/setuid-wrappers, - is now - updated atomically to prevent failures if the switch to a new configuration - is interrupted. + The directory container setuid wrapper programs, /var/setuid-wrappers, is now updated atomically to prevent failures if the switch to a new configuration is interrupted. - services.xserver.startGnuPGAgent has been removed due to - GnuPG 2.1.x bump. See - - how to achieve similar behavior. You might need to pkill - gpg-agent after the upgrade to prevent a stale agent being in the - way. + services.xserver.startGnuPGAgent has been removed due to GnuPG 2.1.x bump. See how to achieve similar behavior. You might need to pkill gpg-agent after the upgrade to prevent a stale agent being in the way. - - Declarative users could share the uid due to the bug in the script handling - conflict resolution. + Declarative users could share the uid due to the bug in the script handling conflict resolution. diff --git a/nixos/doc/manual/release-notes/rl-1703.xml b/nixos/doc/manual/release-notes/rl-1703.xml index 14b31b232e90..49c364a103ae 100644 --- a/nixos/doc/manual/release-notes/rl-1703.xml +++ b/nixos/doc/manual/release-notes/rl-1703.xml @@ -13,29 +13,24 @@ Highlights - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: - Nixpkgs is now extensible through overlays. See the - Nixpkgs - manual for more information. + Nixpkgs is now extensible through overlays. See the Nixpkgs manual for more information. - This release is based on Glibc 2.25, GCC 5.4.0 and systemd 232. The - default Linux kernel is 4.9 and Nix is at 1.11.8. + This release is based on Glibc 2.25, GCC 5.4.0 and systemd 232. The default Linux kernel is 4.9 and Nix is at 1.11.8. - The default desktop environment now is KDE's Plasma 5. KDE 4 has been - removed + The default desktop environment now is KDE's Plasma 5. KDE 4 has been removed @@ -45,35 +40,24 @@ - X.org server uses branch 1.19. Due to ABI incompatibilities, - ati_unfree keeps forcing 1.17 and - amdgpu-pro starts forcing 1.18. + X.org server uses branch 1.19. Due to ABI incompatibilities, ati_unfree keeps forcing 1.17 and amdgpu-pro starts forcing 1.18. - Cross compilation has been rewritten. See the nixpkgs manual for details. - The most obvious breaking change is that in derivations there is no - .nativeDrv nor .crossDrv are now - cross by default, not native. + Cross compilation has been rewritten. See the nixpkgs manual for details. The most obvious breaking change is that in derivations there is no .nativeDrv nor .crossDrv are now cross by default, not native. - The overridePackages function has been rewritten to be - replaced by - - overlays + The overridePackages function has been rewritten to be replaced by overlays - Packages in nixpkgs can be marked as insecure through listed - vulnerabilities. See the - Nixpkgs - manual for more information. + Packages in nixpkgs can be marked as insecure through listed vulnerabilities. See the Nixpkgs manual for more information. @@ -512,92 +496,64 @@ Backward Incompatibilities - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: - Derivations have no .nativeDrv nor - .crossDrv and are now cross by default, not native. + Derivations have no .nativeDrv nor .crossDrv and are now cross by default, not native. - stdenv.overrides is now expected to take - self and super arguments. See - lib.trivial.extends for what those parameters - represent. + stdenv.overrides is now expected to take self and super arguments. See lib.trivial.extends for what those parameters represent. - ansible now defaults to ansible version 2 as version 1 - has been removed due to a serious - - vulnerability unpatched by upstream. + ansible now defaults to ansible version 2 as version 1 has been removed due to a serious vulnerability unpatched by upstream. - gnome alias has been removed along with - gtk, gtkmm and several others. Now - you need to use versioned attributes, like gnome3. + gnome alias has been removed along with gtk, gtkmm and several others. Now you need to use versioned attributes, like gnome3. - The attribute name of the Radicale daemon has been changed from - pythonPackages.radicale to radicale. + The attribute name of the Radicale daemon has been changed from pythonPackages.radicale to radicale. - The stripHash bash function in - stdenv changed according to its documentation; it now - outputs the stripped name to stdout instead of putting - it in the variable strippedName. + The stripHash bash function in stdenv changed according to its documentation; it now outputs the stripped name to stdout instead of putting it in the variable strippedName. - PHP now scans for extra configuration .ini files in /etc/php.d instead of - /etc. This prevents accidentally loading non-PHP .ini files that may be in - /etc. + PHP now scans for extra configuration .ini files in /etc/php.d instead of /etc. This prevents accidentally loading non-PHP .ini files that may be in /etc. - Two lone top-level dict dbs moved into dictdDBs. This - affects: dictdWordnet which is now at - dictdDBs.wordnet and dictdWiktionary - which is now at dictdDBs.wiktionary + Two lone top-level dict dbs moved into dictdDBs. This affects: dictdWordnet which is now at dictdDBs.wordnet and dictdWiktionary which is now at dictdDBs.wiktionary - Parsoid service now uses YAML configuration format. - service.parsoid.interwikis is now called - service.parsoid.wikis and is a list of either API URLs - or attribute sets as specified in parsoid's documentation. + Parsoid service now uses YAML configuration format. service.parsoid.interwikis is now called service.parsoid.wikis and is a list of either API URLs or attribute sets as specified in parsoid's documentation. - Ntpd was replaced by - systemd-timesyncd as the default service to synchronize - system time with a remote NTP server. The old behavior can be restored by - setting services.ntp.enable to true. - Upstream time servers for all NTP implementations are now configured using - networking.timeServers. + Ntpd was replaced by systemd-timesyncd as the default service to synchronize system time with a remote NTP server. The old behavior can be restored by setting services.ntp.enable to true. Upstream time servers for all NTP implementations are now configured using networking.timeServers. - service.nylon is now declared using named instances. As - an example: + service.nylon is now declared using named instances. As an example: services.nylon = { enable = true; @@ -620,11 +576,8 @@ - overridePackages function no longer exists. It is - replaced by - - overlays. For example, the following code: + overridePackages function no longer exists. It is replaced by overlays. For example, the following code: let pkgs = import <nixpkgs> {}; @@ -642,72 +595,42 @@ in - Autoloading connection tracking helpers is now disabled by default. This - default was also changed in the Linux kernel and is considered insecure if - not configured properly in your firewall. If you need connection tracking - helpers (i.e. for active FTP) please enable - networking.firewall.autoLoadConntrackHelpers and tune - networking.firewall.connectionTrackingModules to suit - your needs. + Autoloading connection tracking helpers is now disabled by default. This default was also changed in the Linux kernel and is considered insecure if not configured properly in your firewall. If you need connection tracking helpers (i.e. for active FTP) please enable networking.firewall.autoLoadConntrackHelpers and tune networking.firewall.connectionTrackingModules to suit your needs. - local_recipient_maps is not set to empty value by - Postfix service. It's an insecure default as stated by Postfix - documentation. Those who want to retain this setting need to set it via - services.postfix.extraConfig. + local_recipient_maps is not set to empty value by Postfix service. It's an insecure default as stated by Postfix documentation. Those who want to retain this setting need to set it via services.postfix.extraConfig. - Iputils no longer provide ping6 and traceroute6. The functionality of - these tools has been integrated into ping and traceroute respectively. To - enforce an address family the new flags -4 and - -6 have been added. One notable incompatibility is that - specifying an interface (for link-local IPv6 for instance) is no longer - done with the -I flag, but by encoding the interface - into the address (ping fe80::1%eth0). + Iputils no longer provide ping6 and traceroute6. The functionality of these tools has been integrated into ping and traceroute respectively. To enforce an address family the new flags -4 and -6 have been added. One notable incompatibility is that specifying an interface (for link-local IPv6 for instance) is no longer done with the -I flag, but by encoding the interface into the address (ping fe80::1%eth0). - The socket handling of the services.rmilter module has - been fixed and refactored. As rmilter doesn't support binding to more than - one socket, the options bindUnixSockets and - bindInetSockets have been replaced by - services.rmilter.bindSocket.*. The default is still a - unix socket in /run/rmilter/rmilter.sock. Refer to the - options documentation for more information. + The socket handling of the services.rmilter module has been fixed and refactored. As rmilter doesn't support binding to more than one socket, the options bindUnixSockets and bindInetSockets have been replaced by services.rmilter.bindSocket.*. The default is still a unix socket in /run/rmilter/rmilter.sock. Refer to the options documentation for more information. - The fetch* functions no longer support md5, please use - sha256 instead. + The fetch* functions no longer support md5, please use sha256 instead. - The dnscrypt-proxy module interface has been streamlined around the - option. Where possible, legacy option - declarations are mapped to but will emit - warnings. The has been outright removed: to - use an unlisted resolver, use the option. + The dnscrypt-proxy module interface has been streamlined around the option. Where possible, legacy option declarations are mapped to but will emit warnings. The has been outright removed: to use an unlisted resolver, use the option. - torbrowser now stores local state under - ~/.local/share/tor-browser by default. Any browser - profile data from the old location, ~/.torbrowser4, - must be migrated manually. + torbrowser now stores local state under ~/.local/share/tor-browser by default. Any browser profile data from the old location, ~/.torbrowser4, must be migrated manually. - The ihaskell, monetdb, offlineimap and sitecopy services have been - removed. + The ihaskell, monetdb, offlineimap and sitecopy services have been removed. @@ -723,18 +646,12 @@ in - Module type system have a new extensible option types feature that allow - to extend certain types, such as enum, through multiple option - declarations of the same option across multiple modules. + Module type system have a new extensible option types feature that allow to extend certain types, such as enum, through multiple option declarations of the same option across multiple modules. - jre now defaults to GTK UI by default. This improves - visual consistency and makes Java follow system font style, improving the - situation on HighDPI displays. This has a cost of increased closure size; - for server and other headless workloads it's recommended to use - jre_headless. + jre now defaults to GTK UI by default. This improves visual consistency and makes Java follow system font style, improving the situation on HighDPI displays. This has a cost of increased closure size; for server and other headless workloads it's recommended to use jre_headless. @@ -744,53 +661,37 @@ in - The Python 2.7 interpreter does not use modules anymore. Instead, all - CPython interpreters now include the whole standard library except for - `tkinter`, which is available in the Python package set. + The Python 2.7 interpreter does not use modules anymore. Instead, all CPython interpreters now include the whole standard library except for `tkinter`, which is available in the Python package set. - Python 2.7, 3.5 and 3.6 are now built deterministically and 3.4 mostly. - Minor modifications had to be made to the interpreters in order to - generate deterministic bytecode. This has security implications and is - relevant for those using Python in a nix-shell. See the - Nixpkgs manual for details. + Python 2.7, 3.5 and 3.6 are now built deterministically and 3.4 mostly. Minor modifications had to be made to the interpreters in order to generate deterministic bytecode. This has security implications and is relevant for those using Python in a nix-shell. See the Nixpkgs manual for details. - The Python package sets now use a fixed-point combinator and the sets are - available as attributes of the interpreters. + The Python package sets now use a fixed-point combinator and the sets are available as attributes of the interpreters. - The Python function buildPythonPackage has been - improved and can be used to build from Setuptools source, Flit source, and - precompiled Wheels. + The Python function buildPythonPackage has been improved and can be used to build from Setuptools source, Flit source, and precompiled Wheels. - When adding new or updating current Python libraries, the expressions - should be put in separate files in - pkgs/development/python-modules and called from - python-packages.nix. + When adding new or updating current Python libraries, the expressions should be put in separate files in pkgs/development/python-modules and called from python-packages.nix. - The dnscrypt-proxy service supports synchronizing the list of public - resolvers without working DNS resolution. This fixes issues caused by the - resolver list becoming outdated. It also improves the viability of - DNSCrypt only configurations. + The dnscrypt-proxy service supports synchronizing the list of public resolvers without working DNS resolution. This fixes issues caused by the resolver list becoming outdated. It also improves the viability of DNSCrypt only configurations. - Containers using bridged networking no longer lose their connection after - changes to the host networking. + Containers using bridged networking no longer lose their connection after changes to the host networking. @@ -800,16 +701,12 @@ in - The bind DNS utilities (e.g. dig) have been split into their own output - and are now also available in pkgs.dnsutils and it is - no longer necessary to pull in all of bind to use them. + The bind DNS utilities (e.g. dig) have been split into their own output and are now also available in pkgs.dnsutils and it is no longer necessary to pull in all of bind to use them. - Per-user configuration was moved from ~/.nixpkgs to - ~/.config/nixpkgs. The former is still valid for - config.nix for backwards compatibility. + Per-user configuration was moved from ~/.nixpkgs to ~/.config/nixpkgs. The former is still valid for config.nix for backwards compatibility. diff --git a/nixos/doc/manual/release-notes/rl-1709.xml b/nixos/doc/manual/release-notes/rl-1709.xml index 795c51d2923d..ff70bb663a00 100644 --- a/nixos/doc/manual/release-notes/rl-1709.xml +++ b/nixos/doc/manual/release-notes/rl-1709.xml @@ -13,30 +13,23 @@ Highlights - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: - The GNOME version is now 3.24. KDE Plasma was upgraded to 5.10, KDE - Applications to 17.08.1 and KDE Frameworks to 5.37. + The GNOME version is now 3.24. KDE Plasma was upgraded to 5.10, KDE Applications to 17.08.1 and KDE Frameworks to 5.37. - The user handling now keeps track of deallocated UIDs/GIDs. When a user or - group is revived, this allows it to be allocated the UID/GID it had - before. A consequence is that UIDs and GIDs are no longer reused. + The user handling now keeps track of deallocated UIDs/GIDs. When a user or group is revived, this allows it to be allocated the UID/GID it had before. A consequence is that UIDs and GIDs are no longer reused. - The module option now causes - the first head specified in this list to be set as the primary head. Apart - from that, it's now possible to also set additional options by using an - attribute set, for example: + The module option now causes the first head specified in this list to be set as the primary head. Apart from that, it's now possible to also set additional options by using an attribute set, for example: { services.xserver.xrandrHeads = [ "HDMI-0" @@ -50,36 +43,21 @@ ]; } - This will set the DVI-0 output to be the primary head, - even though HDMI-0 is the first head in the list. + This will set the DVI-0 output to be the primary head, even though HDMI-0 is the first head in the list. - The handling of SSL in the services.nginx module has - been cleaned up, renaming the misnamed enableSSL to - onlySSL which reflects its original intention. This is - not to be used with the already existing forceSSL which - creates a second non-SSL virtual host redirecting to the SSL virtual host. - This by chance had worked earlier due to specific implementation details. - In case you had specified both please remove the - enableSSL option to keep the previous behaviour. + The handling of SSL in the services.nginx module has been cleaned up, renaming the misnamed enableSSL to onlySSL which reflects its original intention. This is not to be used with the already existing forceSSL which creates a second non-SSL virtual host redirecting to the SSL virtual host. This by chance had worked earlier due to specific implementation details. In case you had specified both please remove the enableSSL option to keep the previous behaviour. - Another addSSL option has been introduced to configure - both a non-SSL virtual host and an SSL virtual host with the same - configuration. + Another addSSL option has been introduced to configure both a non-SSL virtual host and an SSL virtual host with the same configuration. - Options to configure resolver options and - upstream blocks have been introduced. See their - information for further details. + Options to configure resolver options and upstream blocks have been introduced. See their information for further details. - The port option has been replaced by a more generic - listen option which makes it possible to specify - multiple addresses, ports and SSL configs dependant on the new SSL - handling mentioned above. + The port option has been replaced by a more generic listen option which makes it possible to specify multiple addresses, ports and SSL configs dependant on the new SSL handling mentioned above. @@ -468,47 +446,31 @@ Backward Incompatibilities - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: - In an Qemu-based virtualization environment, the - network interface names changed from i.e. enp0s3 to - ens3. + In an Qemu-based virtualization environment, the network interface names changed from i.e. enp0s3 to ens3. - This is due to a kernel configuration change. The new naming is consistent - with those of other Linux distributions with systemd. See - #29197 - for more information. + This is due to a kernel configuration change. The new naming is consistent with those of other Linux distributions with systemd. See #29197 for more information. - A machine is affected if the virt-what tool either - returns qemu or kvm - and has interface names used in any part of its NixOS - configuration, in particular if a static network configuration with - networking.interfaces is used. + A machine is affected if the virt-what tool either returns qemu or kvm and has interface names used in any part of its NixOS configuration, in particular if a static network configuration with networking.interfaces is used. Before rebooting affected machines, please ensure: - Change the interface names in your NixOS configuration. The first - interface will be called ens3, the second one - ens8 and starting from there incremented by 1. + Change the interface names in your NixOS configuration. The first interface will be called ens3, the second one ens8 and starting from there incremented by 1. - After changing the interface names, rebuild your system with - nixos-rebuild boot to activate the new configuration - after a reboot. If you switch to the new configuration right away you - might lose network connectivity! If using nixops, - deploy with nixops deploy --force-reboot. + After changing the interface names, rebuild your system with nixos-rebuild boot to activate the new configuration after a reboot. If you switch to the new configuration right away you might lose network connectivity! If using nixops, deploy with nixops deploy --force-reboot. @@ -516,88 +478,59 @@ - The following changes apply if the stateVersion is - changed to 17.09 or higher. For stateVersion = "17.03" - or lower the old behavior is preserved. + The following changes apply if the stateVersion is changed to 17.09 or higher. For stateVersion = "17.03" or lower the old behavior is preserved. - The postgres default version was changed from 9.5 to - 9.6. + The postgres default version was changed from 9.5 to 9.6. - The postgres superuser name has changed from - root to postgres to more closely - follow what other Linux distributions are doing. + The postgres superuser name has changed from root to postgres to more closely follow what other Linux distributions are doing. - The postgres default dataDir has - changed from /var/db/postgres to - /var/lib/postgresql/$psqlSchema where $psqlSchema is - 9.6 for example. + The postgres default dataDir has changed from /var/db/postgres to /var/lib/postgresql/$psqlSchema where $psqlSchema is 9.6 for example. - The mysql default dataDir has - changed from /var/mysql to - /var/lib/mysql. + The mysql default dataDir has changed from /var/mysql to /var/lib/mysql. - Radicale's default package has changed from 1.x to 2.x. Instructions to - migrate can be found here - . It is also possible to use the newer version by setting the - package to radicale2, which is - done automatically when stateVersion is 17.09 or - higher. The extraArgs option has been added to allow - passing the data migration arguments specified in the instructions; see - the - radicale.nix - NixOS test for an example migration. + Radicale's default package has changed from 1.x to 2.x. Instructions to migrate can be found here . It is also possible to use the newer version by setting the package to radicale2, which is done automatically when stateVersion is 17.09 or higher. The extraArgs option has been added to allow passing the data migration arguments specified in the instructions; see the radicale.nix NixOS test for an example migration. - The aiccu package was removed. This is due to SixXS - sunsetting its IPv6 - tunnel. + The aiccu package was removed. This is due to SixXS sunsetting its IPv6 tunnel. - The fanctl package and fan module - have been removed due to the developers not upstreaming their iproute2 - patches and lagging with compatibility to recent iproute2 versions. + The fanctl package and fan module have been removed due to the developers not upstreaming their iproute2 patches and lagging with compatibility to recent iproute2 versions. - Top-level idea package collection was renamed. All - JetBrains IDEs are now at jetbrains. + Top-level idea package collection was renamed. All JetBrains IDEs are now at jetbrains. - flexget's state database cannot be upgraded to its new - internal format, requiring removal of any existing - db-config.sqlite which will be automatically recreated. + flexget's state database cannot be upgraded to its new internal format, requiring removal of any existing db-config.sqlite which will be automatically recreated. - The ipfs service now doesn't ignore the - dataDir option anymore. If you've ever set this option - to anything other than the default you'll have to either unset it (so the - default gets used) or migrate the old data manually with + The ipfs service now doesn't ignore the dataDir option anymore. If you've ever set this option to anything other than the default you'll have to either unset it (so the default gets used) or migrate the old data manually with dataDir=<valueOfDataDir> mv /var/lib/ipfs/.ipfs/* $dataDir @@ -607,107 +540,66 @@ rmdir /var/lib/ipfs/.ipfs - The caddy service was previously using an extra - .caddy directory in the data directory specified with - the dataDir option. The contents of the - .caddy directory are now expected to be in the - dataDir. + The caddy service was previously using an extra .caddy directory in the data directory specified with the dataDir option. The contents of the .caddy directory are now expected to be in the dataDir. - The ssh-agent user service is not started by default - anymore. Use programs.ssh.startAgent to enable it if - needed. There is also a new programs.gnupg.agent module - that creates a gpg-agent user service. It can also - serve as a SSH agent if enableSSHSupport is set. + The ssh-agent user service is not started by default anymore. Use programs.ssh.startAgent to enable it if needed. There is also a new programs.gnupg.agent module that creates a gpg-agent user service. It can also serve as a SSH agent if enableSSHSupport is set. - The services.tinc.networks.<name>.listenAddress - option had a misleading name that did not correspond to its behavior. It - now correctly defines the ip to listen for incoming connections on. To - keep the previous behaviour, use - services.tinc.networks.<name>.bindToAddress - instead. Refer to the description of the options for more details. + The services.tinc.networks.<name>.listenAddress option had a misleading name that did not correspond to its behavior. It now correctly defines the ip to listen for incoming connections on. To keep the previous behaviour, use services.tinc.networks.<name>.bindToAddress instead. Refer to the description of the options for more details. - tlsdate package and module were removed. This is due to - the project being dead and not building with openssl 1.1. + tlsdate package and module were removed. This is due to the project being dead and not building with openssl 1.1. - wvdial package and module were removed. This is due to - the project being dead and not building with openssl 1.1. + wvdial package and module were removed. This is due to the project being dead and not building with openssl 1.1. - cc-wrapper's setup-hook now exports a number of - environment variables corresponding to binutils binaries, (e.g. - LD, STRIP, RANLIB, etc). This - is done to prevent packages' build systems guessing, which is harder to - predict, especially when cross-compiling. However, some packages have - broken due to this—their build systems either not supporting, or - claiming to support without adequate testing, taking such environment - variables as parameters. + cc-wrapper's setup-hook now exports a number of environment variables corresponding to binutils binaries, (e.g. LD, STRIP, RANLIB, etc). This is done to prevent packages' build systems guessing, which is harder to predict, especially when cross-compiling. However, some packages have broken due to this—their build systems either not supporting, or claiming to support without adequate testing, taking such environment variables as parameters. - services.firefox.syncserver now runs by default as a - non-root user. To accomodate this change, the default sqlite database - location has also been changed. Migration should work automatically. Refer - to the description of the options for more details. + services.firefox.syncserver now runs by default as a non-root user. To accomodate this change, the default sqlite database location has also been changed. Migration should work automatically. Refer to the description of the options for more details. - The compiz window manager and package was removed. The - system support had been broken for several years. + The compiz window manager and package was removed. The system support had been broken for several years. - Touchpad support should now be enabled through libinput - as synaptics is now deprecated. See the option - services.xserver.libinput.enable. + Touchpad support should now be enabled through libinput as synaptics is now deprecated. See the option services.xserver.libinput.enable. - grsecurity/PaX support has been dropped, following upstream's decision to - cease free support. See - - upstream's announcement for more information. No complete - replacement for grsecurity/PaX is available presently. + grsecurity/PaX support has been dropped, following upstream's decision to cease free support. See upstream's announcement for more information. No complete replacement for grsecurity/PaX is available presently. - services.mysql now has declarative configuration of - databases and users with the ensureDatabases and - ensureUsers options. + services.mysql now has declarative configuration of databases and users with the ensureDatabases and ensureUsers options. - These options will never delete existing databases and users, especially - not when the value of the options are changed. + These options will never delete existing databases and users, especially not when the value of the options are changed. - The MySQL users will be identified using - - Unix socket authentication. This authenticates the Unix user with - the same name only, and that without the need for a password. + The MySQL users will be identified using Unix socket authentication. This authenticates the Unix user with the same name only, and that without the need for a password. - If you have previously created a MySQL root user - with a password, you will need to add - root user for unix socket authentication before using - the new options. This can be done by running the following SQL script: + If you have previously created a MySQL root user with a password, you will need to add root user for unix socket authentication before using the new options. This can be done by running the following SQL script: CREATE USER 'root'@'%' IDENTIFIED BY ''; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; @@ -720,55 +612,38 @@ FLUSH PRIVILEGES; - services.mysqlBackup now works by default without any - user setup, including for users other than mysql. + services.mysqlBackup now works by default without any user setup, including for users other than mysql. - By default, the mysql user is no longer the user which - performs the backup. Instead a system account - mysqlbackup is used. + By default, the mysql user is no longer the user which performs the backup. Instead a system account mysqlbackup is used. - The mysqlBackup service is also now using systemd - timers instead of cron. + The mysqlBackup service is also now using systemd timers instead of cron. - Therefore, the services.mysqlBackup.period option no - longer exists, and has been replaced with - services.mysqlBackup.calendar, which is in the format - of - services.mysqlBackup.period option no longer exists, and has been replaced with services.mysqlBackup.calendar, which is in the format of systemd.time(7). - If you expect to be sent an e-mail when the backup fails, consider using a - script which monitors the systemd journal for errors. Regretfully, at - present there is no built-in functionality for this. + If you expect to be sent an e-mail when the backup fails, consider using a script which monitors the systemd journal for errors. Regretfully, at present there is no built-in functionality for this. - You can check that backups still work by running systemctl start - mysql-backup then systemctl status - mysql-backup. + You can check that backups still work by running systemctl start mysql-backup then systemctl status mysql-backup. - Templated systemd services e.g container@name are now - handled currectly when switching to a new configuration, resulting in them - being reloaded. + Templated systemd services e.g container@name are now handled currectly when switching to a new configuration, resulting in them being reloaded. - Steam: the newStdcpp parameter was removed and should - not be needed anymore. + Steam: the newStdcpp parameter was removed and should not be needed anymore. - Redis has been updated to version 4 which mandates a cluster mass-restart, - due to changes in the network handling, in order to ensure compatibility - with networks NATing traffic. + Redis has been updated to version 4 which mandates a cluster mass-restart, due to changes in the network handling, in order to ensure compatibility with networks NATing traffic. @@ -784,46 +659,28 @@ FLUSH PRIVILEGES; - Modules can now be disabled by using - - disabledModules, allowing another to take it's place. This can be - used to import a set of modules from another channel while keeping the - rest of the system on a stable release. + Modules can now be disabled by using disabledModules, allowing another to take it's place. This can be used to import a set of modules from another channel while keeping the rest of the system on a stable release. - Updated to FreeType 2.7.1, including a new TrueType engine. The new engine - replaces the Infinality engine which was the default in NixOS. The default - font rendering settings are now provided by fontconfig-penultimate, - replacing fontconfig-ultimate; the new defaults are less invasive and - provide rendering that is more consistent with other systems and hopefully - with each font designer's intent. Some system-wide configuration has been - removed from the Fontconfig NixOS module where user Fontconfig settings - are available. + Updated to FreeType 2.7.1, including a new TrueType engine. The new engine replaces the Infinality engine which was the default in NixOS. The default font rendering settings are now provided by fontconfig-penultimate, replacing fontconfig-ultimate; the new defaults are less invasive and provide rendering that is more consistent with other systems and hopefully with each font designer's intent. Some system-wide configuration has been removed from the Fontconfig NixOS module where user Fontconfig settings are available. - ZFS/SPL have been updated to 0.7.0, zfsUnstable, - splUnstable have therefore been removed. + ZFS/SPL have been updated to 0.7.0, zfsUnstable, splUnstable have therefore been removed. - The option now allows the value - null in addition to timezone strings. This value allows - changing the timezone of a system imperatively using timedatectl - set-timezone. The default timezone is still UTC. + The option now allows the value null in addition to timezone strings. This value allows changing the timezone of a system imperatively using timedatectl set-timezone. The default timezone is still UTC. - Nixpkgs overlays may now be specified with a file as well as a directory. - The value of <nixpkgs-overlays> may be a file, and - ~/.config/nixpkgs/overlays.nix can be used instead of - the ~/.config/nixpkgs/overlays directory. + Nixpkgs overlays may now be specified with a file as well as a directory. The value of <nixpkgs-overlays> may be a file, and ~/.config/nixpkgs/overlays.nix can be used instead of the ~/.config/nixpkgs/overlays directory. See the overlays chapter of the Nixpkgs manual for more details. @@ -831,67 +688,48 @@ FLUSH PRIVILEGES; - Definitions for /etc/hosts can now be specified - declaratively with networking.hosts. + Definitions for /etc/hosts can now be specified declaratively with networking.hosts. - Two new options have been added to the installer loader, in addition to - the default having changed. The kernel log verbosity has been lowered to - the upstream default for the default options, in order to not spam the - console when e.g. joining a network. + Two new options have been added to the installer loader, in addition to the default having changed. The kernel log verbosity has been lowered to the upstream default for the default options, in order to not spam the console when e.g. joining a network. - This therefore leads to adding a new debug option to - set the log level to the previous verbose mode, to make debugging easier, - but still accessible easily. + This therefore leads to adding a new debug option to set the log level to the previous verbose mode, to make debugging easier, but still accessible easily. - Additionally a copytoram option has been added, which - makes it possible to remove the install medium after booting. This allows - tethering from your phone after booting from it. + Additionally a copytoram option has been added, which makes it possible to remove the install medium after booting. This allows tethering from your phone after booting from it. - services.gitlab-runner.configOptions has been added to - specify the configuration of gitlab-runners declaratively. + services.gitlab-runner.configOptions has been added to specify the configuration of gitlab-runners declaratively. - services.jenkins.plugins has been added to install - plugins easily, this can be generated with jenkinsPlugins2nix. + services.jenkins.plugins has been added to install plugins easily, this can be generated with jenkinsPlugins2nix. - services.postfix.config has been added to specify the - main.cf with NixOS options. Additionally other options have been added to - the postfix module and has been improved further. + services.postfix.config has been added to specify the main.cf with NixOS options. Additionally other options have been added to the postfix module and has been improved further. - The GitLab package and module have been updated to the latest 10.0 - release. + The GitLab package and module have been updated to the latest 10.0 release. - The systemd-boot boot loader now lists the NixOS - version, kernel version and build date of all bootable generations. + The systemd-boot boot loader now lists the NixOS version, kernel version and build date of all bootable generations. - The dnscrypt-proxy service now defaults to using a random upstream - resolver, selected from the list of public non-logging resolvers with - DNSSEC support. Existing configurations can be migrated to this mode of - operation by omitting the - option or setting it - to "random". + The dnscrypt-proxy service now defaults to using a random upstream resolver, selected from the list of public non-logging resolvers with DNSSEC support. Existing configurations can be migrated to this mode of operation by omitting the option or setting it to "random". diff --git a/nixos/doc/manual/release-notes/rl-1803.xml b/nixos/doc/manual/release-notes/rl-1803.xml index c14679eea071..2e39b990d9e9 100644 --- a/nixos/doc/manual/release-notes/rl-1803.xml +++ b/nixos/doc/manual/release-notes/rl-1803.xml @@ -13,8 +13,7 @@ Highlights - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: @@ -25,48 +24,36 @@ - Platform support: x86_64-linux and x86_64-darwin since release time (the - latter isn't NixOS, really). Binaries for aarch64-linux are available, but - no channel exists yet, as it's waiting for some test fixes, etc. + Platform support: x86_64-linux and x86_64-darwin since release time (the latter isn't NixOS, really). Binaries for aarch64-linux are available, but no channel exists yet, as it's waiting for some test fixes, etc. - Nix now defaults to 2.0; see its - release - notes. + Nix now defaults to 2.0; see its release notes. - Core version changes: linux: 4.9 -> 4.14, glibc: 2.25 -> 2.26, gcc: 6 -> - 7, systemd: 234 -> 237. + Core version changes: linux: 4.9 -> 4.14, glibc: 2.25 -> 2.26, gcc: 6 -> 7, systemd: 234 -> 237. - Desktop version changes: gnome: 3.24 -> 3.26, (KDE) plasma-desktop: 5.10 - -> 5.12. + Desktop version changes: gnome: 3.24 -> 3.26, (KDE) plasma-desktop: 5.10 -> 5.12. - MariaDB 10.2, updated from 10.1, is now the default MySQL implementation. - While upgrading a few changes have been made to the infrastructure - involved: + MariaDB 10.2, updated from 10.1, is now the default MySQL implementation. While upgrading a few changes have been made to the infrastructure involved: - libmysql has been deprecated, please use - mysql.connector-c instead, a compatibility passthru - has been added to the MySQL packages. + libmysql has been deprecated, please use mysql.connector-c instead, a compatibility passthru has been added to the MySQL packages. - The mysql57 package has a new - static output containing the static libraries - including libmysqld.a + The mysql57 package has a new static output containing the static libraries including libmysqld.a @@ -403,8 +390,7 @@ Backward Incompatibilities - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: @@ -415,39 +401,26 @@ - Dollar signs in options under are passed - verbatim to Postfix, which will interpret them as the beginning of a - parameter expression. This was already true for string-valued options in - the previous release, but not for list-valued options. If you need to pass - literal dollar signs through Postfix, double them. + Dollar signs in options under are passed verbatim to Postfix, which will interpret them as the beginning of a parameter expression. This was already true for string-valued options in the previous release, but not for list-valued options. If you need to pass literal dollar signs through Postfix, double them. - The postage package (for web-based PostgreSQL - administration) has been renamed to pgmanage. The - corresponding module has also been renamed. To migrate please rename all - options to - . + The postage package (for web-based PostgreSQL administration) has been renamed to pgmanage. The corresponding module has also been renamed. To migrate please rename all options to . - Package attributes starting with a digit have been prefixed with an - underscore sign. This is to avoid quoting in the configuration and other - issues with command-line tools like nix-env. The change - affects the following packages: + Package attributes starting with a digit have been prefixed with an underscore sign. This is to avoid quoting in the configuration and other issues with command-line tools like nix-env. The change affects the following packages: - 2048-in-terminal → - _2048-in-terminal + 2048-in-terminal_2048-in-terminal - 90secondportraits → - _90secondportraits + 90secondportraits_90secondportraits @@ -465,134 +438,77 @@ - The OpenSSH service no longer enables support for - DSA keys by default, which could cause a system lock out. Update your keys - or, unfavorably, re-enable DSA support manually. + The OpenSSH service no longer enables support for DSA keys by default, which could cause a system lock out. Update your keys or, unfavorably, re-enable DSA support manually. - DSA support was - deprecated in - OpenSSH 7.0, due to it being too weak. To re-enable support, add - PubkeyAcceptedKeyTypes +ssh-dss to the end of your - . + DSA support was deprecated in OpenSSH 7.0, due to it being too weak. To re-enable support, add PubkeyAcceptedKeyTypes +ssh-dss to the end of your . - After updating the keys to be stronger, anyone still on a pre-17.03 - version is safe to jump to 17.03, as vetted - here. + After updating the keys to be stronger, anyone still on a pre-17.03 version is safe to jump to 17.03, as vetted here. - The openssh package now includes Kerberos support by - default; the openssh_with_kerberos package is now a - deprecated alias. If you do not want Kerberos support, you can do - openssh.override { withKerberos = false; }. Note, this - also applies to the openssh_hpn package. + The openssh package now includes Kerberos support by default; the openssh_with_kerberos package is now a deprecated alias. If you do not want Kerberos support, you can do openssh.override { withKerberos = false; }. Note, this also applies to the openssh_hpn package. - cc-wrapper has been split in two; there is now also a - bintools-wrapper. The most commonly used files in - nix-support are now split between the two wrappers. - Some commonly used ones, like - nix-support/dynamic-linker, are duplicated for - backwards compatability, even though they rightly belong only in - bintools-wrapper. Other more obscure ones are just - moved. + cc-wrapper has been split in two; there is now also a bintools-wrapper. The most commonly used files in nix-support are now split between the two wrappers. Some commonly used ones, like nix-support/dynamic-linker, are duplicated for backwards compatability, even though they rightly belong only in bintools-wrapper. Other more obscure ones are just moved. - The propagation logic has been changed. The new logic, along with new - types of dependencies that go with, is thoroughly documented in the - "Specifying dependencies" section of the "Standard Environment" chapter of - the nixpkgs manual. + The propagation logic has been changed. The new logic, along with new types of dependencies that go with, is thoroughly documented in the "Specifying dependencies" section of the "Standard Environment" chapter of the nixpkgs manual. - The old logic isn't but is easy to describe: dependencies were propagated - as the same type of dependency no matter what. In practice, that means - that many propagatedNativeBuildInputs should instead - be propagatedBuildInputs. Thankfully, that was and is - the least used type of dependency. Also, it means that some - propagatedBuildInputs should instead be - depsTargetTargetPropagated. Other types dependencies - should be unaffected. + The old logic isn't but is easy to describe: dependencies were propagated as the same type of dependency no matter what. In practice, that means that many propagatedNativeBuildInputs should instead be propagatedBuildInputs. Thankfully, that was and is the least used type of dependency. Also, it means that some propagatedBuildInputs should instead be depsTargetTargetPropagated. Other types dependencies should be unaffected. - lib.addPassthru drv passthru is removed. Use - lib.extendDerivation true passthru drv instead. + lib.addPassthru drv passthru is removed. Use lib.extendDerivation true passthru drv instead. - The memcached service no longer accept dynamic socket - paths via . Unix sockets can be - still enabled by and - will be accessible at /run/memcached/memcached.sock. + The memcached service no longer accept dynamic socket paths via . Unix sockets can be still enabled by and will be accessible at /run/memcached/memcached.sock. - The hardware.amdHybridGraphics.disable option was - removed for lack of a maintainer. If you still need this module, you may - wish to include a copy of it from an older version of nixos in your - imports. + The hardware.amdHybridGraphics.disable option was removed for lack of a maintainer. If you still need this module, you may wish to include a copy of it from an older version of nixos in your imports. - The merging of config options for - services.postfix.config was buggy. Previously, if other - options in the Postfix module like - services.postfix.useSrs were set and the user set - config options that were also set by such options, the resulting config - wouldn't include all options that were needed. They are now merged - correctly. If config options need to be overridden, - lib.mkForce or lib.mkOverride can be - used. + The merging of config options for services.postfix.config was buggy. Previously, if other options in the Postfix module like services.postfix.useSrs were set and the user set config options that were also set by such options, the resulting config wouldn't include all options that were needed. They are now merged correctly. If config options need to be overridden, lib.mkForce or lib.mkOverride can be used. - The following changes apply if the stateVersion is - changed to 18.03 or higher. For stateVersion = "17.09" - or lower the old behavior is preserved. + The following changes apply if the stateVersion is changed to 18.03 or higher. For stateVersion = "17.09" or lower the old behavior is preserved. - matrix-synapse uses postgresql by default instead of - sqlite. Migration instructions can be found - - here . + matrix-synapse uses postgresql by default instead of sqlite. Migration instructions can be found here . - The jid package has been removed, due to maintenance - overhead of a go package having non-versioned dependencies. + The jid package has been removed, due to maintenance overhead of a go package having non-versioned dependencies. - When using (enabled by default - in GNOME), it now handles all input devices, not just touchpads. As a - result, you might need to re-evaluate any custom Xorg configuration. In - particular, Option "XkbRules" "base" may result in - broken keyboard layout. + When using (enabled by default in GNOME), it now handles all input devices, not just touchpads. As a result, you might need to re-evaluate any custom Xorg configuration. In particular, Option "XkbRules" "base" may result in broken keyboard layout. - The attic package was removed. A maintained fork called - Borg should be used - instead. Migration instructions can be found - here. + The attic package was removed. A maintained fork called Borg should be used instead. Migration instructions can be found here. @@ -601,52 +517,32 @@ - The package pkgs.piwik was renamed to - pkgs.matomo. + The package pkgs.piwik was renamed to pkgs.matomo. - The service services.piwik was renamed to - services.matomo. + The service services.piwik was renamed to services.matomo. - The data directory /var/lib/piwik was renamed to - /var/lib/matomo. All files will be moved - automatically on first startup, but you might need to adjust your - backup scripts. + The data directory /var/lib/piwik was renamed to /var/lib/matomo. All files will be moved automatically on first startup, but you might need to adjust your backup scripts. - The default for the nginx configuration - changed from piwik.${config.networking.hostName} to - matomo.${config.networking.hostName}.${config.networking.domain} - if is set, - matomo.${config.networking.hostName} if it is not - set. If you change your , remember you'll - need to update the trustedHosts[] array in - /var/lib/matomo/config/config.ini.php as well. + The default for the nginx configuration changed from piwik.${config.networking.hostName} to matomo.${config.networking.hostName}.${config.networking.domain} if is set, matomo.${config.networking.hostName} if it is not set. If you change your , remember you'll need to update the trustedHosts[] array in /var/lib/matomo/config/config.ini.php as well. - The piwik user was renamed to - matomo. The service will adjust ownership - automatically for files in the data directory. If you use unix socket - authentication, remember to give the new matomo user - access to the database and to change the username to - matomo in the [database] section - of /var/lib/matomo/config/config.ini.php. + The piwik user was renamed to matomo. The service will adjust ownership automatically for files in the data directory. If you use unix socket authentication, remember to give the new matomo user access to the database and to change the username to matomo in the [database] section of /var/lib/matomo/config/config.ini.php. - If you named your database `piwik`, you might want to rename it to - `matomo` to keep things clean, but this is neither enforced nor - required. + If you named your database `piwik`, you might want to rename it to `matomo` to keep things clean, but this is neither enforced nor required. @@ -654,59 +550,43 @@ - nodejs-4_x is end-of-life. - nodejs-4_x, nodejs-slim-4_x and - nodePackages_4_x are removed. + nodejs-4_x is end-of-life. nodejs-4_x, nodejs-slim-4_x and nodePackages_4_x are removed. - The pump.io NixOS module was removed. It is now - maintained as an - external - module. + The pump.io NixOS module was removed. It is now maintained as an external module. - The Prosody XMPP server has received a major update. The following modules - were renamed: + The Prosody XMPP server has received a major update. The following modules were renamed: - is now - + is now - is now - + is now - Many new modules are now core modules, most notably - and - . + Many new modules are now core modules, most notably and . - The better-performing libevent backend is now enabled - by default. + The better-performing libevent backend is now enabled by default. - withCommunityModules now passes through the modules to - . Use - withOnlyInstalledCommunityModules for modules that - should not be enabled directly, e.g lib_ldap. + withCommunityModules now passes through the modules to . Use withOnlyInstalledCommunityModules for modules that should not be enabled directly, e.g lib_ldap. - All prometheus exporter modules are now defined as submodules. The - exporters are configured using - services.prometheus.exporters. + All prometheus exporter modules are now defined as submodules. The exporters are configured using services.prometheus.exporters. @@ -722,24 +602,17 @@ - ZNC option now defaults to - true. That means that old configuration is not - overwritten by default when update to the znc options are made. + ZNC option now defaults to true. That means that old configuration is not overwritten by default when update to the znc options are made. - The option - has been added for wireless networks with WPA-Enterprise authentication. - There is also a new option to directly - configure wpa_supplicant and to - connect to hidden networks. + The option has been added for wireless networks with WPA-Enterprise authentication. There is also a new option to directly configure wpa_supplicant and to connect to hidden networks. - In the module the - following options have been removed: + In the module the following options have been removed: @@ -767,34 +640,22 @@ - To assign static addresses to an interface the options - and should - be used instead. The options and - have been renamed to - respectively. The new options - and have been - added to set up static routing. + To assign static addresses to an interface the options and should be used instead. The options and have been renamed to respectively. The new options and have been added to set up static routing. - The option is now - 127.0.0.1 by default. Previously the default behaviour - was to listen on all interfaces. + The option is now 127.0.0.1 by default. Previously the default behaviour was to listen on all interfaces. - services.btrfs.autoScrub has been added, to - periodically check btrfs filesystems for data corruption. If there's a - correct copy available, it will automatically repair corrupted blocks. + services.btrfs.autoScrub has been added, to periodically check btrfs filesystems for data corruption. If there's a correct copy available, it will automatically repair corrupted blocks. - displayManager.lightdm.greeters.gtk.clock-format. has - been added, the clock format string (as expected by strftime, e.g. - %H:%M) to use with the lightdm gtk greeter panel. + displayManager.lightdm.greeters.gtk.clock-format. has been added, the clock format string (as expected by strftime, e.g. %H:%M) to use with the lightdm gtk greeter panel. If set to null the default clock format is used. @@ -802,17 +663,10 @@ - displayManager.lightdm.greeters.gtk.indicators has been - added, a list of allowed indicator modules to use with the lightdm gtk - greeter panel. + displayManager.lightdm.greeters.gtk.indicators has been added, a list of allowed indicator modules to use with the lightdm gtk greeter panel. - Built-in indicators include ~a11y, - ~language, ~session, - ~power, ~clock, - ~host, ~spacer. Unity indicators can - be represented by short name (e.g. sound, - power), service file name, or absolute path. + Built-in indicators include ~a11y, ~language, ~session, ~power, ~clock, ~host, ~spacer. Unity indicators can be represented by short name (e.g. sound, power), service file name, or absolute path. If set to null the default indicators are used. @@ -834,20 +688,12 @@ - The NixOS test driver supports user services declared by - systemd.user.services. The methods - waitForUnit, getUnitInfo, - startJob and stopJob provide an - optional $user argument for that purpose. + The NixOS test driver supports user services declared by systemd.user.services. The methods waitForUnit, getUnitInfo, startJob and stopJob provide an optional $user argument for that purpose. - Enabling bash completion on NixOS, - programs.bash.enableCompletion, will now also enable - completion for the Nix command line tools by installing the - nix-bash-completions - package. + Enabling bash completion on NixOS, programs.bash.enableCompletion, will now also enable completion for the Nix command line tools by installing the nix-bash-completions package. diff --git a/nixos/doc/manual/release-notes/rl-1809.xml b/nixos/doc/manual/release-notes/rl-1809.xml index 3f10b26223dd..df53c6f9dd92 100644 --- a/nixos/doc/manual/release-notes/rl-1809.xml +++ b/nixos/doc/manual/release-notes/rl-1809.xml @@ -13,8 +13,7 @@ Highlights - In addition to numerous new and upgraded packages, this release has the - following notable updates: + In addition to numerous new and upgraded packages, this release has the following notable updates: @@ -25,28 +24,22 @@ - Platform support: x86_64-linux and x86_64-darwin as always. Support for - aarch64-linux is as with the previous releases, not equivalent to the - x86-64-linux release, but with efforts to reach parity. + Platform support: x86_64-linux and x86_64-darwin as always. Support for aarch64-linux is as with the previous releases, not equivalent to the x86-64-linux release, but with efforts to reach parity. - Nix has been updated to 2.1; see its - release - notes. + Nix has been updated to 2.1; see its release notes. - Core versions: linux: 4.14 LTS (unchanged), glibc: 2.26 → 2.27, gcc: 7 - (unchanged), systemd: 237 → 239. + Core versions: linux: 4.14 LTS (unchanged), glibc: 2.26 → 2.27, gcc: 7 (unchanged), systemd: 237 → 239. - Desktop version changes: gnome: 3.26 → 3.28, (KDE) plasma-desktop: 5.12 - → 5.13. + Desktop version changes: gnome: 3.26 → 3.28, (KDE) plasma-desktop: 5.12 → 5.13. @@ -58,8 +51,7 @@ - Support for wrapping binaries using firejail has been - added through programs.firejail.wrappedBinaries. + Support for wrapping binaries using firejail has been added through programs.firejail.wrappedBinaries. For example @@ -74,17 +66,12 @@ programs.firejail = { }; - This will place firefox and mpv - binaries in the global path wrapped by firejail. + This will place firefox and mpv binaries in the global path wrapped by firejail. - User channels are now in the default NIX_PATH, allowing - users to use their personal nix-channel defined - channels in nix-build and nix-shell - commands, as well as in imports like import - <mychannel>. + User channels are now in the default NIX_PATH, allowing users to use their personal nix-channel defined channels in nix-build and nix-shell commands, as well as in imports like import <mychannel>. For example @@ -114,52 +101,31 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull' - The services.cassandra module has been reworked and was - rewritten from scratch. The service has succeeding tests for the versions - 2.1, 2.2, 3.0 and 3.11 of - Apache - Cassandra. + The services.cassandra module has been reworked and was rewritten from scratch. The service has succeeding tests for the versions 2.1, 2.2, 3.0 and 3.11 of Apache Cassandra. - There is a new services.foundationdb module for - deploying - FoundationDB - clusters. + There is a new services.foundationdb module for deploying FoundationDB clusters. - When enabled the iproute2 will copy the files expected - by ip route (e.g., rt_tables) in - /etc/iproute2. This allows to write aliases for - routing tables for instance. + When enabled the iproute2 will copy the files expected by ip route (e.g., rt_tables) in /etc/iproute2. This allows to write aliases for routing tables for instance. - services.strongswan-swanctl is a modern replacement for - services.strongswan. You can use either one of them to - setup IPsec VPNs but not both at the same time. + services.strongswan-swanctl is a modern replacement for services.strongswan. You can use either one of them to setup IPsec VPNs but not both at the same time. - services.strongswan-swanctl uses the - swanctl - command which uses the modern - vici - Versatile IKE Configuration Interface. The deprecated - ipsec command used in - services.strongswan is using the legacy - stroke - configuration interface. + services.strongswan-swanctl uses the swanctl command which uses the modern vici Versatile IKE Configuration Interface. The deprecated ipsec command used in services.strongswan is using the legacy stroke configuration interface. - The new services.elasticsearch-curator service - periodically curates or manages, your Elasticsearch indices and snapshots. + The new services.elasticsearch-curator service periodically curates or manages, your Elasticsearch indices and snapshots. @@ -470,38 +436,32 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull' Backward Incompatibilities - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: - Some licenses that were incorrectly not marked as unfree now are. This is - the case for: + Some licenses that were incorrectly not marked as unfree now are. This is the case for: - cc-by-nc-sa-20: Creative Commons Attribution Non Commercial Share Alike - 2.0 + cc-by-nc-sa-20: Creative Commons Attribution Non Commercial Share Alike 2.0 - cc-by-nc-sa-25: Creative Commons Attribution Non Commercial Share Alike - 2.5 + cc-by-nc-sa-25: Creative Commons Attribution Non Commercial Share Alike 2.5 - cc-by-nc-sa-30: Creative Commons Attribution Non Commercial Share Alike - 3.0 + cc-by-nc-sa-30: Creative Commons Attribution Non Commercial Share Alike 3.0 - cc-by-nc-sa-40: Creative Commons Attribution Non Commercial Share Alike - 4.0 + cc-by-nc-sa-40: Creative Commons Attribution Non Commercial Share Alike 4.0 @@ -519,128 +479,71 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull' - The deprecated services.cassandra module has seen a - complete rewrite. (See above.) + The deprecated services.cassandra module has seen a complete rewrite. (See above.) - lib.strict is removed. Use - builtins.seq instead. + lib.strict is removed. Use builtins.seq instead. - The clementine package points now to the free - derivation. clementineFree is removed now and - clementineUnfree points to the package which is bundled - with the unfree libspotify package. + The clementine package points now to the free derivation. clementineFree is removed now and clementineUnfree points to the package which is bundled with the unfree libspotify package. - The netcat package is now taken directly from OpenBSD's - libressl, instead of relying on Debian's fork. The new - version should be very close to the old version, but there are some minor - differences. Importantly, flags like -b, -q, -C, and -Z are no longer - accepted by the nc command. + The netcat package is now taken directly from OpenBSD's libressl, instead of relying on Debian's fork. The new version should be very close to the old version, but there are some minor differences. Importantly, flags like -b, -q, -C, and -Z are no longer accepted by the nc command. - The services.docker-registry.extraConfig object doesn't - contain environment variables anymore. Instead it needs to provide an - object structure that can be mapped onto the YAML configuration defined in - the - docker/distribution docs. + The services.docker-registry.extraConfig object doesn't contain environment variables anymore. Instead it needs to provide an object structure that can be mapped onto the YAML configuration defined in the docker/distribution docs. - gnucash has changed from version 2.4 to 3.x. If you've - been using gnucash (version 2.4) instead of - gnucash26 (version 2.6) you must open your Gnucash data - file(s) with gnucash26 and then save them to upgrade - the file format. Then you may use your data file(s) with Gnucash 3.x. See - the upgrade - documentation. - Gnucash 2.4 is still available under the attribute - gnucash24. + gnucash has changed from version 2.4 to 3.x. If you've been using gnucash (version 2.4) instead of gnucash26 (version 2.6) you must open your Gnucash data file(s) with gnucash26 and then save them to upgrade the file format. Then you may use your data file(s) with Gnucash 3.x. See the upgrade documentation. Gnucash 2.4 is still available under the attribute gnucash24. - services.munge now runs as user (and group) - munge instead of root. Make sure the key file is - accessible to the daemon. + services.munge now runs as user (and group) munge instead of root. Make sure the key file is accessible to the daemon. - dockerTools.buildImage now uses null - as default value for tag, which indicates that the nix - output hash will be used as tag. + dockerTools.buildImage now uses null as default value for tag, which indicates that the nix output hash will be used as tag. - The ELK stack: elasticsearch, - logstash and kibana has been - upgraded from 2.* to 6.3.*. The 2.* versions have been - unsupported since - last year so they have been removed. You can still use the 5.* - versions under the names elasticsearch5, - logstash5 and kibana5. + The ELK stack: elasticsearch, logstash and kibana has been upgraded from 2.* to 6.3.*. The 2.* versions have been unsupported since last year so they have been removed. You can still use the 5.* versions under the names elasticsearch5, logstash5 and kibana5. - The elastic beats: filebeat, - heartbeat, metricbeat and - packetbeat have had the same treatment: they now target - 6.3.* as well. The 5.* versions are available under the names: - filebeat5, heartbeat5, - metricbeat5 and packetbeat5 + The elastic beats: filebeat, heartbeat, metricbeat and packetbeat have had the same treatment: they now target 6.3.* as well. The 5.* versions are available under the names: filebeat5, heartbeat5, metricbeat5 and packetbeat5 - The ELK-6.3 stack now comes with - X-Pack by - default. Since X-Pack is licensed under the - Elastic - License the ELK packages now have an unfree license. To use them - you need to specify allowUnfree = true; in your nixpkgs - configuration. + The ELK-6.3 stack now comes with X-Pack by default. Since X-Pack is licensed under the Elastic License the ELK packages now have an unfree license. To use them you need to specify allowUnfree = true; in your nixpkgs configuration. - Fortunately there is also a free variant of the ELK stack without X-Pack. - The packages are available under the names: - elasticsearch-oss, logstash-oss and - kibana-oss. + Fortunately there is also a free variant of the ELK stack without X-Pack. The packages are available under the names: elasticsearch-oss, logstash-oss and kibana-oss. - Options - boot.initrd.luks.devices.name.yubikey.ramfsMountPoint - boot.initrd.luks.devices.name.yubikey.storage.mountPoint - were removed. luksroot.nix module never supported more - than one YubiKey at a time anyway, hence those options never had any - effect. You should be able to remove them from your config without any - issues. + Options boot.initrd.luks.devices.name.yubikey.ramfsMountPoint boot.initrd.luks.devices.name.yubikey.storage.mountPoint were removed. luksroot.nix module never supported more than one YubiKey at a time anyway, hence those options never had any effect. You should be able to remove them from your config without any issues. - stdenv.system and system in nixpkgs - now refer to the host platform instead of the build platform. For native - builds this is not change, let alone a breaking one. For cross builds, it - is a breaking change, and stdenv.buildPlatform.system - can be used instead for the old behavior. They should be using that - anyways for clarity. + stdenv.system and system in nixpkgs now refer to the host platform instead of the build platform. For native builds this is not change, let alone a breaking one. For cross builds, it is a breaking change, and stdenv.buildPlatform.system can be used instead for the old behavior. They should be using that anyways for clarity. - Groups kvm and render are introduced - now, as systemd requires them. + Groups kvm and render are introduced now, as systemd requires them. @@ -656,92 +559,69 @@ $ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull' - dockerTools.pullImage relies on image digest instead of - image tag to download the image. The sha256 of a pulled - image has to be updated. + dockerTools.pullImage relies on image digest instead of image tag to download the image. The sha256 of a pulled image has to be updated. - lib.attrNamesToStr has been deprecated. Use more - specific concatenation (lib.concat(Map)StringsSep) - instead. + lib.attrNamesToStr has been deprecated. Use more specific concatenation (lib.concat(Map)StringsSep) instead. - lib.addErrorContextToAttrs has been deprecated. Use - builtins.addErrorContext directly. + lib.addErrorContextToAttrs has been deprecated. Use builtins.addErrorContext directly. - lib.showVal has been deprecated. Use - lib.traceSeqN instead. + lib.showVal has been deprecated. Use lib.traceSeqN instead. - lib.traceXMLVal has been deprecated. Use - lib.traceValFn builtins.toXml instead. + lib.traceXMLVal has been deprecated. Use lib.traceValFn builtins.toXml instead. - lib.traceXMLValMarked has been deprecated. Use - lib.traceValFn (x: str + builtins.toXML x) instead. + lib.traceXMLValMarked has been deprecated. Use lib.traceValFn (x: str + builtins.toXML x) instead. - The pkgs argument to NixOS modules can now be set - directly using nixpkgs.pkgs. Previously, only the - system, config and - overlays arguments could be used to influence - pkgs. + The pkgs argument to NixOS modules can now be set directly using nixpkgs.pkgs. Previously, only the system, config and overlays arguments could be used to influence pkgs. - A NixOS system can now be constructed more easily based on a preexisting - invocation of Nixpkgs. For example: + A NixOS system can now be constructed more easily based on a preexisting invocation of Nixpkgs. For example: inherit (pkgs.nixos { boot.loader.grub.enable = false; fileSystems."/".device = "/dev/xvda1"; }) toplevel kernel initialRamdisk manual; - This benefits evaluation performance, lets you write Nixpkgs packages that - depend on NixOS images and is consistent with a deployment architecture - that would be centered around Nixpkgs overlays. + This benefits evaluation performance, lets you write Nixpkgs packages that depend on NixOS images and is consistent with a deployment architecture that would be centered around Nixpkgs overlays. - lib.traceValIfNot has been deprecated. Use - if/then/else and lib.traceValSeq - instead. + lib.traceValIfNot has been deprecated. Use if/then/else and lib.traceValSeq instead. - lib.traceCallXml has been deprecated. Please complain - if you use the function regularly. + lib.traceCallXml has been deprecated. Please complain if you use the function regularly. - The attribute lib.nixpkgsVersion has been deprecated in - favor of lib.version. Please refer to the discussion in - NixOS/nixpkgs#39416 - for further reference. + The attribute lib.nixpkgsVersion has been deprecated in favor of lib.version. Please refer to the discussion in NixOS/nixpkgs#39416 for further reference. - lib.recursiveUpdateUntil was not acting according to - its specification. It has been fixed to act according to the docstring, - and a test has been added. + lib.recursiveUpdateUntil was not acting according to its specification. It has been fixed to act according to the docstring, and a test has been added. @@ -755,9 +635,7 @@ inherit (pkgs.nixos { - Puts the generated Diffie-Hellman parameters into the Nix store instead - of managing them in a stateful manner in - /var/lib/dhparams. + Puts the generated Diffie-Hellman parameters into the Nix store instead of managing them in a stateful manner in /var/lib/dhparams. @@ -767,27 +645,20 @@ inherit (pkgs.nixos { - The default bit size to use for the generated Diffie-Hellman - parameters. + The default bit size to use for the generated Diffie-Hellman parameters. - The path to the actual generated parameter files should now be queried - using - config.security.dhparams.params.name.path - because it might be either in the Nix store or in a directory configured - by . + The path to the actual generated parameter files should now be queried using config.security.dhparams.params.name.path because it might be either in the Nix store or in a directory configured by . For developers: - Module implementers should not set a specific bit size in order to let - users configure it by themselves if they want to have a different bit - size than the default (2048). + Module implementers should not set a specific bit size in order to let users configure it by themselves if they want to have a different bit size than the default (2048). An example usage of this would be: @@ -806,126 +677,82 @@ inherit (pkgs.nixos { - networking.networkmanager.useDnsmasq has been - deprecated. Use networking.networkmanager.dns instead. + networking.networkmanager.useDnsmasq has been deprecated. Use networking.networkmanager.dns instead. - The Kubernetes package has been bumped to major version 1.11. Please - consult the - release - notes for details on new features and api changes. + The Kubernetes package has been bumped to major version 1.11. Please consult the release notes for details on new features and api changes. - The option - services.kubernetes.apiserver.admissionControl was - renamed to - services.kubernetes.apiserver.enableAdmissionPlugins. + The option services.kubernetes.apiserver.admissionControl was renamed to services.kubernetes.apiserver.enableAdmissionPlugins. - Recommended way to access the Kubernetes Dashboard is via HTTPS (TLS) - Therefore; public service port for the dashboard has changed to 443 - (container port 8443) and scheme to https. + Recommended way to access the Kubernetes Dashboard is via HTTPS (TLS) Therefore; public service port for the dashboard has changed to 443 (container port 8443) and scheme to https. - The option services.kubernetes.apiserver.address was - renamed to services.kubernetes.apiserver.bindAddress. - Note that the default value has changed from 127.0.0.1 to 0.0.0.0. + The option services.kubernetes.apiserver.address was renamed to services.kubernetes.apiserver.bindAddress. Note that the default value has changed from 127.0.0.1 to 0.0.0.0. - The option services.kubernetes.apiserver.publicAddress - was not used and thus has been removed. + The option services.kubernetes.apiserver.publicAddress was not used and thus has been removed. - The option - services.kubernetes.addons.dashboard.enableRBAC was - renamed to - services.kubernetes.addons.dashboard.rbac.enable. + The option services.kubernetes.addons.dashboard.enableRBAC was renamed to services.kubernetes.addons.dashboard.rbac.enable. - The Kubernetes Dashboard now has only minimal RBAC permissions by default. - If dashboard cluster-admin rights are desired, set - services.kubernetes.addons.dashboard.rbac.clusterAdmin - to true. On existing clusters, in order for the revocation of privileges - to take effect, the current ClusterRoleBinding for kubernetes-dashboard - must be manually removed: kubectl delete clusterrolebinding - kubernetes-dashboard + The Kubernetes Dashboard now has only minimal RBAC permissions by default. If dashboard cluster-admin rights are desired, set services.kubernetes.addons.dashboard.rbac.clusterAdmin to true. On existing clusters, in order for the revocation of privileges to take effect, the current ClusterRoleBinding for kubernetes-dashboard must be manually removed: kubectl delete clusterrolebinding kubernetes-dashboard - The programs.screen module provides allows to configure - /etc/screenrc, however the module behaved fairly - counterintuitive as the config exists, but the package wasn't available. - Since 18.09 pkgs.screen will be added to - environment.systemPackages. + The programs.screen module provides allows to configure /etc/screenrc, however the module behaved fairly counterintuitive as the config exists, but the package wasn't available. Since 18.09 pkgs.screen will be added to environment.systemPackages. - The module now uses WPA2 by - default. + The module now uses WPA2 by default. - s6Dns, s6Networking, - s6LinuxUtils and s6PortableUtils - renamed to s6-dns, s6-networking, - s6-linux-utils and s6-portable-utils - respectively. + s6Dns, s6Networking, s6LinuxUtils and s6PortableUtils renamed to s6-dns, s6-networking, s6-linux-utils and s6-portable-utils respectively. - The module option is now defaulted to - true. + The module option is now defaulted to true. - The config activation script of nixos-rebuild now - reloads - all user units for each authenticated user. + The config activation script of nixos-rebuild now reloads all user units for each authenticated user. - The default display manager is now LightDM. To use SLiM set - services.xserver.displayManager.slim.enable to - true. + The default display manager is now LightDM. To use SLiM set services.xserver.displayManager.slim.enable to true. - NixOS option descriptions are now automatically broken up into individual - paragraphs if the text contains two consecutive newlines, so it's no - longer necessary to use </para><para> to start a - new paragraph. + NixOS option descriptions are now automatically broken up into individual paragraphs if the text contains two consecutive newlines, so it's no longer necessary to use </para><para> to start a new paragraph. - Top-level buildPlatform, - hostPlatform, and targetPlatform in - Nixpkgs are deprecated. Please use their equivalents in - stdenv instead: - stdenv.buildPlatform, - stdenv.hostPlatform, and - stdenv.targetPlatform. + Top-level buildPlatform, hostPlatform, and targetPlatform in Nixpkgs are deprecated. Please use their equivalents in stdenv instead: stdenv.buildPlatform, stdenv.hostPlatform, and stdenv.targetPlatform. diff --git a/nixos/doc/manual/release-notes/rl-1903.xml b/nixos/doc/manual/release-notes/rl-1903.xml index 8ff1681d3b4a..e270519932b8 100644 --- a/nixos/doc/manual/release-notes/rl-1903.xml +++ b/nixos/doc/manual/release-notes/rl-1903.xml @@ -13,8 +13,7 @@ Highlights - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: @@ -25,53 +24,36 @@ - The default Python 3 interpreter is now CPython 3.7 instead of CPython - 3.6. + The default Python 3 interpreter is now CPython 3.7 instead of CPython 3.6. - Added the Pantheon desktop environment. It can be enabled through - services.xserver.desktopManager.pantheon.enable. + Added the Pantheon desktop environment. It can be enabled through services.xserver.desktopManager.pantheon.enable. - By default, services.xserver.desktopManager.pantheon - enables LightDM as a display manager, as pantheon's screen locking - implementation relies on it. + By default, services.xserver.desktopManager.pantheon enables LightDM as a display manager, as pantheon's screen locking implementation relies on it. - Because of that it is recommended to leave LightDM enabled. If you'd like - to disable it anyway, set - to - false and enable your preferred display manager. + Because of that it is recommended to leave LightDM enabled. If you'd like to disable it anyway, set to false and enable your preferred display manager. - Also note that Pantheon's LightDM greeter is not enabled by default, - because it has numerous issues in NixOS and isn't optimal for use here - yet. + Also note that Pantheon's LightDM greeter is not enabled by default, because it has numerous issues in NixOS and isn't optimal for use here yet. - A major refactoring of the Kubernetes module has been completed. - Refactorings primarily focus on decoupling components and enhancing - security. Two-way TLS and RBAC has been enabled by default for all - components, which slightly changes the way the module is configured. See: - for details. + A major refactoring of the Kubernetes module has been completed. Refactorings primarily focus on decoupling components and enhancing security. Two-way TLS and RBAC has been enabled by default for all components, which slightly changes the way the module is configured. See: for details. - - There is now a set of options for - , which allows to restrict services - into a - chroot - 2 - ed environment that only contains the store paths from - the runtime closure of the service. - + + There is now a set of options for , which allows to restrict services into a + chroot + 2 ed environment that only contains the store paths from the runtime closure of the service. + @@ -95,12 +77,7 @@ - There is a new security.googleOsLogin module for using - OS - Login to manage SSH access to Google Compute Engine instances, - which supersedes the imperative and broken - google-accounts-daemon used in - nixos/modules/virtualisation/google-compute-config.nix. + There is a new security.googleOsLogin module for using OS Login to manage SSH access to Google Compute Engine instances, which supersedes the imperative and broken google-accounts-daemon used in nixos/modules/virtualisation/google-compute-config.nix. @@ -110,10 +87,7 @@ - There is a new services.cockroachdb module for running - CockroachDB databases. NixOS now ships with CockroachDB 2.1.x as well, - available on x86_64-linux and - aarch64-linux. + There is a new services.cockroachdb module for running CockroachDB databases. NixOS now ships with CockroachDB 2.1.x as well, available on x86_64-linux and aarch64-linux. @@ -126,11 +100,7 @@ - The PAM module for Duo - Security has been enabled for use. One can configure it using the - options along with the corresponding PAM - option in - . + The PAM module for Duo Security has been enabled for use. One can configure it using the options along with the corresponding PAM option in . @@ -144,8 +114,7 @@ Backward Incompatibilities - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: @@ -156,233 +125,131 @@ - For users of NixOS 18.03 and 19.03, NixOS defaults to Nix 2.0, but - supports using Nix 1.11 by setting nix.package = - pkgs.nix1;. If this option is set to a Nix 1.11 package, you - will need to either unset the option or upgrade it to Nix 2.0. + For users of NixOS 18.03 and 19.03, NixOS defaults to Nix 2.0, but supports using Nix 1.11 by setting nix.package = pkgs.nix1;. If this option is set to a Nix 1.11 package, you will need to either unset the option or upgrade it to Nix 2.0. - For users of NixOS 17.09, you will first need to upgrade Nix by setting - nix.package = pkgs.nixStable2; and run - nixos-rebuild switch as the root - user. + For users of NixOS 17.09, you will first need to upgrade Nix by setting nix.package = pkgs.nixStable2; and run nixos-rebuild switch as the root user. - For users of a daemon-less Nix installation on Linux or macOS, you can - upgrade Nix by running curl https://nixos.org/nix/install | - sh, or prior to doing a channel update, running - nix-env -iA nix. + For users of a daemon-less Nix installation on Linux or macOS, you can upgrade Nix by running curl https://nixos.org/nix/install | sh, or prior to doing a channel update, running nix-env -iA nix. - If you have already run a channel update and Nix is no longer able to - evaluate Nixpkgs, the error message printed should provide adequate - directions for upgrading Nix. + If you have already run a channel update and Nix is no longer able to evaluate Nixpkgs, the error message printed should provide adequate directions for upgrading Nix. - For users of the Nix daemon on macOS, you can upgrade Nix by running - sudo -i sh -c 'nix-channel --update && nix-env -iA - nixpkgs.nix'; sudo launchctl stop org.nixos.nix-daemon; sudo launchctl - start org.nixos.nix-daemon. + For users of the Nix daemon on macOS, you can upgrade Nix by running sudo -i sh -c 'nix-channel --update && nix-env -iA nixpkgs.nix'; sudo launchctl stop org.nixos.nix-daemon; sudo launchctl start org.nixos.nix-daemon. - The buildPythonPackage function now sets - strictDeps = true to help distinguish between native - and non-native dependencies in order to improve cross-compilation - compatibility. Note however that this may break user expressions. + The buildPythonPackage function now sets strictDeps = true to help distinguish between native and non-native dependencies in order to improve cross-compilation compatibility. Note however that this may break user expressions. - The buildPythonPackage function now sets LANG - = C.UTF-8 to enable Unicode support. The - glibcLocales package is no longer needed as a build - input. + The buildPythonPackage function now sets LANG = C.UTF-8 to enable Unicode support. The glibcLocales package is no longer needed as a build input. - The Syncthing state and configuration data has been moved from - services.syncthing.dataDir to the newly defined - services.syncthing.configDir, which default to - /var/lib/syncthing/.config/syncthing. This change makes - possible to share synced directories using ACLs without Syncthing - resetting the permission on every start. + The Syncthing state and configuration data has been moved from services.syncthing.dataDir to the newly defined services.syncthing.configDir, which default to /var/lib/syncthing/.config/syncthing. This change makes possible to share synced directories using ACLs without Syncthing resetting the permission on every start. - The ntp module now has sane default restrictions. If - you're relying on the previous defaults, which permitted all queries and - commands from all firewall-permitted sources, you can set - services.ntp.restrictDefault and - services.ntp.restrictSource to []. + The ntp module now has sane default restrictions. If you're relying on the previous defaults, which permitted all queries and commands from all firewall-permitted sources, you can set services.ntp.restrictDefault and services.ntp.restrictSource to []. - Package rabbitmq_server is renamed to - rabbitmq-server. + Package rabbitmq_server is renamed to rabbitmq-server. - The light module no longer uses setuid binaries, but - udev rules. As a consequence users of that module have to belong to the - video group in order to use the executable (i.e. - users.users.yourusername.extraGroups = ["video"];). + The light module no longer uses setuid binaries, but udev rules. As a consequence users of that module have to belong to the video group in order to use the executable (i.e. users.users.yourusername.extraGroups = ["video"];). - Buildbot now supports Python 3 and its packages have been moved to - pythonPackages. The options - and - can be used to select - the Python 2 or 3 version of the package. + Buildbot now supports Python 3 and its packages have been moved to pythonPackages. The options and can be used to select the Python 2 or 3 version of the package. - Options - services.znc.confOptions.networks.name.userName - and - services.znc.confOptions.networks.name.modulePackages - were removed. They were never used for anything and can therefore safely - be removed. + Options services.znc.confOptions.networks.name.userName and services.znc.confOptions.networks.name.modulePackages were removed. They were never used for anything and can therefore safely be removed. - Package wasm has been renamed - proglodyte-wasm. The package wasm - will be pointed to ocamlPackages.wasm in 19.09, so make - sure to update your configuration if you want to keep - proglodyte-wasm + Package wasm has been renamed proglodyte-wasm. The package wasm will be pointed to ocamlPackages.wasm in 19.09, so make sure to update your configuration if you want to keep proglodyte-wasm - When the nixpkgs.pkgs option is set, NixOS will no - longer ignore the nixpkgs.overlays option. The old - behavior can be recovered by setting nixpkgs.overlays = - lib.mkForce [];. + When the nixpkgs.pkgs option is set, NixOS will no longer ignore the nixpkgs.overlays option. The old behavior can be recovered by setting nixpkgs.overlays = lib.mkForce [];. - OpenSMTPD has been upgraded to version 6.4.0p1. This release makes - backwards-incompatible changes to the configuration file format. See - man smtpd.conf for more information on the new file - format. + OpenSMTPD has been upgraded to version 6.4.0p1. This release makes backwards-incompatible changes to the configuration file format. See man smtpd.conf for more information on the new file format. - The versioned postgresql have been renamed to use - underscore number seperators. For example, postgresql96 - has been renamed to postgresql_9_6. + The versioned postgresql have been renamed to use underscore number seperators. For example, postgresql96 has been renamed to postgresql_9_6. - Package consul-ui and passthrough - consul.ui have been removed. The package - consul now uses upstream releases that vendor the UI - into the binary. See - #48714 - for details. + Package consul-ui and passthrough consul.ui have been removed. The package consul now uses upstream releases that vendor the UI into the binary. See #48714 for details. - Slurm introduces the new option - services.slurm.stateSaveLocation, which is now set to - /var/spool/slurm by default (instead of - /var/spool). Make sure to move all files to the new - directory or to set the option accordingly. + Slurm introduces the new option services.slurm.stateSaveLocation, which is now set to /var/spool/slurm by default (instead of /var/spool). Make sure to move all files to the new directory or to set the option accordingly. - The slurmctld now runs as user slurm instead of - root. If you want to keep slurmctld running as - root, set services.slurm.user = - root. + The slurmctld now runs as user slurm instead of root. If you want to keep slurmctld running as root, set services.slurm.user = root. - The options services.slurm.nodeName and - services.slurm.partitionName are now sets of strings to - correctly reflect that fact that each of these options can occour more - than once in the configuration. + The options services.slurm.nodeName and services.slurm.partitionName are now sets of strings to correctly reflect that fact that each of these options can occour more than once in the configuration. - The solr package has been upgraded from 4.10.3 to 7.5.0 - and has undergone some major changes. The services.solr - module has been updated to reflect these changes. Please review - http://lucene.apache.org/solr/ carefully before upgrading. + The solr package has been upgraded from 4.10.3 to 7.5.0 and has undergone some major changes. The services.solr module has been updated to reflect these changes. Please review http://lucene.apache.org/solr/ carefully before upgrading. - Package ckb is renamed to ckb-next, - and options hardware.ckb.* are renamed to - hardware.ckb-next.*. + Package ckb is renamed to ckb-next, and options hardware.ckb.* are renamed to hardware.ckb-next.*. - The option - services.xserver.displayManager.job.logToFile which was - previously set to true when using the display managers - lightdm, sddm or - xpra has been reset to the default value - (false). + The option services.xserver.displayManager.job.logToFile which was previously set to true when using the display managers lightdm, sddm or xpra has been reset to the default value (false). - Network interface indiscriminate NixOS firewall options - (networking.firewall.allow*) are now preserved when - also setting interface specific rules such as - networking.firewall.interfaces.en0.allow*. These rules - continue to use the pseudo device "default" - (networking.firewall.interfaces.default.*), and - assigning to this pseudo device will override the - (networking.firewall.allow*) options. + Network interface indiscriminate NixOS firewall options (networking.firewall.allow*) are now preserved when also setting interface specific rules such as networking.firewall.interfaces.en0.allow*. These rules continue to use the pseudo device "default" (networking.firewall.interfaces.default.*), and assigning to this pseudo device will override the (networking.firewall.allow*) options. - The nscd service now disables all caching of - passwd and group databases by - default. This was interferring with the correct functioning of the - libnss_systemd.so module which is used by - systemd to manage uids and usernames in the presence of - DynamicUser= in systemd services. This was already the - default behaviour in presence of services.sssd.enable = - true because nscd caching would interfere with - sssd in unpredictable ways as well. Because we're using - nscd not for caching, but for convincing glibc to find NSS modules in the - nix store instead of an absolute path, we have decided to disable caching - globally now, as it's usually not the behaviour the user wants and can - lead to surprising behaviour. Furthermore, negative caching of host - lookups is also disabled now by default. This should fix the issue of dns - lookups failing in the presence of an unreliable network. + The nscd service now disables all caching of passwd and group databases by default. This was interferring with the correct functioning of the libnss_systemd.so module which is used by systemd to manage uids and usernames in the presence of DynamicUser= in systemd services. This was already the default behaviour in presence of services.sssd.enable = true because nscd caching would interfere with sssd in unpredictable ways as well. Because we're using nscd not for caching, but for convincing glibc to find NSS modules in the nix store instead of an absolute path, we have decided to disable caching globally now, as it's usually not the behaviour the user wants and can lead to surprising behaviour. Furthermore, negative caching of host lookups is also disabled now by default. This should fix the issue of dns lookups failing in the presence of an unreliable network. - If the old behaviour is desired, this can be restored by setting the - services.nscd.config option with the desired caching - parameters. + If the old behaviour is desired, this can be restored by setting the services.nscd.config option with the desired caching parameters. services.nscd.config = '' @@ -416,124 +283,65 @@ shared hosts yes ''; - See - #50316 - for details. + See #50316 for details. - GitLab Shell previously used the nix store paths for the - gitlab-shell command in its - authorized_keys file, which might stop working after - garbage collection. To circumvent that, we regenerated that file on each - startup. As gitlab-shell has now been changed to use - /var/run/current-system/sw/bin/gitlab-shell, this is - not necessary anymore, but there might be leftover lines with a nix store - path. Regenerate the authorized_keys file via - sudo -u git -H gitlab-rake gitlab:shell:setup in that - case. + GitLab Shell previously used the nix store paths for the gitlab-shell command in its authorized_keys file, which might stop working after garbage collection. To circumvent that, we regenerated that file on each startup. As gitlab-shell has now been changed to use /var/run/current-system/sw/bin/gitlab-shell, this is not necessary anymore, but there might be leftover lines with a nix store path. Regenerate the authorized_keys file via sudo -u git -H gitlab-rake gitlab:shell:setup in that case. - The pam_unix account module is now loaded with its - control field set to required instead of - sufficient, so that later PAM account modules that - might do more extensive checks are being executed. Previously, the whole - account module verification was exited prematurely in case a nss module - provided the account name to pam_unix. The LDAP and - SSSD NixOS modules already add their NSS modules when enabled. In case - your setup breaks due to some later PAM account module previosuly - shadowed, or failing NSS lookups, please file a bug. You can get back the - old behaviour by manually setting + The pam_unix account module is now loaded with its control field set to required instead of sufficient, so that later PAM account modules that might do more extensive checks are being executed. Previously, the whole account module verification was exited prematurely in case a nss module provided the account name to pam_unix. The LDAP and SSSD NixOS modules already add their NSS modules when enabled. In case your setup breaks due to some later PAM account module previosuly shadowed, or failing NSS lookups, please file a bug. You can get back the old behaviour by manually setting .text]]> . - The pam_unix password module is now loaded with its - control field set to sufficient instead of - required, so that password managed only by later PAM - password modules are being executed. Previously, for example, changing an - LDAP account's password through PAM was not possible: the whole password - module verification was exited prematurely by pam_unix, - preventing pam_ldap to manage the password as it - should. + The pam_unix password module is now loaded with its control field set to sufficient instead of required, so that password managed only by later PAM password modules are being executed. Previously, for example, changing an LDAP account's password through PAM was not possible: the whole password module verification was exited prematurely by pam_unix, preventing pam_ldap to manage the password as it should. - fish has been upgraded to 3.0. It comes with a number - of improvements and backwards incompatible changes. See the - fish - release - notes for more information. + fish has been upgraded to 3.0. It comes with a number of improvements and backwards incompatible changes. See the fish release notes for more information. - The ibus-table input method has had a change in config format, which - causes all previous settings to be lost. See - this - commit message for details. + The ibus-table input method has had a change in config format, which causes all previous settings to be lost. See this commit message for details. - NixOS module system type types.optionSet and - lib.mkOption argument options are - deprecated. Use types.submodule instead. - (#54637) + NixOS module system type types.optionSet and lib.mkOption argument options are deprecated. Use types.submodule instead. (#54637) - matrix-synapse has been updated to version 0.99. It - will no - longer generate a self-signed certificate on first launch and will - be - the - last version to accept self-signed certificates. As such, it is now - recommended to use a proper certificate verified by a root CA (for example - Let's Encrypt). The new manual - chapter on Matrix contains a working example of using nginx as a - reverse proxy in front of matrix-synapse, using Let's - Encrypt certificates. + matrix-synapse has been updated to version 0.99. It will no longer generate a self-signed certificate on first launch and will be the last version to accept self-signed certificates. As such, it is now recommended to use a proper certificate verified by a root CA (for example Let's Encrypt). The new manual chapter on Matrix contains a working example of using nginx as a reverse proxy in front of matrix-synapse, using Let's Encrypt certificates. - mailutils now works by default when - sendmail is not in a setuid wrapper. As a consequence, - the sendmailPath argument, having lost its main use, - has been removed. + mailutils now works by default when sendmail is not in a setuid wrapper. As a consequence, the sendmailPath argument, having lost its main use, has been removed. - graylog has been upgraded from version 2.* to 3.*. Some - setups making use of extraConfig (especially those exposing Graylog via - reverse proxies) need to be updated as upstream removed/replaced some - settings. See - Upgrading - Graylog for details. + graylog has been upgraded from version 2.* to 3.*. Some setups making use of extraConfig (especially those exposing Graylog via reverse proxies) need to be updated as upstream removed/replaced some settings. See Upgrading Graylog for details. - The option users.ldap.bind.password was renamed to users.ldap.bind.passwordFile, - and needs to be readable by the nslcd user. - Same applies to the new users.ldap.daemon.rootpwmodpwFile option. + The option users.ldap.bind.password was renamed to users.ldap.bind.passwordFile, and needs to be readable by the nslcd user. Same applies to the new users.ldap.daemon.rootpwmodpwFile option. - - nodejs-6_x is end-of-life. - nodejs-6_x, nodejs-slim-6_x and - nodePackages_6_x are removed. - + + nodejs-6_x is end-of-life. nodejs-6_x, nodejs-slim-6_x and nodePackages_6_x are removed. + @@ -548,214 +356,122 @@ - The module gained the option - which determines the used Matomo - version. + The module gained the option which determines the used Matomo version. - The Matomo module now also comes with the systemd service - matomo-archive-processing.service and a timer that - automatically triggers archive processing every hour. This means that you - can safely - - disable browser triggers for Matomo archiving at - Administration > System > General Settings. + The Matomo module now also comes with the systemd service matomo-archive-processing.service and a timer that automatically triggers archive processing every hour. This means that you can safely disable browser triggers for Matomo archiving at Administration > System > General Settings. - Additionally, you can enable to - - delete old visitor logs at Administration > System > - Privacy, but make sure that you run systemctl start - matomo-archive-processing.service at least once without errors - if you have already collected data before, so that the reports get - archived before the source data gets deleted. + Additionally, you can enable to delete old visitor logs at Administration > System > Privacy, but make sure that you run systemctl start matomo-archive-processing.service at least once without errors if you have already collected data before, so that the reports get archived before the source data gets deleted. - composableDerivation along with supporting library - functions has been removed. + composableDerivation along with supporting library functions has been removed. - The deprecated truecrypt package has been removed and - truecrypt attribute is now an alias for - veracrypt. VeraCrypt is backward-compatible with - TrueCrypt volumes. Note that cryptsetup also supports - loading TrueCrypt volumes. + The deprecated truecrypt package has been removed and truecrypt attribute is now an alias for veracrypt. VeraCrypt is backward-compatible with TrueCrypt volumes. Note that cryptsetup also supports loading TrueCrypt volumes. - The Kubernetes DNS addons, kube-dns, has been replaced with CoreDNS. This - change is made in accordance with Kubernetes making CoreDNS the official - default starting from - Kubernetes - v1.11. Please beware that upgrading DNS-addon on existing clusters - might induce minor downtime while the DNS-addon terminates and - re-initializes. Also note that the DNS-service now runs with 2 pod - replicas by default. The desired number of replicas can be configured - using: . + The Kubernetes DNS addons, kube-dns, has been replaced with CoreDNS. This change is made in accordance with Kubernetes making CoreDNS the official default starting from Kubernetes v1.11. Please beware that upgrading DNS-addon on existing clusters might induce minor downtime while the DNS-addon terminates and re-initializes. Also note that the DNS-service now runs with 2 pod replicas by default. The desired number of replicas can be configured using: . - The quassel-webserver package and module was removed from nixpkgs due to - the lack of maintainers. + The quassel-webserver package and module was removed from nixpkgs due to the lack of maintainers. - The manual gained a new chapter on - self-hosting matrix-synapse and - riot-web , the most prevalent server and client - implementations for the - Matrix federated - communication network. + The manual gained a new chapter on self-hosting matrix-synapse and riot-web , the most prevalent server and client implementations for the Matrix federated communication network. - The astah-community package was removed from nixpkgs due to it being - discontinued and the downloads not being available anymore. + The astah-community package was removed from nixpkgs due to it being discontinued and the downloads not being available anymore. - The httpd service now saves log files with a .log file extension by - default for easier integration with the logrotate service. + The httpd service now saves log files with a .log file extension by default for easier integration with the logrotate service. - The owncloud server packages and httpd subservice module were removed from - nixpkgs due to the lack of maintainers. + The owncloud server packages and httpd subservice module were removed from nixpkgs due to the lack of maintainers. - It is possible now to uze ZRAM devices as general purpose ephemeral block - devices, not only as swap. Using more than 1 device as ZRAM swap is no - longer recommended, but is still possible by setting - zramSwap.swapDevices explicitly. + It is possible now to uze ZRAM devices as general purpose ephemeral block devices, not only as swap. Using more than 1 device as ZRAM swap is no longer recommended, but is still possible by setting zramSwap.swapDevices explicitly. ZRAM algorithm can be changed now. - Changes to ZRAM algorithm are applied during nixos-rebuild - switch, so make sure you have enough swap space on disk to - survive ZRAM device rebuild. Alternatively, use nixos-rebuild - boot; reboot. + Changes to ZRAM algorithm are applied during nixos-rebuild switch, so make sure you have enough swap space on disk to survive ZRAM device rebuild. Alternatively, use nixos-rebuild boot; reboot. - Flat volumes are now disabled by default in - hardware.pulseaudio. This has been done to prevent - applications, which are unaware of this feature, setting their volumes to - 100% on startup causing harm to your audio hardware and potentially your - ears. + Flat volumes are now disabled by default in hardware.pulseaudio. This has been done to prevent applications, which are unaware of this feature, setting their volumes to 100% on startup causing harm to your audio hardware and potentially your ears. - With this change application specific volumes are relative to the master - volume which can be adjusted independently, whereas before they were - absolute; meaning that in effect, it scaled the device-volume with the - volume of the loudest application. + With this change application specific volumes are relative to the master volume which can be adjusted independently, whereas before they were absolute; meaning that in effect, it scaled the device-volume with the volume of the loudest application. - The - ndppd - module now supports all config - options provided by the current upstream version as service - options. Additionally the ndppd package doesn't contain - the systemd unit configuration from upstream anymore, the unit is - completely configured by the NixOS module now. + The ndppd module now supports all config options provided by the current upstream version as service options. Additionally the ndppd package doesn't contain the systemd unit configuration from upstream anymore, the unit is completely configured by the NixOS module now. - New installs of NixOS will default to the Redmine 4.x series unless - otherwise specified in services.redmine.package while - existing installs of NixOS will default to the Redmine 3.x series. + New installs of NixOS will default to the Redmine 4.x series unless otherwise specified in services.redmine.package while existing installs of NixOS will default to the Redmine 3.x series. - The Grafana module now - supports declarative - datasource - and dashboard provisioning. + The Grafana module now supports declarative datasource and dashboard provisioning. - The use of insecure ports on kubernetes has been deprecated. Thus options: - services.kubernetes.apiserver.port and - services.kubernetes.controllerManager.port has been - renamed to .insecurePort, and default of both options - has changed to 0 (disabled). + The use of insecure ports on kubernetes has been deprecated. Thus options: services.kubernetes.apiserver.port and services.kubernetes.controllerManager.port has been renamed to .insecurePort, and default of both options has changed to 0 (disabled). - Note that the default value of - services.kubernetes.apiserver.bindAddress has changed - from 127.0.0.1 to 0.0.0.0, allowing the apiserver to be accessible from - outside the master node itself. If the apiserver insecurePort is enabled, - it is strongly recommended to only bind on the loopback interface. See: - services.kubernetes.apiserver.insecurebindAddress. + Note that the default value of services.kubernetes.apiserver.bindAddress has changed from 127.0.0.1 to 0.0.0.0, allowing the apiserver to be accessible from outside the master node itself. If the apiserver insecurePort is enabled, it is strongly recommended to only bind on the loopback interface. See: services.kubernetes.apiserver.insecurebindAddress. - The option - services.kubernetes.apiserver.allowPrivileged and - services.kubernetes.kubelet.allowPrivileged now - defaults to false. Disallowing privileged containers on the cluster. + The option services.kubernetes.apiserver.allowPrivileged and services.kubernetes.kubelet.allowPrivileged now defaults to false. Disallowing privileged containers on the cluster. - The kubernetes module does no longer add the kubernetes package to - environment.systemPackages implicitly. + The kubernetes module does no longer add the kubernetes package to environment.systemPackages implicitly. - The intel driver has been removed from the default list - of X.org video - drivers. The modesetting driver should take over - automatically, it is better maintained upstream and has less problems with - advanced X11 features. This can lead to a change in the output names used - by xrandr. Some performance regressions on some GPU - models might happen. Some OpenCL and VA-API applications might also break - (Beignet seems to provide OpenCL support with - modesetting driver, too). Kernel mode setting API does - not support backlight control, so xbacklight tool will - not work; backlight level can be controlled directly via - /sys/ or with brightnessctl. Users - who need this functionality more than multi-output XRandR are advised to - add `intel` to `videoDrivers` and report an issue (or provide additional - details in an existing one) + The intel driver has been removed from the default list of X.org video drivers. The modesetting driver should take over automatically, it is better maintained upstream and has less problems with advanced X11 features. This can lead to a change in the output names used by xrandr. Some performance regressions on some GPU models might happen. Some OpenCL and VA-API applications might also break (Beignet seems to provide OpenCL support with modesetting driver, too). Kernel mode setting API does not support backlight control, so xbacklight tool will not work; backlight level can be controlled directly via /sys/ or with brightnessctl. Users who need this functionality more than multi-output XRandR are advised to add `intel` to `videoDrivers` and report an issue (or provide additional details in an existing one) - Openmpi has been updated to version 4.0.0, which removes some deprecated - MPI-1 symbols. This may break some older applications that still rely on - those symbols. An upgrade guide can be found - here. + Openmpi has been updated to version 4.0.0, which removes some deprecated MPI-1 symbols. This may break some older applications that still rely on those symbols. An upgrade guide can be found here. - The nginx package now relies on OpenSSL 1.1 and supports TLS 1.3 by - default. You can set the protocols used by the nginx service using - . + The nginx package now relies on OpenSSL 1.1 and supports TLS 1.3 by default. You can set the protocols used by the nginx service using . diff --git a/nixos/doc/manual/release-notes/rl-1909.xml b/nixos/doc/manual/release-notes/rl-1909.xml index 58ab7207f533..92eae4539248 100644 --- a/nixos/doc/manual/release-notes/rl-1909.xml +++ b/nixos/doc/manual/release-notes/rl-1909.xml @@ -13,8 +13,7 @@ Highlights - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: @@ -34,85 +33,155 @@ - - The binfmt module is now easier to use. Additional systems can - be added through . - For instance, boot.binfmt.emulatedSystems = [ - "wasm32-wasi" "x86_64-windows" "aarch64-linux" ]; will - set up binfmt interpreters for each of those listed systems. - + + The binfmt module is now easier to use. Additional systems can be added through . For instance, boot.binfmt.emulatedSystems = [ "wasm32-wasi" "x86_64-windows" "aarch64-linux" ]; will set up binfmt interpreters for each of those listed systems. + - - The installer now uses a less privileged nixos user whereas before we logged in as root. - To gain root privileges use sudo -i without a password. + + The installer now uses a less privileged nixos user whereas before we logged in as root. To gain root privileges use sudo -i without a password. - We've updated to Xfce 4.14, which brings a new module . - If you'd like to upgrade, please switch from the module as it - will be deprecated in a future release. They're incompatibilities with the current Xfce module; it doesn't support - and it isn't recommended to use - and simultaneously or to downgrade from Xfce 4.14 after upgrading. + We've updated to Xfce 4.14, which brings a new module . If you'd like to upgrade, please switch from the module as it will be deprecated in a future release. They're incompatibilities with the current Xfce module; it doesn't support and it isn't recommended to use and simultaneously or to downgrade from Xfce 4.14 after upgrading. - The GNOME 3 desktop manager module sports an interface to enable/disable core services, applications, and optional GNOME packages - like games. - - This can be achieved with the following options which the desktop manager default enables, excluding games. - - - - - - With these options we hope to give users finer grained control over their systems. Prior to this change you'd either have to manually - disable options or use which only excluded the optional applications. - is now unguarded, it can exclude any package installed with - in the GNOME 3 module. + The GNOME 3 desktop manager module sports an interface to enable/disable core services, applications, and optional GNOME packages like games. + + + This can be achieved with the following options which the desktop manager default enables, excluding games. + + + + + + + + + + + + + + + + + + + + + + + With these options we hope to give users finer grained control over their systems. Prior to this change you'd either have to manually disable options or use which only excluded the optional applications. is now unguarded, it can exclude any package installed with in the GNOME 3 module. - Orthogonal to the previous changes to the GNOME 3 desktop manager module, we've updated all default services and applications - to match as close as possible to a default reference GNOME 3 experience. + Orthogonal to the previous changes to the GNOME 3 desktop manager module, we've updated all default services and applications to match as close as possible to a default reference GNOME 3 experience. - - The following changes were enacted in - + The following changes were enacted in + Applications removed from defaults: - accerciser - dconf-editor - evolution - gnome-documents - gnome-nettool - gnome-power-manager - gnome-todo - gnome-tweaks - gnome-usage - gucharmap - nautilus-sendto - vinagre + + + accerciser + + + + + dconf-editor + + + + + evolution + + + + + gnome-documents + + + + + gnome-nettool + + + + + gnome-power-manager + + + + + gnome-todo + + + + + gnome-tweaks + + + + + gnome-usage + + + + + gucharmap + + + + + nautilus-sendto + + + + + vinagre + + Applications added to defaults: - cheese - geary + + + cheese + + + + + geary + + - - The following changes were enacted in - + The following changes were enacted in + Applications added to defaults: - gnome-color-manager - orca + + + gnome-color-manager + + + + + orca + + Services enabled: - + + + + + @@ -137,41 +206,43 @@ - The new hardware.printers module allows to declaratively configure CUPS printers - via the ensurePrinters and - ensureDefaultPrinter options. - ensurePrinters will never delete existing printers, - but will make sure that the given printers are configured as declared. + The new hardware.printers module allows to declaratively configure CUPS printers via the ensurePrinters and ensureDefaultPrinter options. ensurePrinters will never delete existing printers, but will make sure that the given printers are configured as declared. - There is a new and module - for the program of the same name. If you previously had system-config-printer enabled through some other - means you should migrate to using one of these modules. + There is a new and module for the program of the same name. If you previously had system-config-printer enabled through some other means you should migrate to using one of these modules. - If you're a user of the following desktopManager modules no action is needed: + + If you're a user of the following desktopManager modules no action is needed: + - + + + - + + + - + + + - - Note Mate uses programs.system-config-printer as it doesn't - use it as a service, but its graphical interface directly. + + + + Note Mate uses programs.system-config-printer as it doesn't use it as a service, but its graphical interface directly. -
Backward Incompatibilities - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: - Buildbot no longer supports Python 2, as support was dropped upstream in - version 2.0.0. Configurations may need to be modified to make them - compatible with Python 3. + Buildbot no longer supports Python 2, as support was dropped upstream in version 2.0.0. Configurations may need to be modified to make them compatible with Python 3. - PostgreSQL now uses - /run/postgresql as its socket - directory instead of /tmp. So - if you run an application like eg. Nextcloud, where you need to use - the Unix socket path as the database host name, you need to change it - accordingly. + PostgreSQL now uses /run/postgresql as its socket directory instead of /tmp. So if you run an application like eg. Nextcloud, where you need to use the Unix socket path as the database host name, you need to change it accordingly. @@ -211,278 +274,212 @@ - The options and - have been removed - because the alertmanager service is now using systemd's - DynamicUser mechanism which obviates these options. + The options and have been removed because the alertmanager service is now using systemd's DynamicUser mechanism which obviates these options. - The NetworkManager systemd unit was renamed back from network-manager.service to - NetworkManager.service for better compatibility with other applications expecting this name. - The same applies to ModemManager where modem-manager.service is now called ModemManager.service again. + The NetworkManager systemd unit was renamed back from network-manager.service to NetworkManager.service for better compatibility with other applications expecting this name. The same applies to ModemManager where modem-manager.service is now called ModemManager.service again. - The and - options were removed as they are managed internally by the nzbget. The - option hadn't actually been used by - the module for some time and so was removed as cleanup. + The and options were removed as they are managed internally by the nzbget. The option hadn't actually been used by the module for some time and so was removed as cleanup. - The option was removed, as it was only used by the wordpress - apache-httpd service to wait for mysql to have started up. - This can be accomplished by either describing a dependency on mysql.service (preferred) - or waiting for the (hardcoded) /run/mysqld/mysql.sock file to appear. + The option was removed, as it was only used by the wordpress apache-httpd service to wait for mysql to have started up. This can be accomplished by either describing a dependency on mysql.service (preferred) or waiting for the (hardcoded) /run/mysqld/mysql.sock file to appear. - The module has been removed, see - instead for a free software fork of Emby. - - See the Jellyfin documentation: - - Migrating from Emby to Jellyfin - + The module has been removed, see instead for a free software fork of Emby. See the Jellyfin documentation: Migrating from Emby to Jellyfin - - IPv6 Privacy Extensions are now enabled by default for undeclared - interfaces. The previous behaviour was quite misleading — even though - the default value for - was - true, undeclared interfaces would not prefer temporary - addresses. Now, interfaces not mentioned in the config will prefer - temporary addresses. EUI64 addresses can still be set as preferred by - explicitly setting the option to false for the - interface in question. + + IPv6 Privacy Extensions are now enabled by default for undeclared interfaces. The previous behaviour was quite misleading — even though the default value for was true, undeclared interfaces would not prefer temporary addresses. Now, interfaces not mentioned in the config will prefer temporary addresses. EUI64 addresses can still be set as preferred by explicitly setting the option to false for the interface in question. - Since Bittorrent Sync was superseded by Resilio Sync in 2016, the - bittorrentSync, bittorrentSync14, - and bittorrentSync16 packages have been removed in - favor of resilio-sync. + Since Bittorrent Sync was superseded by Resilio Sync in 2016, the bittorrentSync, bittorrentSync14, and bittorrentSync16 packages have been removed in favor of resilio-sync. - The corresponding module, has been - replaced by the module. + The corresponding module, has been replaced by the module. - The httpd service no longer attempts to start the postgresql service. If you have come to depend - on this behaviour then you can preserve the behavior with the following configuration: - systemd.services.httpd.after = [ "postgresql.service" ]; + The httpd service no longer attempts to start the postgresql service. If you have come to depend on this behaviour then you can preserve the behavior with the following configuration: systemd.services.httpd.after = [ "postgresql.service" ]; - The option has been - marked as deprecated. You may still use this feature, but it will be - removed in a future release of NixOS. You are encouraged to convert any - httpd subservices you may have written to a full NixOS module. + The option has been marked as deprecated. You may still use this feature, but it will be removed in a future release of NixOS. You are encouraged to convert any httpd subservices you may have written to a full NixOS module. - Most of the httpd subservices packaged with NixOS have been replaced with - full NixOS modules including LimeSurvey, WordPress, and Zabbix. These - modules can be enabled using the , - , , - and options. + Most of the httpd subservices packaged with NixOS have been replaced with full NixOS modules including LimeSurvey, WordPress, and Zabbix. These modules can be enabled using the , , , and options. - The option - was renamed to - (capital L). This follows - - upstreams renaming - of the setting. + The option was renamed to (capital L). This follows upstreams renaming of the setting. - As of this release the NixOps feature autoLuks is deprecated. It no longer works - with our systemd version without manual intervention. + As of this release the NixOps feature autoLuks is deprecated. It no longer works with our systemd version without manual intervention. - Whenever the usage of the module is detected the evaluation will fail with a message - explaining why and how to deal with the situation. + Whenever the usage of the module is detected the evaluation will fail with a message explaining why and how to deal with the situation. - A new knob named nixops.enableDeprecatedAutoLuks - has been introduced to disable the eval failure and to acknowledge the notice was received and read. - If you plan on using the feature please note that it might break with subsequent updates. + A new knob named nixops.enableDeprecatedAutoLuks has been introduced to disable the eval failure and to acknowledge the notice was received and read. If you plan on using the feature please note that it might break with subsequent updates. - Make sure you set the _netdev option for each of the file systems referring to block - devices provided by the autoLuks module. Not doing this might render the system in a - state where it doesn't boot anymore. + Make sure you set the _netdev option for each of the file systems referring to block devices provided by the autoLuks module. Not doing this might render the system in a state where it doesn't boot anymore. - If you are actively using the autoLuks module please let us know in - issue #62211. + If you are actively using the autoLuks module please let us know in issue #62211. - The setopt declarations will be evaluated at the end of /etc/zshrc, so any code in , - and may break if it relies on those options being set. + The setopt declarations will be evaluated at the end of /etc/zshrc, so any code in , and may break if it relies on those options being set. - The prometheus-nginx-exporter package now uses the offical exporter provided by NGINX Inc. - Its metrics are differently structured and are incompatible to the old ones. For information about the metrics, - have a look at the official repo. + The prometheus-nginx-exporter package now uses the offical exporter provided by NGINX Inc. Its metrics are differently structured and are incompatible to the old ones. For information about the metrics, have a look at the official repo. - The shibboleth-sp package has been updated to version 3. - It is largely backward compatible, for further information refer to the - release notes - and upgrade guide. + The shibboleth-sp package has been updated to version 3. It is largely backward compatible, for further information refer to the release notes and upgrade guide. + + + Nodejs 8 is scheduled EOL under the lifetime of 19.09 and has been dropped. - - Nodejs 8 is scheduled EOL under the lifetime of 19.09 and has been dropped. - - - By default, prometheus exporters are now run with DynamicUser enabled. - Exporters that need a real user, now run under a seperate user and group which follow the pattern <exporter-name>-exporter, instead of the previous default nobody and nogroup. - Only some exporters are affected by the latter, namely the exporters dovecot, node, postfix and varnish. - + + By default, prometheus exporters are now run with DynamicUser enabled. Exporters that need a real user, now run under a seperate user and group which follow the pattern <exporter-name>-exporter, instead of the previous default nobody and nogroup. Only some exporters are affected by the latter, namely the exporters dovecot, node, postfix and varnish. + - - The ibus-qt package is not installed by default anymore when is set to ibus. - If IBus support in Qt 4.x applications is required, add the ibus-qt package to your manually. - + + The ibus-qt package is not installed by default anymore when is set to ibus. If IBus support in Qt 4.x applications is required, add the ibus-qt package to your manually. + - - The CUPS Printing service now uses socket-based activation by - default, only starting when needed. The previous behavior can - be restored by setting - to - false. - + + The CUPS Printing service now uses socket-based activation by default, only starting when needed. The previous behavior can be restored by setting to false. + - - The module has been removed from nixpkgs due to lack of maintainer. - + + The module has been removed from nixpkgs due to lack of maintainer. + - - The module has been removed from nixpkgs due to lack of maintainer. - + + The module has been removed from nixpkgs due to lack of maintainer. + - - Squid 3 has been removed and the derivation now refers to Squid 4. - + + Squid 3 has been removed and the derivation now refers to Squid 4. + - - The option has been replaced by - . The new option allows setting extra - configuration while being better type-checked and mergeable. - + + The option has been replaced by . The new option allows setting extra configuration while being better type-checked and mergeable. + - No service depends on keys.target anymore which is a systemd - target that indicates if all NixOps keys were successfully uploaded. - Instead, <key-name>-key.service should be used to define - a dependency of a key in a service. The full issue behind the keys.target - dependency is described at NixOS/nixpkgs#67265. + No service depends on keys.target anymore which is a systemd target that indicates if all NixOps keys were successfully uploaded. Instead, <key-name>-key.service should be used to define a dependency of a key in a service. The full issue behind the keys.target dependency is described at NixOS/nixpkgs#67265. The following services are affected by this: - services.dovecot2 - services.nsd - services.softether - services.strongswan - services.strongswan-swanctl - services.httpd + + + services.dovecot2 + + + + + services.nsd + + + + + services.softether + + + + + services.strongswan + + + + + services.strongswan-swanctl + + + + + services.httpd + + - - The option has been replaced by a read-only option for each certificate you define. This will be - a subdirectory of /var/lib/acme. You can use this read-only option to figure out where the certificates are stored for a specific certificate. For example, - the option will use this directory option to find the certs for the virtual host. - - - and options have been removed. To execute a service before certificates - are provisioned or renewed add a RequiredBy=acme-${cert}.service to any service. - - - Furthermore, the acme module will not automatically add a dependency on lighttpd.service anymore. If you are using certficates provided by letsencrypt - for lighttpd, then you should depend on the certificate service acme-${cert}.service> manually. - - - For nginx, the dependencies are still automatically managed when is enabled just like before. What changed is that nginx now directly depends on the specific certificates that it needs, - instead of depending on the catch-all acme-certificates.target. This target unit was also removed from the codebase. - This will mean nginx will no longer depend on certificates it isn't explicitly managing and fixes a bug with certificate renewal - ordering racing with nginx restarting which could lead to nginx getting in a broken state as described at - NixOS/nixpkgs#60180. - + + The option has been replaced by a read-only option for each certificate you define. This will be a subdirectory of /var/lib/acme. You can use this read-only option to figure out where the certificates are stored for a specific certificate. For example, the option will use this directory option to find the certs for the virtual host. + + + and options have been removed. To execute a service before certificates are provisioned or renewed add a RequiredBy=acme-${cert}.service to any service. + + + Furthermore, the acme module will not automatically add a dependency on lighttpd.service anymore. If you are using certficates provided by letsencrypt for lighttpd, then you should depend on the certificate service acme-${cert}.service> manually. + + + For nginx, the dependencies are still automatically managed when is enabled just like before. What changed is that nginx now directly depends on the specific certificates that it needs, instead of depending on the catch-all acme-certificates.target. This target unit was also removed from the codebase. This will mean nginx will no longer depend on certificates it isn't explicitly managing and fixes a bug with certificate renewal ordering racing with nginx restarting which could lead to nginx getting in a broken state as described at NixOS/nixpkgs#60180. + - - The old deprecated emacs package sets have been dropped. - What used to be called emacsPackagesNg is now simply called emacsPackages. - + + The old deprecated emacs package sets have been dropped. What used to be called emacsPackagesNg is now simply called emacsPackages. + - - is now disabled by default if stateVersion is 19.09 or higher. - Previously the xterm desktopManager was enabled when xserver was enabled, but it isn't useful for all people so it didn't make sense to - have any desktopManager enabled default. - + + is now disabled by default if stateVersion is 19.09 or higher. Previously the xterm desktopManager was enabled when xserver was enabled, but it isn't useful for all people so it didn't make sense to have any desktopManager enabled default. + - The WeeChat plugin pkgs.weechatScripts.weechat-xmpp has been removed as it doesn't receive - any updates from upstream and depends on outdated Python2-based modules. + The WeeChat plugin pkgs.weechatScripts.weechat-xmpp has been removed as it doesn't receive any updates from upstream and depends on outdated Python2-based modules. - Old unsupported versions (logstash5, - kibana5, - filebeat5, - heartbeat5, - metricbeat5, - packetbeat5) of the ELK-stack and Elastic beats have been removed. + Old unsupported versions (logstash5, kibana5, filebeat5, heartbeat5, metricbeat5, packetbeat5) of the ELK-stack and Elastic beats have been removed. - For NixOS 19.03, both Prometheus 1 and 2 were available to allow for - a seamless transition from version 1 to 2 with existing setups. - Because Prometheus 1 is no longer developed, it was removed. - Prometheus 2 is now configured with services.prometheus. + For NixOS 19.03, both Prometheus 1 and 2 were available to allow for a seamless transition from version 1 to 2 with existing setups. Because Prometheus 1 is no longer developed, it was removed. Prometheus 2 is now configured with services.prometheus. - - Citrix Receiver (citrix_receiver) has been dropped in favor of Citrix Workspace - (citrix_workspace). - + + Citrix Receiver (citrix_receiver) has been dropped in favor of Citrix Workspace (citrix_workspace). +
@@ -497,122 +494,74 @@ - The module gained an option named - which makes the - generated + The module gained an option named which makes the generated configuration.nix - 5 manual page include all options - from all NixOS modules included in a given - configuration.nix configuration file. Currently, it is - set to false by default as enabling it frequently - prevents evaluation. But the plan is to eventually have it set to - true by default. Please set it to - true now in your configuration.nix - and fix all the bugs it uncovers. + 5 manual page include all options from all NixOS modules included in a given configuration.nix configuration file. Currently, it is set to false by default as enabling it frequently prevents evaluation. But the plan is to eventually have it set to true by default. Please set it to true now in your configuration.nix and fix all the bugs it uncovers. - The vlc package gained support for Chromecast - streaming, enabled by default. TCP port 8010 must be open for it to work, - so something like networking.firewall.allowedTCPPorts = [ 8010 - ]; may be required in your configuration. Also consider enabling - - Accelerated Video Playback for better transcoding performance. + The vlc package gained support for Chromecast streaming, enabled by default. TCP port 8010 must be open for it to work, so something like networking.firewall.allowedTCPPorts = [ 8010 ]; may be required in your configuration. Also consider enabling Accelerated Video Playback for better transcoding performance. - The following changes apply if the stateVersion is - changed to 19.09 or higher. For stateVersion = "19.03" - or lower the old behavior is preserved. + The following changes apply if the stateVersion is changed to 19.09 or higher. For stateVersion = "19.03" or lower the old behavior is preserved. - solr.package defaults to - pkgs.solr_8. + solr.package defaults to pkgs.solr_8. - The hunspellDicts.fr-any dictionary now ships with fr_FR.{aff,dic} - which is linked to fr-toutesvariantes.{aff,dic}. + The hunspellDicts.fr-any dictionary now ships with fr_FR.{aff,dic} which is linked to fr-toutesvariantes.{aff,dic}. - The mysql service now runs as mysql - user. Previously, systemd did execute it as root, and mysql dropped privileges - itself. - This includes ExecStartPre= and - ExecStartPost= phases. - To accomplish that, runtime and data directory setup was delegated to - RuntimeDirectory and tmpfiles. + The mysql service now runs as mysql user. Previously, systemd did execute it as root, and mysql dropped privileges itself. This includes ExecStartPre= and ExecStartPost= phases. To accomplish that, runtime and data directory setup was delegated to RuntimeDirectory and tmpfiles. - With the upgrade to systemd version 242 the systemd-timesyncd - service is no longer using DynamicUser=yes. In order for the - upgrade to work we rely on an activation script to move the state from the old - to the new directory. The older directory (prior 19.09) was - /var/lib/private/systemd/timesync. + With the upgrade to systemd version 242 the systemd-timesyncd service is no longer using DynamicUser=yes. In order for the upgrade to work we rely on an activation script to move the state from the old to the new directory. The older directory (prior 19.09) was /var/lib/private/systemd/timesync. - As long as the system.config.stateVersion is below - 19.09 the state folder will migrated to its proper location - (/var/lib/systemd/timesync), if required. + As long as the system.config.stateVersion is below 19.09 the state folder will migrated to its proper location (/var/lib/systemd/timesync), if required. - The package avahi is now built to look up service - definitions from /etc/avahi/services instead of its - output directory in the nix store. Accordingly the module - now supports custom service definitions via - , which are then placed - in the aforementioned directory. See - avahi.service5 - for more information on custom service definitions. + The package avahi is now built to look up service definitions from /etc/avahi/services instead of its output directory in the nix store. Accordingly the module now supports custom service definitions via , which are then placed in the aforementioned directory. See + avahi.service + 5 for more information on custom service definitions. - Since version 0.1.19, cargo-vendor honors package - includes that are specified in the Cargo.toml - file of Rust crates. rustPlatform.buildRustPackage uses - cargo-vendor to collect and build dependent crates. - Since this change in cargo-vendor changes the set of - vendored files for most Rust packages, the hash that use used to verify - the dependencies, cargoSha256, also changes. + Since version 0.1.19, cargo-vendor honors package includes that are specified in the Cargo.toml file of Rust crates. rustPlatform.buildRustPackage uses cargo-vendor to collect and build dependent crates. Since this change in cargo-vendor changes the set of vendored files for most Rust packages, the hash that use used to verify the dependencies, cargoSha256, also changes. - The cargoSha256 hashes of all in-tree derivations that - use buildRustPackage have been updated to reflect this - change. However, third-party derivations that use - buildRustPackage may have to be updated as well. + The cargoSha256 hashes of all in-tree derivations that use buildRustPackage have been updated to reflect this change. However, third-party derivations that use buildRustPackage may have to be updated as well. - The consul package was upgraded past version 1.5, - so its deprecated legacy UI is no longer available. + The consul package was upgraded past version 1.5, so its deprecated legacy UI is no longer available. - The default resample-method for PulseAudio has been changed from the upstream default speex-float-1 - to speex-float-5. Be aware that low-powered ARM-based and MIPS-based boards will struggle with this - so you'll need to set back to speex-float-1. + The default resample-method for PulseAudio has been changed from the upstream default speex-float-1 to speex-float-5. Be aware that low-powered ARM-based and MIPS-based boards will struggle with this so you'll need to set back to speex-float-1. - The phabricator package and associated httpd.extraSubservice, as well as the - phd service have been removed from nixpkgs due to lack of maintainer. + The phabricator package and associated httpd.extraSubservice, as well as the phd service have been removed from nixpkgs due to lack of maintainer. @@ -627,8 +576,7 @@ - The foswiki package and associated httpd.extraSubservice have been removed - from nixpkgs due to lack of maintainer. + The foswiki package and associated httpd.extraSubservice have been removed from nixpkgs due to lack of maintainer. @@ -638,155 +586,126 @@ - It's now possible to change configuration in - services.nextcloud after the initial deploy - since all config parameters are persisted in an additional config file generated by the module. - Previously core configuration like database parameters were set using their imperative - installer after creating /var/lib/nextcloud. + It's now possible to change configuration in services.nextcloud after the initial deploy since all config parameters are persisted in an additional config file generated by the module. Previously core configuration like database parameters were set using their imperative installer after creating /var/lib/nextcloud. - There exists now lib.forEach, which is like map, but with - arguments flipped. When mapping function body spans many lines (or has nested - maps), it is often hard to follow which list is modified. + There exists now lib.forEach, which is like map, but with arguments flipped. When mapping function body spans many lines (or has nested maps), it is often hard to follow which list is modified. - Previous solution to this problem was either to use lib.flip map - idiom or extract that anonymous mapping function to a named one. Both can still be used - but lib.forEach is preferred over lib.flip map. + Previous solution to this problem was either to use lib.flip map idiom or extract that anonymous mapping function to a named one. Both can still be used but lib.forEach is preferred over lib.flip map. - The /etc/sysctl.d/nixos.conf file containing all the options set via - boot.kernel.sysctl was moved to - /etc/sysctl.d/60-nixos.conf, as - sysctl.d5 - recommends prefixing all filenames in /etc/sysctl.d with a - two-digit number and a dash to simplify the ordering of the files. + The /etc/sysctl.d/nixos.conf file containing all the options set via boot.kernel.sysctl was moved to /etc/sysctl.d/60-nixos.conf, as + sysctl.d + 5 recommends prefixing all filenames in /etc/sysctl.d with a two-digit number and a dash to simplify the ordering of the files. - We now install the sysctl snippets shipped with systemd. - - This enables: - - Loose reverse path filtering - - - Source route filtering - - + We now install the sysctl snippets shipped with systemd. + - fq_codel as a packet scheduler (this helps to fight bufferbloat) + This enables: - - - This also configures the kernel to pass coredumps to systemd-coredump, - and restricts the SysRq key combinations to the sync command only. - These sysctl snippets can be found in /etc/sysctl.d/50-*.conf, - and overridden via boot.kernel.sysctl - (which will place the parameters in /etc/sysctl.d/60-nixos.conf). - + + + Loose reverse path filtering + + + + + Source route filtering + + + + + fq_codel as a packet scheduler (this helps to fight bufferbloat) + + + + This also configures the kernel to pass coredumps to systemd-coredump, and restricts the SysRq key combinations to the sync command only. These sysctl snippets can be found in /etc/sysctl.d/50-*.conf, and overridden via boot.kernel.sysctl (which will place the parameters in /etc/sysctl.d/60-nixos.conf). + - Coredumps are now acquired by systemd-coredump by default. - systemd-coredump behaviour can still be modified via - . - To stick to the old behaviour (having the kernel dump to a file called core - in the working directory), without piping it through systemd-coredump, set - to "core". + Coredumps are now acquired by systemd-coredump by default. systemd-coredump behaviour can still be modified via . To stick to the old behaviour (having the kernel dump to a file called core in the working directory), without piping it through systemd-coredump, set to "core". - systemd.packages option now also supports generators and - shutdown scripts. Old systemd.generator-packages option has - been removed. + systemd.packages option now also supports generators and shutdown scripts. Old systemd.generator-packages option has been removed. - The rmilter package was removed with associated module and options due deprecation by upstream developer. - Use rspamd in proxy mode instead. + The rmilter package was removed with associated module and options due deprecation by upstream developer. Use rspamd in proxy mode instead. - systemd cgroup accounting via the - systemd.enableCgroupAccounting - option is now enabled by default. It now also enables the more recent Block IO and IP accounting - features. + systemd cgroup accounting via the systemd.enableCgroupAccounting option is now enabled by default. It now also enables the more recent Block IO and IP accounting features. - We no longer enable custom font rendering settings with by default. - The defaults from fontconfig are sufficient. + We no longer enable custom font rendering settings with by default. The defaults from fontconfig are sufficient. - The crashplan package and the - crashplan service have been removed from nixpkgs due to - crashplan shutting down the service, while the crashplansb - package and crashplan-small-business service have been - removed from nixpkgs due to lack of maintainer. + The crashplan package and the crashplan service have been removed from nixpkgs due to crashplan shutting down the service, while the crashplansb package and crashplan-small-business service have been removed from nixpkgs due to lack of maintainer. - The redis module was hardcoded to use the redis user, - /run/redis as runtime directory and - /var/lib/redis as state directory. - Note that the NixOS module for Redis now disables kernel support for Transparent Huge Pages (THP), - because this features causes major performance problems for Redis, - e.g. (https://redis.io/topics/latency). + The redis module was hardcoded to use the redis user, /run/redis as runtime directory and /var/lib/redis as state directory. Note that the NixOS module for Redis now disables kernel support for Transparent Huge Pages (THP), because this features causes major performance problems for Redis, e.g. (https://redis.io/topics/latency). Using adds a default emoji font noto-fonts-emoji. - Users of the following options will have this enabled by default: + + Users of the following options will have this enabled by default: + - + + + - + + + - + + + - + + + - - The altcoins categorization of packages has - been removed. You now access these packages at the top level, - ie. nix-shell -p dogecoin instead of - nix-shell -p altcoins.dogecoin, etc. - + + The altcoins categorization of packages has been removed. You now access these packages at the top level, ie. nix-shell -p dogecoin instead of nix-shell -p altcoins.dogecoin, etc. + - - Ceph has been upgraded to v14.2.1. - See the release notes for details. - The mgr dashboard as well as osds backed by loop-devices is no longer explicitly supported by the package and module. - Note: There's been some issues with python-cherrypy, which is used by the dashboard - and prometheus mgr modules (and possibly others), hence 0000-dont-check-cherrypy-version.patch. - - - - - pkgs.weechat is now compiled against pkgs.python3. - Weechat also recommends to use Python3 - in their docs. - - + + Ceph has been upgraded to v14.2.1. See the release notes for details. The mgr dashboard as well as osds backed by loop-devices is no longer explicitly supported by the package and module. Note: There's been some issues with python-cherrypy, which is used by the dashboard and prometheus mgr modules (and possibly others), hence 0000-dont-check-cherrypy-version.patch. + + + + + pkgs.weechat is now compiled against pkgs.python3. Weechat also recommends to use Python3 in their docs. + + diff --git a/nixos/doc/manual/release-notes/rl-2003.xml b/nixos/doc/manual/release-notes/rl-2003.xml index c84bc8dbb379..f10c0afd1db4 100644 --- a/nixos/doc/manual/release-notes/rl-2003.xml +++ b/nixos/doc/manual/release-notes/rl-2003.xml @@ -13,8 +13,7 @@ Highlights - In addition to numerous new and upgraded packages, this release has the - following highlights: + In addition to numerous new and upgraded packages, this release has the following highlights: @@ -42,7 +41,6 @@ -
Backward Incompatibilities - When upgrading from a previous release, please be aware of the following - incompatible changes: + When upgrading from a previous release, please be aware of the following incompatible changes: diff --git a/nixos/modules/i18n/input-method/default.xml b/nixos/modules/i18n/input-method/default.xml index 117482fb0d57..830ef88d6d9a 100644 --- a/nixos/modules/i18n/input-method/default.xml +++ b/nixos/modules/i18n/input-method/default.xml @@ -5,11 +5,7 @@ xml:id="module-services-input-methods"> Input Methods - Input methods are an operating system component that allows any data, such as - keyboard strokes or mouse movements, to be received as input. In this way - users can enter characters and symbols not found on their input devices. - Using an input method is obligatory for any language that has more graphemes - than there are keys on the keyboard. + Input methods are an operating system component that allows any data, such as keyboard strokes or mouse movements, to be received as input. In this way users can enter characters and symbols not found on their input devices. Using an input method is obligatory for any language that has more graphemes than there are keys on the keyboard. The following input methods are available in NixOS: @@ -40,8 +36,7 @@ IBus - IBus is an Intelligent Input Bus. It provides full featured and user - friendly input method user interface. + IBus is an Intelligent Input Bus. It provides full featured and user friendly input method user interface. @@ -56,8 +51,7 @@ i18n.inputMethod = { - i18n.inputMethod.ibus.engines is optional and can be used - to add extra IBus engines. + i18n.inputMethod.ibus.engines is optional and can be used to add extra IBus engines. @@ -67,8 +61,7 @@ i18n.inputMethod = { - Anthy (ibus-engines.anthy): Anthy is a system for - Japanese input method. It converts Hiragana text to Kana Kanji mixed text. + Anthy (ibus-engines.anthy): Anthy is a system for Japanese input method. It converts Hiragana text to Kana Kanji mixed text. @@ -78,28 +71,22 @@ i18n.inputMethod = { - m17n (ibus-engines.m17n): m17n is an input method that - uses input methods and corresponding icons in the m17n database. + m17n (ibus-engines.m17n): m17n is an input method that uses input methods and corresponding icons in the m17n database. - mozc (ibus-engines.mozc): A Japanese input method from - Google. + mozc (ibus-engines.mozc): A Japanese input method from Google. - Table (ibus-engines.table): An input method that load - tables of input methods. + Table (ibus-engines.table): An input method that load tables of input methods. - table-others (ibus-engines.table-others): Various - table-based input methods. To use this, and any other table-based input - methods, it must appear in the list of engines along with - table. For example: + table-others (ibus-engines.table-others): Various table-based input methods. To use this, and any other table-based input methods, it must appear in the list of engines along with table. For example: ibus.engines = with pkgs.ibus-engines; [ table table-others ]; @@ -108,22 +95,13 @@ ibus.engines = with pkgs.ibus-engines; [ table table-others ]; - To use any input method, the package must be added in the configuration, as - shown above, and also (after running nixos-rebuild) the - input method must be added from IBus' preference dialog. + To use any input method, the package must be added in the configuration, as shown above, and also (after running nixos-rebuild) the input method must be added from IBus' preference dialog. Troubleshooting - If IBus works in some applications but not others, a likely cause of this - is that IBus is depending on a different version of glib - to what the applications are depending on. This can be checked by running - nix-store -q --requisites <path> | grep glib, - where <path> is the path of either IBus or an - application in the Nix store. The glib packages must - match exactly. If they do not, uninstalling and reinstalling the - application is a likely fix. + If IBus works in some applications but not others, a likely cause of this is that IBus is depending on a different version of glib to what the applications are depending on. This can be checked by running nix-store -q --requisites <path> | grep glib, where <path> is the path of either IBus or an application in the Nix store. The glib packages must match exactly. If they do not, uninstalling and reinstalling the application is a likely fix.
@@ -131,8 +109,7 @@ ibus.engines = with pkgs.ibus-engines; [ table table-others ]; Fcitx - Fcitx is an input method framework with extension support. It has three - built-in Input Method Engine, Pinyin, QuWei and Table-based input methods. + Fcitx is an input method framework with extension support. It has three built-in Input Method Engine, Pinyin, QuWei and Table-based input methods. @@ -147,8 +124,7 @@ i18n.inputMethod = { - i18n.inputMethod.fcitx.engines is optional and can be - used to add extra Fcitx engines. + i18n.inputMethod.fcitx.engines is optional and can be used to add extra Fcitx engines. @@ -158,15 +134,12 @@ i18n.inputMethod = { - Anthy (fcitx-engines.anthy): Anthy is a system for - Japanese input method. It converts Hiragana text to Kana Kanji mixed text. + Anthy (fcitx-engines.anthy): Anthy is a system for Japanese input method. It converts Hiragana text to Kana Kanji mixed text. - Chewing (fcitx-engines.chewing): Chewing is an - intelligent Zhuyin input method. It is one of the most popular input - methods among Traditional Chinese Unix users. + Chewing (fcitx-engines.chewing): Chewing is an intelligent Zhuyin input method. It is one of the most popular input methods among Traditional Chinese Unix users. @@ -181,20 +154,17 @@ i18n.inputMethod = { - m17n (fcitx-engines.m17n): m17n is an input method that - uses input methods and corresponding icons in the m17n database. + m17n (fcitx-engines.m17n): m17n is an input method that uses input methods and corresponding icons in the m17n database. - mozc (fcitx-engines.mozc): A Japanese input method from - Google. + mozc (fcitx-engines.mozc): A Japanese input method from Google. - table-others (fcitx-engines.table-others): Various - table-based input methods. + table-others (fcitx-engines.table-others): Various table-based input methods. @@ -203,9 +173,7 @@ i18n.inputMethod = { Nabi - Nabi is an easy to use Korean X input method. It allows you to enter - phonetic Korean characters (hangul) and pictographic Korean characters - (hanja). + Nabi is an easy to use Korean X input method. It allows you to enter phonetic Korean characters (hangul) and pictographic Korean characters (hanja). @@ -222,8 +190,7 @@ i18n.inputMethod = { Uim - Uim (short for "universal input method") is a multilingual input method - framework. Applications can use it through so-called bridges. + Uim (short for "universal input method") is a multilingual input method framework. Applications can use it through so-called bridges. @@ -237,8 +204,7 @@ i18n.inputMethod = { - Note: The option can be - used to choose uim toolbar. + Note: The option can be used to choose uim toolbar. diff --git a/nixos/modules/programs/digitalbitbox/doc.xml b/nixos/modules/programs/digitalbitbox/doc.xml index c63201628dbd..871abddca4c3 100644 --- a/nixos/modules/programs/digitalbitbox/doc.xml +++ b/nixos/modules/programs/digitalbitbox/doc.xml @@ -8,37 +8,25 @@ Digital Bitbox is a hardware wallet and second-factor authenticator. - The digitalbitbox programs module may be installed by - setting programs.digitalbitbox to true - in a manner similar to + The digitalbitbox programs module may be installed by setting programs.digitalbitbox to true in a manner similar to = true; - and bundles the digitalbitbox package (see - ), which contains the - dbb-app and dbb-cli binaries, along - with the hardware module (see - ) which sets up the - necessary udev rules to access the device. + and bundles the digitalbitbox package (see ), which contains the dbb-app and dbb-cli binaries, along with the hardware module (see ) which sets up the necessary udev rules to access the device. - Enabling the digitalbitbox module is pretty much the easiest way to get a - Digital Bitbox device working on your system. + Enabling the digitalbitbox module is pretty much the easiest way to get a Digital Bitbox device working on your system. - For more information, see - . + For more information, see .
Package - The binaries, dbb-app (a GUI tool) and - dbb-cli (a CLI tool), are available through the - digitalbitbox package which could be installed as - follows: + The binaries, dbb-app (a GUI tool) and dbb-cli (a CLI tool), are available through the digitalbitbox package which could be installed as follows: = [ pkgs.digitalbitbox @@ -50,17 +38,14 @@ Hardware - The digitalbitbox hardware package enables the udev rules for Digital Bitbox - devices and may be installed as follows: + The digitalbitbox hardware package enables the udev rules for Digital Bitbox devices and may be installed as follows: = true; - In order to alter the udev rules, one may provide different values for the - udevRule51 and udevRule52 attributes - by means of overriding as follows: + In order to alter the udev rules, one may provide different values for the udevRule51 and udevRule52 attributes by means of overriding as follows: programs.digitalbitbox = { enable = true; diff --git a/nixos/modules/programs/plotinus.xml b/nixos/modules/programs/plotinus.xml index 8fc8c22c6d76..a0370f90a41f 100644 --- a/nixos/modules/programs/plotinus.xml +++ b/nixos/modules/programs/plotinus.xml @@ -5,24 +5,19 @@ xml:id="module-program-plotinus"> Plotinus - Source: - modules/programs/plotinus.nix + Source: modules/programs/plotinus.nix - Upstream documentation: - + Upstream documentation: Plotinus is a searchable command palette in every modern GTK application. - When in a GTK 3 application and Plotinus is enabled, you can press - Ctrl+Shift+P to open the command palette. The command - palette provides a searchable list of of all menu items in the application. + When in a GTK 3 application and Plotinus is enabled, you can press Ctrl+Shift+P to open the command palette. The command palette provides a searchable list of of all menu items in the application. - To enable Plotinus, add the following to your - configuration.nix: + To enable Plotinus, add the following to your configuration.nix: = true; diff --git a/nixos/modules/programs/zsh/oh-my-zsh.xml b/nixos/modules/programs/zsh/oh-my-zsh.xml index 568c2de65576..c5202d818c9f 100644 --- a/nixos/modules/programs/zsh/oh-my-zsh.xml +++ b/nixos/modules/programs/zsh/oh-my-zsh.xml @@ -5,18 +5,13 @@ xml:id="module-programs-zsh-ohmyzsh"> Oh my ZSH - oh-my-zsh is a - framework to manage your ZSH - configuration including completion scripts for several CLI tools or custom - prompt themes. + oh-my-zsh is a framework to manage your ZSH configuration including completion scripts for several CLI tools or custom prompt themes.
Basic usage - The module uses the oh-my-zsh package with all available - features. The initial setup using Nix expressions is fairly similar to the - configuration format of oh-my-zsh. + The module uses the oh-my-zsh package with all available features. The initial setup using Nix expressions is fairly similar to the configuration format of oh-my-zsh. { programs.zsh.ohMyZsh = { @@ -26,25 +21,18 @@ }; } - For a detailed explanation of these arguments please refer to the - oh-my-zsh - docs. + For a detailed explanation of these arguments please refer to the oh-my-zsh docs. - The expression generates the needed configuration and writes it into your - /etc/zshrc. + The expression generates the needed configuration and writes it into your /etc/zshrc.
Custom additions - Sometimes third-party or custom scripts such as a modified theme may be - needed. oh-my-zsh provides the - ZSH_CUSTOM - environment variable for this which points to a directory with additional - scripts. + Sometimes third-party or custom scripts such as a modified theme may be needed. oh-my-zsh provides the ZSH_CUSTOM environment variable for this which points to a directory with additional scripts. @@ -60,16 +48,11 @@ Custom environments - There are several extensions for oh-my-zsh packaged in - nixpkgs. One of them is - nix-zsh-completions - which bundles completion scripts and a plugin for - oh-my-zsh. + There are several extensions for oh-my-zsh packaged in nixpkgs. One of them is nix-zsh-completions which bundles completion scripts and a plugin for oh-my-zsh. - Rather than using a single mutable path for ZSH_CUSTOM, - it's also possible to generate this path from a list of Nix packages: + Rather than using a single mutable path for ZSH_CUSTOM, it's also possible to generate this path from a list of Nix packages: { pkgs, ... }: { @@ -79,53 +62,34 @@ ]; } - Internally a single store path will be created using - buildEnv. Please refer to the docs of - buildEnv - for further reference. + Internally a single store path will be created using buildEnv. Please refer to the docs of buildEnv for further reference. - Please keep in mind that this is not compatible with - programs.zsh.ohMyZsh.custom as it requires an immutable - store path while custom shall remain mutable! An - evaluation failure will be thrown if both custom and - customPkgs are set. + Please keep in mind that this is not compatible with programs.zsh.ohMyZsh.custom as it requires an immutable store path while custom shall remain mutable! An evaluation failure will be thrown if both custom and customPkgs are set.
Package your own customizations - If third-party customizations (e.g. new themes) are supposed to be added to - oh-my-zsh there are several pitfalls to keep in mind: + If third-party customizations (e.g. new themes) are supposed to be added to oh-my-zsh there are several pitfalls to keep in mind: - To comply with the default structure of ZSH the entire - output needs to be written to $out/share/zsh. + To comply with the default structure of ZSH the entire output needs to be written to $out/share/zsh. - Completion scripts are supposed to be stored at - $out/share/zsh/site-functions. This directory is part - of the - fpath - and the package should be compatible with pure ZSH - setups. The module will automatically link the contents of - site-functions to completions directory in the proper - store path. + Completion scripts are supposed to be stored at $out/share/zsh/site-functions. This directory is part of the fpath and the package should be compatible with pure ZSH setups. The module will automatically link the contents of site-functions to completions directory in the proper store path. - The plugins directory needs the structure - pluginname/pluginname.plugin.zsh as structured in the - upstream - repo. + The plugins directory needs the structure pluginname/pluginname.plugin.zsh as structured in the upstream repo. diff --git a/nixos/modules/security/acme.xml b/nixos/modules/security/acme.xml index 9d0a1995e0ff..182d6e0cd516 100644 --- a/nixos/modules/security/acme.xml +++ b/nixos/modules/security/acme.xml @@ -5,19 +5,13 @@ xml:id="module-security-acme"> SSL/TLS Certificates with ACME - NixOS supports automatic domain validation & certificate retrieval and - renewal using the ACME protocol. This is currently only implemented by and - for Let's Encrypt. The alternative ACME client simp_le is - used under the hood. + NixOS supports automatic domain validation & certificate retrieval and renewal using the ACME protocol. This is currently only implemented by and for Let's Encrypt. The alternative ACME client simp_le is used under the hood.
Prerequisites - You need to have a running HTTP server for verification. The server must - have a webroot defined that can serve - .well-known/acme-challenge. This directory must be - writeable by the user that will run the ACME client. + You need to have a running HTTP server for verification. The server must have a webroot defined that can serve .well-known/acme-challenge. This directory must be writeable by the user that will run the ACME client. @@ -45,9 +39,7 @@ http { Configuring - To enable ACME certificate retrieval & renewal for a certificate for - foo.example.com, add the following in your - configuration.nix: + To enable ACME certificate retrieval & renewal for a certificate for foo.example.com, add the following in your configuration.nix: ."foo.example.com" = { webroot = "/var/www/challenges"; @@ -57,26 +49,18 @@ http { - The private key key.pem and certificate - fullchain.pem will be put into - /var/lib/acme/foo.example.com. + The private key key.pem and certificate fullchain.pem will be put into /var/lib/acme/foo.example.com. + - Refer to for all available configuration - options for the security.acme - module. + Refer to for all available configuration options for the security.acme module.
Using ACME certificates in Nginx - NixOS supports fetching ACME certificates for you by setting - enableACME - = true; in a virtualHost config. We first create self-signed - placeholder certificates in place of the real ACME certs. The placeholder - certs are overwritten when the ACME certs arrive. For - foo.example.com the config would look like. + NixOS supports fetching ACME certificates for you by setting enableACME = true; in a virtualHost config. We first create self-signed placeholder certificates in place of the real ACME certs. The placeholder certs are overwritten when the ACME certs arrive. For foo.example.com the config would look like. diff --git a/nixos/modules/security/hidepid.xml b/nixos/modules/security/hidepid.xml index 5a17cb1da412..979d0215ab34 100644 --- a/nixos/modules/security/hidepid.xml +++ b/nixos/modules/security/hidepid.xml @@ -9,18 +9,13 @@ = true; - ensures that access to process information is restricted to the owning user. - This implies, among other things, that command-line arguments remain private. - Unless your deployment relies on unprivileged users being able to inspect the - process information of other users, this option should be safe to enable. + ensures that access to process information is restricted to the owning user. This implies, among other things, that command-line arguments remain private. Unless your deployment relies on unprivileged users being able to inspect the process information of other users, this option should be safe to enable. - Members of the proc group are exempt from process - information hiding. + Members of the proc group are exempt from process information hiding. - To allow a service foo to run without process - information hiding, set + To allow a service foo to run without process information hiding, set systemd.services.foo.serviceConfig.SupplementaryGroups = [ "proc" ]; diff --git a/nixos/modules/services/databases/foundationdb.xml b/nixos/modules/services/databases/foundationdb.xml index b0b1ebeab45f..33adfee35260 100644 --- a/nixos/modules/services/databases/foundationdb.xml +++ b/nixos/modules/services/databases/foundationdb.xml @@ -5,12 +5,10 @@ xml:id="module-services-foundationdb"> FoundationDB - Source: - modules/services/databases/foundationdb.nix + Source: modules/services/databases/foundationdb.nix - Upstream documentation: - + Upstream documentation: Maintainer: Austin Seipp @@ -19,15 +17,13 @@ Available version(s): 5.1.x, 5.2.x, 6.0.x - FoundationDB (or "FDB") is an open source, distributed, transactional - key-value store. + FoundationDB (or "FDB") is an open source, distributed, transactional key-value store.
Configuring and basic setup - To enable FoundationDB, add the following to your - configuration.nix: + To enable FoundationDB, add the following to your configuration.nix: services.foundationdb.enable = true; services.foundationdb.package = pkgs.foundationdb52; # FoundationDB 5.2.x @@ -35,18 +31,11 @@ services.foundationdb.package = pkgs.foundationdb52; # FoundationDB 5.2.x - The option is required, and - must always be specified. Due to the fact FoundationDB network protocols and - on-disk storage formats may change between (major) versions, and upgrades - must be explicitly handled by the user, you must always manually specify - this yourself so that the NixOS module will use the proper version. Note - that minor, bugfix releases are always compatible. + The option is required, and must always be specified. Due to the fact FoundationDB network protocols and on-disk storage formats may change between (major) versions, and upgrades must be explicitly handled by the user, you must always manually specify this yourself so that the NixOS module will use the proper version. Note that minor, bugfix releases are always compatible. - After running nixos-rebuild, you can verify whether - FoundationDB is running by executing fdbcli (which is - added to ): + After running nixos-rebuild, you can verify whether FoundationDB is running by executing fdbcli (which is added to ): $ sudo -u foundationdb fdbcli Using cluster file `/etc/foundationdb/fdb.cluster'. @@ -77,11 +66,7 @@ Cluster: - You can also write programs using the available client libraries. For - example, the following Python program can be run in order to grab the - cluster status, as a quick example. (This example uses - nix-shell shebang support to automatically supply the - necessary Python modules). + You can also write programs using the available client libraries. For example, the following Python program can be run in order to grab the cluster status, as a quick example. (This example uses nix-shell shebang support to automatically supply the necessary Python modules). a@link> cat fdb-status.py #! /usr/bin/env nix-shell @@ -111,91 +96,56 @@ FoundationDB available: True - FoundationDB is run under the foundationdb user and group - by default, but this may be changed in the NixOS configuration. The systemd - unit foundationdb.service controls the - fdbmonitor process. + FoundationDB is run under the foundationdb user and group by default, but this may be changed in the NixOS configuration. The systemd unit foundationdb.service controls the fdbmonitor process. - By default, the NixOS module for FoundationDB creates a single SSD-storage - based database for development and basic usage. This storage engine is - designed for SSDs and will perform poorly on HDDs; however it can handle far - more data than the alternative "memory" engine and is a better default - choice for most deployments. (Note that you can change the storage backend - on-the-fly for a given FoundationDB cluster using - fdbcli.) + By default, the NixOS module for FoundationDB creates a single SSD-storage based database for development and basic usage. This storage engine is designed for SSDs and will perform poorly on HDDs; however it can handle far more data than the alternative "memory" engine and is a better default choice for most deployments. (Note that you can change the storage backend on-the-fly for a given FoundationDB cluster using fdbcli.) - Furthermore, only 1 server process and 1 backup agent are started in the - default configuration. See below for more on scaling to increase this. + Furthermore, only 1 server process and 1 backup agent are started in the default configuration. See below for more on scaling to increase this. - FoundationDB stores all data for all server processes under - /var/lib/foundationdb. You can override this using - , e.g. + FoundationDB stores all data for all server processes under /var/lib/foundationdb. You can override this using , e.g. services.foundationdb.dataDir = "/data/fdb"; - Similarly, logs are stored under /var/log/foundationdb - by default, and there is a corresponding - as well. + Similarly, logs are stored under /var/log/foundationdb by default, and there is a corresponding as well.
Scaling processes and backup agents - Scaling the number of server processes is quite easy; simply specify - to be the number of - FoundationDB worker processes that should be started on the machine. + Scaling the number of server processes is quite easy; simply specify to be the number of FoundationDB worker processes that should be started on the machine. - FoundationDB worker processes typically require 4GB of RAM per-process at - minimum for good performance, so this option is set to 1 by default since - the maximum amount of RAM is unknown. You're advised to abide by this - restriction, so pick a number of processes so that each has 4GB or more. + FoundationDB worker processes typically require 4GB of RAM per-process at minimum for good performance, so this option is set to 1 by default since the maximum amount of RAM is unknown. You're advised to abide by this restriction, so pick a number of processes so that each has 4GB or more. - A similar option exists in order to scale backup agent processes, - . Backup agents are - not as performance/RAM sensitive, so feel free to experiment with the number - of available backup processes. + A similar option exists in order to scale backup agent processes, . Backup agents are not as performance/RAM sensitive, so feel free to experiment with the number of available backup processes.
Clustering - FoundationDB on NixOS works similarly to other Linux systems, so this - section will be brief. Please refer to the full FoundationDB documentation - for more on clustering. + FoundationDB on NixOS works similarly to other Linux systems, so this section will be brief. Please refer to the full FoundationDB documentation for more on clustering. - FoundationDB organizes clusters using a set of - coordinators, which are just specially-designated - worker processes. By default, every installation of FoundationDB on NixOS - will start as its own individual cluster, with a single coordinator: the - first worker process on localhost. + FoundationDB organizes clusters using a set of coordinators, which are just specially-designated worker processes. By default, every installation of FoundationDB on NixOS will start as its own individual cluster, with a single coordinator: the first worker process on localhost. - Coordinators are specified globally using the - /etc/foundationdb/fdb.cluster file, which all servers and - client applications will use to find and join coordinators. Note that this - file can not be managed by NixOS so easily: - FoundationDB is designed so that it will rewrite the file at runtime for all - clients and nodes when cluster coordinators change, with clients - transparently handling this without intervention. It is fundamentally a - mutable file, and you should not try to manage it in any way in NixOS. + Coordinators are specified globally using the /etc/foundationdb/fdb.cluster file, which all servers and client applications will use to find and join coordinators. Note that this file can not be managed by NixOS so easily: FoundationDB is designed so that it will rewrite the file at runtime for all clients and nodes when cluster coordinators change, with clients transparently handling this without intervention. It is fundamentally a mutable file, and you should not try to manage it in any way in NixOS. @@ -216,9 +166,7 @@ services.foundationdb.dataDir = "/data/fdb"; - A node must already be a member of the cluster in order to properly be - promoted to a coordinator, so you must always add it first if you wish to - promote it. + A node must already be a member of the cluster in order to properly be promoted to a coordinator, so you must always add it first if you wish to promote it. @@ -233,37 +181,26 @@ services.foundationdb.dataDir = "/data/fdb"; - Copy the /etc/foundationdb/fdb.cluster file from this - server to all the other servers. Restart FoundationDB on all of these - other servers, so they join the cluster. + Copy the /etc/foundationdb/fdb.cluster file from this server to all the other servers. Restart FoundationDB on all of these other servers, so they join the cluster. - All of these servers are now connected and working together in the - cluster, under the chosen coordinator. + All of these servers are now connected and working together in the cluster, under the chosen coordinator. - At this point, you can add as many nodes as you want by just repeating the - above steps. By default there will still be a single coordinator: you can - use fdbcli to change this and add new coordinators. + At this point, you can add as many nodes as you want by just repeating the above steps. By default there will still be a single coordinator: you can use fdbcli to change this and add new coordinators. - As a convenience, FoundationDB can automatically assign coordinators based - on the redundancy mode you wish to achieve for the cluster. Once all the - nodes have been joined, simply set the replication policy, and then issue - the coordinators auto command + As a convenience, FoundationDB can automatically assign coordinators based on the redundancy mode you wish to achieve for the cluster. Once all the nodes have been joined, simply set the replication policy, and then issue the coordinators auto command - For example, assuming we have 3 nodes available, we can enable double - redundancy mode, then auto-select coordinators. For double redundancy, 3 - coordinators is ideal: therefore FoundationDB will make - every node a coordinator automatically: + For example, assuming we have 3 nodes available, we can enable double redundancy mode, then auto-select coordinators. For double redundancy, 3 coordinators is ideal: therefore FoundationDB will make every node a coordinator automatically: @@ -272,58 +209,33 @@ services.foundationdb.dataDir = "/data/fdb"; - This will transparently update all the servers within seconds, and - appropriately rewrite the fdb.cluster file, as well as - informing all client processes to do the same. + This will transparently update all the servers within seconds, and appropriately rewrite the fdb.cluster file, as well as informing all client processes to do the same.
Client connectivity - By default, all clients must use the current fdb.cluster - file to access a given FoundationDB cluster. This file is located by default - in /etc/foundationdb/fdb.cluster on all machines with the - FoundationDB service enabled, so you may copy the active one from your - cluster to a new node in order to connect, if it is not part of the cluster. + By default, all clients must use the current fdb.cluster file to access a given FoundationDB cluster. This file is located by default in /etc/foundationdb/fdb.cluster on all machines with the FoundationDB service enabled, so you may copy the active one from your cluster to a new node in order to connect, if it is not part of the cluster.
Client authorization and TLS - By default, any user who can connect to a FoundationDB process with the - correct cluster configuration can access anything. FoundationDB uses a - pluggable design to transport security, and out of the box it supports a - LibreSSL-based plugin for TLS support. This plugin not only does in-flight - encryption, but also performs client authorization based on the given - endpoint's certificate chain. For example, a FoundationDB server may be - configured to only accept client connections over TLS, where the client TLS - certificate is from organization Acme Co in the - Research and Development unit. + By default, any user who can connect to a FoundationDB process with the correct cluster configuration can access anything. FoundationDB uses a pluggable design to transport security, and out of the box it supports a LibreSSL-based plugin for TLS support. This plugin not only does in-flight encryption, but also performs client authorization based on the given endpoint's certificate chain. For example, a FoundationDB server may be configured to only accept client connections over TLS, where the client TLS certificate is from organization Acme Co in the Research and Development unit. - Configuring TLS with FoundationDB is done using the - options in order to control the - peer verification string, as well as the certificate and its private key. + Configuring TLS with FoundationDB is done using the options in order to control the peer verification string, as well as the certificate and its private key. - Note that the certificate and its private key must be accessible to the - FoundationDB user account that the server runs under. These files are also - NOT managed by NixOS, as putting them into the store may reveal private - information. + Note that the certificate and its private key must be accessible to the FoundationDB user account that the server runs under. These files are also NOT managed by NixOS, as putting them into the store may reveal private information. - After you have a key and certificate file in place, it is not enough to - simply set the NixOS module options -- you must also configure the - fdb.cluster file to specify that a given set of - coordinators use TLS. This is as simple as adding the suffix - :tls to your cluster coordinator configuration, after the - port number. For example, assuming you have a coordinator on localhost with - the default configuration, simply specifying: + After you have a key and certificate file in place, it is not enough to simply set the NixOS module options -- you must also configure the fdb.cluster file to specify that a given set of coordinators use TLS. This is as simple as adding the suffix :tls to your cluster coordinator configuration, after the port number. For example, assuming you have a coordinator on localhost with the default configuration, simply specifying: @@ -338,36 +250,19 @@ XXXXXX:XXXXXX@127.0.0.1:4500:tls Backups and Disaster Recovery - The usual rules for doing FoundationDB backups apply on NixOS as written in - the FoundationDB manual. However, one important difference is the security - profile for NixOS: by default, the foundationdb systemd - unit uses Linux namespaces to restrict write access to - the system, except for the log directory, data directory, and the - /etc/foundationdb/ directory. This is enforced by default - and cannot be disabled. + The usual rules for doing FoundationDB backups apply on NixOS as written in the FoundationDB manual. However, one important difference is the security profile for NixOS: by default, the foundationdb systemd unit uses Linux namespaces to restrict write access to the system, except for the log directory, data directory, and the /etc/foundationdb/ directory. This is enforced by default and cannot be disabled. - However, a side effect of this is that the fdbbackup - command doesn't work properly for local filesystem backups: FoundationDB - uses a server process alongside the database processes to perform backups - and copy the backups to the filesystem. As a result, this process is put - under the restricted namespaces above: the backup process can only write to - a limited number of paths. + However, a side effect of this is that the fdbbackup command doesn't work properly for local filesystem backups: FoundationDB uses a server process alongside the database processes to perform backups and copy the backups to the filesystem. As a result, this process is put under the restricted namespaces above: the backup process can only write to a limited number of paths. - In order to allow flexible backup locations on local disks, the FoundationDB - NixOS module supports a - option. This - option takes a list of paths, and adds them to the systemd unit, allowing - the processes inside the service to write (and read) the specified - directories. + In order to allow flexible backup locations on local disks, the FoundationDB NixOS module supports a option. This option takes a list of paths, and adds them to the systemd unit, allowing the processes inside the service to write (and read) the specified directories. - For example, to create backups in /opt/fdb-backups, first - set up the paths in the module options: + For example, to create backups in /opt/fdb-backups, first set up the paths in the module options: @@ -375,11 +270,7 @@ services.foundationdb.extraReadWritePaths = [ "/opt/fdb-backups" ]; - Restart the FoundationDB service, and it will now be able to write to this - directory (even if it does not yet exist.) Note: this path - must exist before restarting the unit. Otherwise, - systemd will not include it in the private FoundationDB namespace (and it - will not add it dynamically at runtime). + Restart the FoundationDB service, and it will now be able to write to this directory (even if it does not yet exist.) Note: this path must exist before restarting the unit. Otherwise, systemd will not include it in the private FoundationDB namespace (and it will not add it dynamically at runtime). @@ -395,17 +286,13 @@ services.foundationdb.extraReadWritePaths = [ "/opt/fdb-backups" ]; Known limitations - The FoundationDB setup for NixOS should currently be considered beta. - FoundationDB is not new software, but the NixOS compilation and integration - has only undergone fairly basic testing of all the available functionality. + The FoundationDB setup for NixOS should currently be considered beta. FoundationDB is not new software, but the NixOS compilation and integration has only undergone fairly basic testing of all the available functionality. - There is no way to specify individual parameters for individual - fdbserver processes. Currently, all server processes - inherit all the global fdbmonitor settings. + There is no way to specify individual parameters for individual fdbserver processes. Currently, all server processes inherit all the global fdbmonitor settings. @@ -424,20 +311,14 @@ services.foundationdb.extraReadWritePaths = [ "/opt/fdb-backups" ]; Options - NixOS's FoundationDB module allows you to configure all of the most relevant - configuration options for fdbmonitor, matching it quite - closely. A complete list of options for the FoundationDB module may be found - here. You should - also read the FoundationDB documentation as well. + NixOS's FoundationDB module allows you to configure all of the most relevant configuration options for fdbmonitor, matching it quite closely. A complete list of options for the FoundationDB module may be found here. You should also read the FoundationDB documentation as well.
Full documentation - FoundationDB is a complex piece of software, and requires careful - administration to properly use. Full documentation for administration can be - found here: . + FoundationDB is a complex piece of software, and requires careful administration to properly use. Full documentation for administration can be found here: .
diff --git a/nixos/modules/services/databases/postgresql.xml b/nixos/modules/services/databases/postgresql.xml index 72d4a8249a32..dc1bfb125a75 100644 --- a/nixos/modules/services/databases/postgresql.xml +++ b/nixos/modules/services/databases/postgresql.xml @@ -7,12 +7,10 @@ - Source: - modules/services/databases/postgresql.nix + Source: modules/services/databases/postgresql.nix - Upstream documentation: - + Upstream documentation: @@ -23,18 +21,12 @@ Configuring - To enable PostgreSQL, add the following to your - configuration.nix: + To enable PostgreSQL, add the following to your configuration.nix: = true; = pkgs.postgresql_11; - Note that you are required to specify the desired version of PostgreSQL - (e.g. pkgs.postgresql_11). Since upgrading your - PostgreSQL version requires a database dump and reload (see below), NixOS - cannot provide a default value for - such as the most recent - release of PostgreSQL. + Note that you are required to specify the desired version of PostgreSQL (e.g. pkgs.postgresql_11). Since upgrading your PostgreSQL version requires a database dump and reload (see below), NixOS cannot provide a default value for such as the most recent release of PostgreSQL. - By default, PostgreSQL stores its databases in - /var/lib/postgresql/$psqlSchema. You can override this using - , e.g. + By default, PostgreSQL stores its databases in /var/lib/postgresql/$psqlSchema. You can override this using , e.g. = "/data/postgresql"; @@ -70,18 +60,14 @@ Type "help" for help. Options - A complete list of options for the PostgreSQL module may be found - here. + A complete list of options for the PostgreSQL module may be found here.
Plugins - Plugins collection for each PostgreSQL version can be accessed with - .pkgs. For example, for - pkgs.postgresql_11 package, its plugin collection is - accessed by pkgs.postgresql_11.pkgs: + Plugins collection for each PostgreSQL version can be accessed with .pkgs. For example, for pkgs.postgresql_11 package, its plugin collection is accessed by pkgs.postgresql_11.pkgs: $ nix repl '<nixpkgs>' @@ -98,8 +84,9 @@ postgresql_11.pkgs.pg_partman postgresql_11.pkgs.pgroonga ... + - To add plugins via NixOS configuration, set services.postgresql.extraPlugins: + To add plugins via NixOS configuration, set services.postgresql.extraPlugins: = pkgs.postgresql_11; = with pkgs.postgresql_11.pkgs; [ @@ -108,10 +95,9 @@ postgresql_11.pkgs.pg_partman postgresql_11.pkgs.pgroonga ]; + - You can build custom PostgreSQL-with-plugins (to be used outside of NixOS) using - function .withPackages. For example, creating a custom - PostgreSQL package in an overlay can look like: + You can build custom PostgreSQL-with-plugins (to be used outside of NixOS) using function .withPackages. For example, creating a custom PostgreSQL package in an overlay can look like: self: super: { postgresql_custom = self.postgresql_11.withPackages (ps: [ @@ -121,8 +107,9 @@ self: super: { } + - Here's a recipe on how to override a particular plugin through an overlay: + Here's a recipe on how to override a particular plugin through an overlay: self: super: { postgresql_11 = super.postgresql_11.override { this = self.postgresql_11; } // { diff --git a/nixos/modules/services/desktops/flatpak.xml b/nixos/modules/services/desktops/flatpak.xml index 8f080b250228..3b2ccd12cf59 100644 --- a/nixos/modules/services/desktops/flatpak.xml +++ b/nixos/modules/services/desktops/flatpak.xml @@ -5,44 +5,33 @@ xml:id="module-services-flatpak"> Flatpak - Source: - modules/services/desktop/flatpak.nix + Source: modules/services/desktop/flatpak.nix - Upstream documentation: - + Upstream documentation: - Flatpak is a system for building, distributing, and running sandboxed desktop - applications on Linux. + Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux. - To enable Flatpak, add the following to your - configuration.nix: + To enable Flatpak, add the following to your configuration.nix: = true; - For the sandboxed apps to work correctly, desktop integration portals need to - be installed. If you run GNOME, this will be handled automatically for you; - in other cases, you will need to add something like the following to your - configuration.nix: + For the sandboxed apps to work correctly, desktop integration portals need to be installed. If you run GNOME, this will be handled automatically for you; in other cases, you will need to add something like the following to your configuration.nix: = [ pkgs.xdg-desktop-portal-gtk ]; - Then, you will need to add a repository, for example, - Flathub, - either using the following commands: + Then, you will need to add a repository, for example, Flathub, either using the following commands: $ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo $ flatpak update - or by opening the - repository - file in GNOME Software. + or by opening the repository file in GNOME Software. Finally, you can search and install programs: diff --git a/nixos/modules/services/editors/emacs.xml b/nixos/modules/services/editors/emacs.xml index 03483f69fa2f..0213b8971c25 100644 --- a/nixos/modules/services/editors/emacs.xml +++ b/nixos/modules/services/editors/emacs.xml @@ -12,41 +12,26 @@ Adam Hoese @adisbladis --> - Emacs is an - extensible, customizable, self-documenting real-time display editor — and - more. At its core is an interpreter for Emacs Lisp, a dialect of the Lisp - programming language with extensions to support text editing. + Emacs is an extensible, customizable, self-documenting real-time display editor — and more. At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming language with extensions to support text editing. - Emacs runs within a graphical desktop environment using the X Window System, - but works equally well on a text terminal. Under - macOS, a "Mac port" edition is available, which - uses Apple's native GUI frameworks. + Emacs runs within a graphical desktop environment using the X Window System, but works equally well on a text terminal. Under macOS, a "Mac port" edition is available, which uses Apple's native GUI frameworks. - Nixpkgs provides a superior environment for - running Emacs. It's simple to create custom builds - by overriding the default packages. Chaotic collections of Emacs Lisp code - and extensions can be brought under control using declarative package - management. NixOS even provides a - systemd user service for automatically starting the Emacs - daemon. + Nixpkgs provides a superior environment for running Emacs. It's simple to create custom builds by overriding the default packages. Chaotic collections of Emacs Lisp code and extensions can be brought under control using declarative package management. NixOS even provides a systemd user service for automatically starting the Emacs daemon.
Installing <application>Emacs</application> - Emacs can be installed in the normal way for Nix (see - ). In addition, a NixOS - service can be enabled. + Emacs can be installed in the normal way for Nix (see ). In addition, a NixOS service can be enabled.
The Different Releases of Emacs - Nixpkgs defines several basic Emacs packages. - The following are attributes belonging to the pkgs set: + Nixpkgs defines several basic Emacs packages. The following are attributes belonging to the pkgs set: @@ -57,10 +42,8 @@ - The latest stable version of Emacs 25 using the - GTK 2 - widget toolkit. + The latest stable version of Emacs 25 using the GTK 2 widget toolkit. @@ -83,8 +66,7 @@ - Emacs 25 with the "Mac port" patches, providing a more native look and - feel under macOS. + Emacs 25 with the "Mac port" patches, providing a more native look and feel under macOS. @@ -92,12 +74,7 @@ - If those aren't suitable, then the following imitation Emacs editors are - also available in Nixpkgs: - Zile, - mg, - Yi, - jmacs. + If those aren't suitable, then the following imitation Emacs editors are also available in Nixpkgs: Zile, mg, Yi, jmacs.
@@ -105,36 +82,20 @@ Adding Packages to Emacs - Emacs includes an entire ecosystem of functionality beyond text editing, - including a project planner, mail and news reader, debugger interface, - calendar, and more. + Emacs includes an entire ecosystem of functionality beyond text editing, including a project planner, mail and news reader, debugger interface, calendar, and more. - Most extensions are gotten with the Emacs packaging system - (package.el) from - Emacs Lisp Package Archive - (ELPA), - MELPA, - MELPA Stable, and - Org ELPA. Nixpkgs is - regularly updated to mirror all these archives. + Most extensions are gotten with the Emacs packaging system (package.el) from Emacs Lisp Package Archive (ELPA), MELPA, MELPA Stable, and Org ELPA. Nixpkgs is regularly updated to mirror all these archives. - Under NixOS, you can continue to use - package-list-packages and - package-install to install packages. You can also - declare the set of Emacs packages you need using the derivations from - Nixpkgs. The rest of this section discusses declarative installation of - Emacs packages through nixpkgs. + Under NixOS, you can continue to use package-list-packages and package-install to install packages. You can also declare the set of Emacs packages you need using the derivations from Nixpkgs. The rest of this section discusses declarative installation of Emacs packages through nixpkgs. - The first step to declare the list of packages you want in your Emacs - installation is to create a dedicated derivation. This can be done in a - dedicated emacs.nix file such as: + The first step to declare the list of packages you want in your Emacs installation is to create a dedicated derivation. This can be done in a dedicated emacs.nix file such as: Nix expression to build Emacs with packages (<filename>emacs.nix</filename>) @@ -176,36 +137,27 @@ in - The first non-comment line in this file ({ pkgs ? ... - }) indicates that the whole file represents a function. + The first non-comment line in this file ({ pkgs ? ... }) indicates that the whole file represents a function. - The let expression below defines a - myEmacs binding pointing to the current stable - version of Emacs. This binding is here to separate the choice of the - Emacs binary from the specification of the required packages. + The let expression below defines a myEmacs binding pointing to the current stable version of Emacs. This binding is here to separate the choice of the Emacs binary from the specification of the required packages. - This generates an emacsWithPackages function. It - takes a single argument: a function from a package set to a list of - packages (the packages that will be available in Emacs). + This generates an emacsWithPackages function. It takes a single argument: a function from a package set to a list of packages (the packages that will be available in Emacs). - The rest of the file specifies the list of packages to install. In the - example, two packages (magit and - zerodark-theme) are taken from MELPA stable. + The rest of the file specifies the list of packages to install. In the example, two packages (magit and zerodark-theme) are taken from MELPA stable. - Two packages (undo-tree and - zoom-frm) are taken from MELPA. + Two packages (undo-tree and zoom-frm) are taken from MELPA. @@ -215,17 +167,14 @@ in - notmuch is taken from a nixpkgs derivation which - contains an Emacs mode. + notmuch is taken from a nixpkgs derivation which contains an Emacs mode. - The result of this configuration will be an emacs - command which launches Emacs with all of your chosen packages in the - load-path. + The result of this configuration will be an emacs command which launches Emacs with all of your chosen packages in the load-path. @@ -234,23 +183,17 @@ in $ nix-build emacs.nix $ ./result/bin/emacs -q - and then typing M-x package-initialize. Check that you - can use all the packages you want in this Emacs instance. For example, try - switching to the zerodark theme through M-x load-theme <RET> - zerodark <RET> y. + and then typing M-x package-initialize. Check that you can use all the packages you want in this Emacs instance. For example, try switching to the zerodark theme through M-x load-theme <RET> zerodark <RET> y. - A few popular extensions worth checking out are: auctex, company, - edit-server, flycheck, helm, iedit, magit, multiple-cursors, projectile, - and yasnippet. + A few popular extensions worth checking out are: auctex, company, edit-server, flycheck, helm, iedit, magit, multiple-cursors, projectile, and yasnippet. - The list of available packages in the various ELPA repositories can be seen - with the following commands: + The list of available packages in the various ELPA repositories can be seen with the following commands: Querying Emacs packages " -qaP -A emacsPackages.orgPackages - If you are on NixOS, you can install this particular Emacs for all users by - adding it to the list of system packages (see - ). Simply modify your file - configuration.nix to make it contain: + If you are on NixOS, you can install this particular Emacs for all users by adding it to the list of system packages (see ). Simply modify your file configuration.nix to make it contain: Custom Emacs in <filename>configuration.nix</filename> " -qaP -A emacsPackages.orgPackages - In this case, the next nixos-rebuild switch will take - care of adding your emacs to the PATH - environment variable (see ). + In this case, the next nixos-rebuild switch will take care of adding your emacs to the PATH environment variable (see ). - If you are not on NixOS or want to install this particular Emacs only for - yourself, you can do so by adding it to your - ~/.config/nixpkgs/config.nix (see - Nixpkgs - manual): + If you are not on NixOS or want to install this particular Emacs only for yourself, you can do so by adding it to your ~/.config/nixpkgs/config.nix (see Nixpkgs manual): Custom Emacs in <filename>~/.config/nixpkgs/config.nix</filename> - In this case, the next nix-env -f '<nixpkgs>' -iA - myemacs will take care of adding your emacs to the - PATH environment variable. + In this case, the next nix-env -f '<nixpkgs>' -iA myemacs will take care of adding your emacs to the PATH environment variable.
@@ -319,12 +251,7 @@ https://nixos.org/nixpkgs/manual/#sec-modify-via-packageOverrides Advanced Emacs Configuration - If you want, you can tweak the Emacs package itself from your - emacs.nix. For example, if you want to have a - GTK 3-based Emacs instead of the default GTK 2-based binary and remove the - automatically generated emacs.desktop (useful is you - only use emacsclient), you can change your file - emacs.nix in this way: + If you want, you can tweak the Emacs package itself from your emacs.nix. For example, if you want to have a GTK 3-based Emacs instead of the default GTK 2-based binary and remove the automatically generated emacs.desktop (useful is you only use emacsclient), you can change your file emacs.nix in this way: @@ -348,8 +275,7 @@ in [...] - After building this file as shown in , you - will get an GTK 3-based Emacs binary pre-loaded with your favorite packages. + After building this file as shown in , you will get an GTK 3-based Emacs binary pre-loaded with your favorite packages.
@@ -357,23 +283,18 @@ in [...] Running Emacs as a Service - NixOS provides an optional - systemd service which launches - - Emacs daemon with the user's login session. + NixOS provides an optional systemd service which launches Emacs daemon with the user's login session. - Source: - modules/services/editors/emacs.nix + Source: modules/services/editors/emacs.nix
Enabling the Service - To install and enable the systemd user service for Emacs - daemon, add the following to your configuration.nix: + To install and enable the systemd user service for Emacs daemon, add the following to your configuration.nix: = true; = import /home/cassou/.emacs.d { pkgs = pkgs; }; @@ -381,16 +302,11 @@ in [...] - The services.emacs.package option allows a custom - derivation to be used, for example, one created by - emacsWithPackages. + The services.emacs.package option allows a custom derivation to be used, for example, one created by emacsWithPackages. - Ensure that the Emacs server is enabled for your user's Emacs - configuration, either by customizing the server-mode - variable, or by adding (server-start) to - ~/.emacs.d/init.el. + Ensure that the Emacs server is enabled for your user's Emacs configuration, either by customizing the server-mode variable, or by adding (server-start) to ~/.emacs.d/init.el. @@ -408,9 +324,7 @@ in [...] Starting the client - Ensure that the emacs server is enabled, either by customizing the - server-mode variable, or by adding - (server-start) to ~/.emacs. + Ensure that the emacs server is enabled, either by customizing the server-mode variable, or by adding (server-start) to ~/.emacs. @@ -429,23 +343,15 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal - If is - true, the EDITOR variable will be set - to a wrapper script which launches emacsclient. + If is true, the EDITOR variable will be set to a wrapper script which launches emacsclient. - Any setting of EDITOR in the shell config files will - override services.emacs.defaultEditor. To make sure - EDITOR refers to the Emacs wrapper script, remove any - existing EDITOR assignment from - .profile, .bashrc, - .zshenv or any other shell config file. + Any setting of EDITOR in the shell config files will override services.emacs.defaultEditor. To make sure EDITOR refers to the Emacs wrapper script, remove any existing EDITOR assignment from .profile, .bashrc, .zshenv or any other shell config file. - If you have formed certain bad habits when editing files, these can be - corrected with a shell alias to the wrapper script: + If you have formed certain bad habits when editing files, these can be corrected with a shell alias to the wrapper script: alias vi=$EDITOR
@@ -454,10 +360,7 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal Per-User Enabling of the Service - In general, systemd user services are globally enabled - by symlinks in /etc/systemd/user. In the case where - Emacs daemon is not wanted for all users, it is possible to install the - service but not globally enable it: + In general, systemd user services are globally enabled by symlinks in /etc/systemd/user. In the case where Emacs daemon is not wanted for all users, it is possible to install the service but not globally enable it: = false; = true; @@ -465,11 +368,9 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal - To enable the systemd user service for just the - currently logged in user, run: + To enable the systemd user service for just the currently logged in user, run: systemctl --user enable emacs - This will add the symlink - ~/.config/systemd/user/emacs.service. + This will add the symlink ~/.config/systemd/user/emacs.service.
@@ -477,8 +378,7 @@ emacsclient --create-frame --tty # opens a new frame on the current terminal Configuring Emacs - The Emacs init file should be changed to load the extension packages at - startup: + The Emacs init file should be changed to load the extension packages at startup: Package initialization in <filename>.emacs</filename> - After the declarative emacs package configuration has been tested, - previously downloaded packages can be cleaned up by removing - ~/.emacs.d/elpa (do make a backup first, in case you - forgot a package). + After the declarative emacs package configuration has been tested, previously downloaded packages can be cleaned up by removing ~/.emacs.d/elpa (do make a backup first, in case you forgot a package).
Possible dependency types