summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-02-01 16:52:32 +0100
committerRobert Hensing <robert@roberthensing.nl>2022-02-01 16:58:52 +0100
commit0838f79f0b5fd3e9c8067e9debce3ce38c635190 (patch)
treef571ee43e115317cfe6a9f7739a963d405ca5720 /doc
parentb08ee51cc7dc57e104698e446a45bbb8e962fe07 (diff)
downloadnixpkgs-0838f79f0b5fd3e9c8067e9debce3ce38c635190.tar
nixpkgs-0838f79f0b5fd3e9c8067e9debce3ce38c635190.tar.gz
nixpkgs-0838f79f0b5fd3e9c8067e9debce3ce38c635190.tar.bz2
nixpkgs-0838f79f0b5fd3e9c8067e9debce3ce38c635190.tar.lz
nixpkgs-0838f79f0b5fd3e9c8067e9debce3ce38c635190.tar.xz
nixpkgs-0838f79f0b5fd3e9c8067e9debce3ce38c635190.tar.zst
nixpkgs-0838f79f0b5fd3e9c8067e9debce3ce38c635190.zip
stdenv.md: Document genericBuild
Diffstat (limited to 'doc')
-rw-r--r--doc/stdenv/stdenv.chapter.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/stdenv/stdenv.chapter.md b/doc/stdenv/stdenv.chapter.md
index 9c78539945f..5e224891875 100644
--- a/doc/stdenv/stdenv.chapter.md
+++ b/doc/stdenv/stdenv.chapter.md
@@ -319,10 +319,14 @@ For information about how to run the updates, execute `nix-shell maintainers/scr
 
 ## Phases {#sec-stdenv-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).
+`stdenv.mkDerivation` sets the Nix [derivation](https://nixos.org/manual/nix/stable/expressions/derivations.html#derivations)'s builder to a script that loads the stdenv `setup.sh` bash library and calls `genericBuild`. Most packaging functions rely on this default builder.
+
+This generic command invokes 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).
 
 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`.
 
+If you want to run all phases in `nix-shell`, you can invoke `genericBuild` yourself in the interactive shell.
+
 ### Controlling phases {#ssec-controlling-phases}
 
 There are a number of variables that control what phases are executed and in what order: