From e279767d6927d2077255db3bf39c40030ba3791e Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 6 Jan 2019 15:40:11 +0100 Subject: doc: don't overwrite makeFlagsArray in the example Arrays like these should be appended to instead of overwritten in almost every case to avoid loosing the existing flags. --- doc/stdenv.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 564471bbbbc..ac0d84b90f9 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -1279,7 +1279,9 @@ makeFlags = [ "PREFIX=$(out)" ]; make. You must use this instead of makeFlags if the arguments contain spaces, e.g. -makeFlagsArray=(CFLAGS="-O0 -g" LDFLAGS="-lfoo -lbar") +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 -- cgit 1.4.1 From eac6797380af1f0927ab683e2375429826d34e76 Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Mon, 31 Dec 2018 08:10:28 +0100 Subject: prefer-fetch-remote: an overlay to fetch on remote builders This is useful when running tools like NixOps or nix-review on workstations where the upload to the builder is significantly slower then downloading the source on the builder itself. --- doc/functions.xml | 1 + doc/functions/prefer-remote-fetch.xml | 27 ++++++++++++++++++++++ pkgs/build-support/fetchgit/default.nix | 3 ++- pkgs/build-support/fetchhg/default.nix | 11 +++++++-- pkgs/build-support/fetchipfs/default.nix | 8 +++---- pkgs/build-support/fetchsvn/default.nix | 7 +++--- pkgs/build-support/fetchurl/default.nix | 7 +++--- pkgs/build-support/prefer-remote-fetch/default.nix | 19 +++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 9 files changed, 72 insertions(+), 13 deletions(-) create mode 100644 doc/functions/prefer-remote-fetch.xml create mode 100644 pkgs/build-support/prefer-remote-fetch/default.nix (limited to 'doc') diff --git a/doc/functions.xml b/doc/functions.xml index 4193bb49f77..e6d59ebde97 100644 --- a/doc/functions.xml +++ b/doc/functions.xml @@ -14,4 +14,5 @@ + diff --git a/doc/functions/prefer-remote-fetch.xml b/doc/functions/prefer-remote-fetch.xml new file mode 100644 index 00000000000..85f08f4eae1 --- /dev/null +++ b/doc/functions/prefer-remote-fetch.xml @@ -0,0 +1,27 @@ +
+ 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: + + 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 + + + $ mkdir ~/.config/nixpkgs/overlays/ + $ cat > ~/.config/nixpkgs/overlays/prefer-remote-fetch.nix <<EOF + self: super: super.prefer-remote-fetch self super + EOF + + +
diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index 9fccc27ef63..256c86748d2 100644 --- a/pkgs/build-support/fetchgit/default.nix +++ b/pkgs/build-support/fetchgit/default.nix @@ -19,6 +19,7 @@ in , # Shell code executed after the file has been fetched # successfully. This can do things like check or transform the file. postFetch ? "" +, preferLocalBuild ? true }: /* NOTE: @@ -66,5 +67,5 @@ stdenvNoCC.mkDerivation { "GIT_PROXY_COMMAND" "SOCKS_SERVER" ]; - preferLocalBuild = true; + inherit preferLocalBuild; } diff --git a/pkgs/build-support/fetchhg/default.nix b/pkgs/build-support/fetchhg/default.nix index 40ead021cdb..41eff1f9c0c 100644 --- a/pkgs/build-support/fetchhg/default.nix +++ b/pkgs/build-support/fetchhg/default.nix @@ -1,4 +1,11 @@ -{stdenvNoCC, mercurial}: {name ? null, url, rev ? null, md5 ? null, sha256 ? null, fetchSubrepos ? false}: +{ stdenvNoCC, mercurial }: +{ name ? null +, url +, rev ? null +, md5 ? null +, sha256 ? null +, fetchSubrepos ? false +, preferLocalBuild ? true }: if md5 != null then throw "fetchhg does not support md5 anymore, please use sha256" @@ -18,5 +25,5 @@ stdenvNoCC.mkDerivation { outputHash = sha256; inherit url rev; - preferLocalBuild = true; + inherit preferLocalBuild; } diff --git a/pkgs/build-support/fetchipfs/default.nix b/pkgs/build-support/fetchipfs/default.nix index dc894979422..7a66999ec56 100644 --- a/pkgs/build-support/fetchipfs/default.nix +++ b/pkgs/build-support/fetchipfs/default.nix @@ -14,6 +14,7 @@ , meta ? {} , port ? "8080" , postFetch ? "" +, preferLocalBuild ? true }: assert sha512 != "" -> builtins.compareVersions "1.11" builtins.nixVersion <= 0; @@ -42,11 +43,10 @@ if (!hasHash) then throw "Specify sha for fetchipfs fixed-output derivation" els postFetch ipfs url - port; + port + meta; # Doing the download on a remote machine just duplicates network # traffic, so don't do that. - preferLocalBuild = true; - - inherit meta; + inherit preferLocalBuild; } diff --git a/pkgs/build-support/fetchsvn/default.nix b/pkgs/build-support/fetchsvn/default.nix index da57d581dad..194ce3b39b1 100644 --- a/pkgs/build-support/fetchsvn/default.nix +++ b/pkgs/build-support/fetchsvn/default.nix @@ -1,6 +1,7 @@ {stdenvNoCC, subversion, glibcLocales, sshSupport ? false, openssh ? null}: -{url, rev ? "HEAD", md5 ? "", sha256 ? "", - ignoreExternals ? false, ignoreKeywords ? false, name ? null}: +{url, rev ? "HEAD", md5 ? "", sha256 ? "" +, ignoreExternals ? false, ignoreKeywords ? false, name ? null +, preferLocalBuild ? true }: let repoName = with stdenvNoCC.lib; @@ -40,5 +41,5 @@ stdenvNoCC.mkDerivation { inherit url rev sshSupport openssh ignoreExternals ignoreKeywords; impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars; - preferLocalBuild = true; + inherit preferLocalBuild; } diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index 5f0c1384c79..3ce90cbeab3 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -87,6 +87,9 @@ in # Passthru information, if any. , passthru ? {} + # Doing the download on a remote machine just duplicates network + # traffic, so don't do that by default +, preferLocalBuild ? true }: assert sha512 != "" -> builtins.compareVersions "1.11" builtins.nixVersion <= 0; @@ -135,9 +138,7 @@ stdenvNoCC.mkDerivation { nixpkgsVersion = lib.trivial.release; - # Doing the download on a remote machine just duplicates network - # traffic, so don't do that. - preferLocalBuild = true; + inherit preferLocalBuild; postHook = if netrcPhase == null then null else '' ${netrcPhase} diff --git a/pkgs/build-support/prefer-remote-fetch/default.nix b/pkgs/build-support/prefer-remote-fetch/default.nix new file mode 100644 index 00000000000..2e55e370742 --- /dev/null +++ b/pkgs/build-support/prefer-remote-fetch/default.nix @@ -0,0 +1,19 @@ +# 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. +# Usage: Put the following snippet in your usual overlay definition: +# +# self: super: +# (super.prefer-remote-fetch self super) +# Full configuration example for your own account: +# +# $ mkdir ~/.config/nixpkgs/overlays/ +# $ echo 'self: super: super.prefer-remote-fetch self super' > ~/.config/nixpkgs/overlays/prefer-remote-fetch.nix +# +self: super: { + fetchurl = args: super.fetchurl (args // { preferLocalBuild = false; }); + fetchgit = args: super.fetchgit (args // { preferLocalBuild = false; }); + fetchhg = args: super.fetchhg (args // { preferLocalBuild = false; }); + fetchsvn = args: super.fetchsvn (args // { preferLocalBuild = false; }); + fetchipfs = args: super.fetchipfs (args // { preferLocalBuild = false; }); +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 524741a0da0..a61bd840167 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -207,6 +207,8 @@ in fetchMavenArtifact = callPackage ../build-support/fetchmavenartifact { }; + prefer-remote-fetch = import ../build-support/prefer-remote-fetch; + global-platform-pro = callPackage ../development/tools/global-platform-pro/default.nix { }; graph-easy = callPackage ../tools/graphics/graph-easy { }; -- cgit 1.4.1 From 17ec7f3a16a473e3ff3de6328c98cb36db6b112e Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 26 Jan 2019 21:42:16 -0500 Subject: nixpkgs/manual: document fetcher functions Fixes #32439. --- doc/functions.xml | 1 + doc/functions/fetchers.xml | 198 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 199 insertions(+) create mode 100644 doc/functions/fetchers.xml (limited to 'doc') diff --git a/doc/functions.xml b/doc/functions.xml index e6d59ebde97..0dc32bbc5bd 100644 --- a/doc/functions.xml +++ b/doc/functions.xml @@ -11,6 +11,7 @@ + diff --git a/doc/functions/fetchers.xml b/doc/functions/fetchers.xml new file mode 100644 index 00000000000..96937ca7182 --- /dev/null +++ b/doc/functions/fetchers.xml @@ -0,0 +1,198 @@ +
+ Fetcher functions + + + When using Nix, you will frequently need to download source code + and other file from the internet. Nixpkgs comes with a few helper + functions that allow you to fetch fixed-output derivations in + 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 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. + + + + 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. + + + + + + fetchsvn + + + + Used with Subversion. Expects url to a + Subversion directory, rev, and + sha256. + + + + + + fetchgit + + + + Used with Git. Expects url to a Git repo, + rev, and sha256. + + + + + + fetchfossil + + + + Used with Fossil. Expects url to a Fossil + archive, rev, and sha256. + + + + + + fetchcvs + + + + Used with CVS. Expects cvsRoot, + tag, and sha256. + + + + + + fetchhg + + + + 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. + + + + + + fetchFromGitHub + + + + 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 that will be downloaded from Git. Finally, + sha256. Again, other hash algorithms are + also available but sha256 is currently + preferred. + + + + + + fetchFromGitLab + + + + This is used with GitLab repositories. The arguments expected + are very similar to fetchFromGitHub above. + + + + + + fetchFromBitbucket + + + + This is used with BitBucket repositories. The arguments expected + are very similar to fetchFromGitHub above. + + + + + + fetchFromSavannah + + + + This is used with Savannah repositories. The arguments expected + are very similar to fetchFromGitHub above. + + + + + + fetchFromRepoOrCz + + + + This is used with repo.or.cz repositories. The arguments + expected are very similar to fetchFromGitHub above. + + + + + + +
-- cgit 1.4.1 From adb717a153e9fda88d9bf9ac183d64fdf4887c40 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 26 Jan 2019 22:20:23 -0500 Subject: nixpkgs/manual: document default setup hooks Fixes #34857. --- doc/stdenv.xml | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 131 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/stdenv.xml b/doc/stdenv.xml index ac0d84b90f9..21667252ad0 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -2192,10 +2192,128 @@ addEnvHooks "$hostOffset" myBashFunction - Here are some packages that provide a setup hook. Since the mechanism is - modular, this probably isn't an exhaustive list. Then again, since the - mechanism is only to be used as a last resort, it might be. - + 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. + + + + move-docs.sh + + + + 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 use the share subdirectory. + + + + + + compress-man-pages.sh + + + + This setup hook compresses any man pages that have been + installed. The compression is done using the gzip program. This + helps to reduce installed size of packages. + + + + + + strip.sh + + + + This runs the strip command on installed binaries and + libraries. This removed things like debug symbols when they are + not needed. This also helps to reduce installed size of + packages. + + + + + + patch-shebangs.sh + + + + 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 + what to use to run this script. In Nix, we want an exact path + to that interpreter to be used. This often replcaes + /bin/sh with a path in the Nix store. + + + + + + audit-tmpdir.sh + + + + 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 currently Linux only. + + + + + + multiple-outputs.sh + + + + 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. + + + + + + move-sbin.sh + + + + 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. + + + + + + move-lib64.sh + + + + 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. + + + + + + set-source-date-epoch-to-latest.sh + + + + This sets SOURCE_DATE_EPOCH to the + modification time of the most recent file. + + + Bintools Wrapper @@ -2302,6 +2420,15 @@ addEnvHooks "$hostOffset" myBashFunction + + + + + Here are some more packages that provide a setup hook. Since the + mechanism is modular, this probably isn't an exhaustive list. Then + again, since the mechanism is only to be used as a last resort, it + might be. + Perl -- cgit 1.4.1 From 498a242bf4b4ad8aaf5624bd19602b7676766af8 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 26 Jan 2019 22:34:06 -0500 Subject: nixpkgs/manual: add trivial builders section Fixes #25507. --- doc/functions.xml | 1 + doc/functions/trivial-builders.xml | 84 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 doc/functions/trivial-builders.xml (limited to 'doc') diff --git a/doc/functions.xml b/doc/functions.xml index 0dc32bbc5bd..0d6e2770e6e 100644 --- a/doc/functions.xml +++ b/doc/functions.xml @@ -12,6 +12,7 @@ + diff --git a/doc/functions/trivial-builders.xml b/doc/functions/trivial-builders.xml new file mode 100644 index 00000000000..4fbe8883610 --- /dev/null +++ b/doc/functions/trivial-builders.xml @@ -0,0 +1,84 @@ +
+ Trivial builders + + + There are a couple of functions provide in Nixpkgs that help with + building derivations. The most important one, + stdenv.mkDerivation, has already been + documented above. These wrap + stdenv.mkDerivation, making it easier to use + in certain cases. + + + + + + runCommand + + + + This takes three arguments, name, + env, and buildCommand. + name is just the name that Nix will use to + refer to the derivation. env is an attribute + set specifying environment variables that will be set for this + derivation. 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. + + + + + + runCommandCC + + + + This works just like runCommand. The only + difference is that it also provides a C compiler for your use. + 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. + + + + + + writeTextFile + + + + This writes text to the Nix store. This is + useful for creating scripts from Nix expressions. This 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. + + + + + + symlinkJoin + + + + 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 directory. + + + + + +
-- cgit 1.4.1 From d7b62cb601b48d0dd8a70fdc4b5169d9492e4ce2 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 27 Jan 2019 11:57:36 -0500 Subject: nixpkgs/manual: address review comments Mostly taken from requested changes exactly as recommended. --- doc/functions/fetchers.xml | 20 ++++++--- doc/functions/trivial-builders.xml | 83 ++++++++++++++++++++++++++++---------- doc/stdenv.xml | 28 +++++++------ 3 files changed, 90 insertions(+), 41 deletions(-) (limited to 'doc') diff --git a/doc/functions/fetchers.xml b/doc/functions/fetchers.xml index 96937ca7182..b3bd2fe0f45 100644 --- a/doc/functions/fetchers.xml +++ b/doc/functions/fetchers.xml @@ -6,8 +6,8 @@ When using Nix, you will frequently need to download source code - and other file from the internet. Nixpkgs comes with a few helper - functions that allow you to fetch fixed-output derivations in + 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. @@ -48,7 +48,11 @@ stdenv.mkDerivation { fetchpatch works very similarly to - fetchurl with the same arguments expected. + 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. @@ -80,6 +84,9 @@ 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.
@@ -141,9 +148,10 @@ stdenv.mkDerivation { GitHub HTML page as owner/repo. rev corresponds to the Git commit hash or - tag that will be downloaded from Git. Finally, - sha256. Again, other hash algorithms are - also available but sha256 is currently + 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.
diff --git a/doc/functions/trivial-builders.xml b/doc/functions/trivial-builders.xml index 4fbe8883610..c5972d3ea90 100644 --- a/doc/functions/trivial-builders.xml +++ b/doc/functions/trivial-builders.xml @@ -5,10 +5,10 @@ Trivial builders - There are a couple of functions provide in Nixpkgs that help with - building derivations. The most important one, + Nixpkgs provides a couple of functions that help with building + derivations. The most important one, stdenv.mkDerivation, has already been - documented above. These wrap + documented above. The following functions wrap stdenv.mkDerivation, making it easier to use in certain cases. @@ -22,14 +22,42 @@ This takes three arguments, name, env, and buildCommand. - name is just the name that Nix will use to - refer to the derivation. env is an attribute - set specifying environment variables that will be set for this - derivation. 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. - + 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. + + + (import <nixpkgs> {}).runCommand "my-example" {} '' + echo My example command is running + + mkdir $out + + echo I can write data to the Nix store > $out/message + + echo I can also run basic commands like: + + echo ls + ls + + echo whoami + whoami + + echo date + date + '' + @@ -47,19 +75,30 @@ - writeTextFile + writeTextFile, writeText, + writeTextDir, writeScript, + writeScriptBin - This writes text to the Nix store. This is - useful for creating scripts from Nix expressions. This 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. + @@ -75,7 +114,7 @@ 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 directory. + derivations or any other subdirectory contained within. diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 21667252ad0..3a51907eb8a 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -2207,7 +2207,8 @@ 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 use the share subdirectory. + programs that do not know how to use the + share subdirectory. @@ -2219,7 +2220,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 installed size of packages. + helps to reduce the installed size of packages. @@ -2230,9 +2231,9 @@ addEnvHooks "$hostOffset" myBashFunction This runs the strip command on installed binaries and - libraries. This removed things like debug symbols when they are - not needed. This also helps to reduce installed size of - packages. + libraries. This removes unnecessary information like debug + symbols when they are not needed. This also helps to reduce the + installed size of packages. @@ -2244,10 +2245,11 @@ 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 - what to use to run this script. In Nix, we want an exact path - to that interpreter to be used. This often replcaes - /bin/sh with a path in the Nix store. + 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. @@ -2260,7 +2262,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 currently Linux only. + store. This is currently supported in Linux only. @@ -2425,9 +2427,9 @@ addEnvHooks "$hostOffset" myBashFunction Here are some more packages that provide a setup hook. Since the - mechanism is modular, this probably isn't an exhaustive list. Then - again, since the mechanism is only to be used as a last resort, it - might be. + 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. -- cgit 1.4.1 From a376d624410b91fed47a17b7b4db39278a9ddb6b Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 27 Jan 2019 12:01:23 -0500 Subject: nixpkgs/manual: add one more fix for a missed review --- doc/functions/trivial-builders.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/functions/trivial-builders.xml b/doc/functions/trivial-builders.xml index c5972d3ea90..92a07aedb5b 100644 --- a/doc/functions/trivial-builders.xml +++ b/doc/functions/trivial-builders.xml @@ -67,9 +67,10 @@ This works just like runCommand. The only - difference is that it also provides a C compiler for your use. - 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. + 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. -- cgit 1.4.1 From 9e7625983b29be725504515d4a8f5265c6772fc8 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves <2335822+alexfmpe@users.noreply.github.com> Date: Wed, 30 Jan 2019 16:37:43 +0000 Subject: Fix typos in docker tools docs --- doc/functions/dockertools.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/functions/dockertools.xml b/doc/functions/dockertools.xml index 501f46a967c..ff446cbfffd 100644 --- a/doc/functions/dockertools.xml +++ b/doc/functions/dockertools.xml @@ -24,7 +24,7 @@ This function is analogous to the docker build command, - in that can used to build a Docker-compatible repository tarball containing + 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. @@ -190,11 +190,11 @@ buildImage { 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 list images, the newly created images will be + docker images, the newly created images will be listed like this: @@ -217,7 +217,7 @@ pkgs.dockerTools.buildImage { and now the Docker CLI will display a reasonable date and sort the images as expected: @@ -402,7 +402,7 @@ pkgs.dockerTools.buildLayeredImage { This function is analogous to the docker pull command, in - that can be used to pull a Docker image from a Docker registry. By default + that it can be used to pull a Docker image from a Docker registry. By default Docker Hub is used to pull images. @@ -484,7 +484,7 @@ sha256:20d9485b25ecfd89204e843a962c1bd70e9cc6858d65d7f5fadc340246e2116b This function is analogous to the docker export command, - in that can used to flatten a Docker image that contains multiple layers. It + 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. @@ -557,7 +557,7 @@ buildImage { Creating base files like /etc/passwd or - /etc/login.defs are necessary for shadow-utils to + /etc/login.defs is necessary for shadow-utils to manipulate users and groups. -- cgit 1.4.1