summary refs log tree commit diff
path: root/doc/stdenv/stdenv.chapter.md
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2022-12-08 21:50:32 +0200
committerArtturin <Artturin@artturin.com>2022-12-10 04:22:11 +0200
commitfda61e9066f545fca1eb440d249131edac040c30 (patch)
tree4dbb83e922ea4d34d57d9b36414fb45245b82a09 /doc/stdenv/stdenv.chapter.md
parent89dc806f131ae9318d47d43befbe9a3ef7f7a765 (diff)
add docs for prependToVar and appendToVar
Diffstat (limited to 'doc/stdenv/stdenv.chapter.md')
-rw-r--r--doc/stdenv/stdenv.chapter.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/stdenv/stdenv.chapter.md b/doc/stdenv/stdenv.chapter.md
index e3d874ef507e5..78560a29a3377 100644
--- a/doc/stdenv/stdenv.chapter.md
+++ b/doc/stdenv/stdenv.chapter.md
@@ -990,6 +990,32 @@ Convenience function for `makeWrapper` that replaces `<\executable\>` with a wra
 
 If you will apply it multiple times, it will overwrite the wrapper file and you will end up with double wrapping, which should be avoided.
 
+### `prependToVar` \<variableName\> \<elements...\> {#fun-prependToVar}
+
+Prepend elements to a variable.
+
+Example:
+
+```shellSession
+$ configureFlags="--disable-static"
+$ prependToVar configureFlags --disable-dependency-tracking --enable-foo
+$ echo $configureFlags
+--disable-dependency-tracking --enable-foo --disable-static
+```
+
+### `appendToVar` \<variableName\> \<elements...\> {#fun-appendToVar}
+
+Append elements to a variable.
+
+Example:
+
+```shellSession
+$ configureFlags="--disable-static"
+$ appendToVar configureFlags --disable-dependency-tracking --enable-foo
+$ echo $configureFlags
+--disable-static --disable-dependency-tracking --enable-foo
+```
+
 ## Package setup hooks {#ssec-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.