about summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorRebecca Turner <rbt@sent.as>2024-01-22 09:33:49 -0800
committerRebecca Turner <rbt@sent.as>2024-02-01 16:02:34 -0800
commit41376dd064e8be5c1d936decca6da2cdd8a7a731 (patch)
tree368a9c8f5eb707ede5acbb387745c3a5b9a21b93 /doc
parent88ce0b00191ff1d7093709696538e403c990285a (diff)
downloadnixlib-41376dd064e8be5c1d936decca6da2cdd8a7a731.tar
nixlib-41376dd064e8be5c1d936decca6da2cdd8a7a731.tar.gz
nixlib-41376dd064e8be5c1d936decca6da2cdd8a7a731.tar.bz2
nixlib-41376dd064e8be5c1d936decca6da2cdd8a7a731.tar.lz
nixlib-41376dd064e8be5c1d936decca6da2cdd8a7a731.tar.xz
nixlib-41376dd064e8be5c1d936decca6da2cdd8a7a731.tar.zst
nixlib-41376dd064e8be5c1d936decca6da2cdd8a7a731.zip
writeShellApplication: Update manual
Diffstat (limited to 'doc')
-rw-r--r--doc/build-helpers/trivial-build-helpers.chapter.md13
1 files changed, 7 insertions, 6 deletions
diff --git a/doc/build-helpers/trivial-build-helpers.chapter.md b/doc/build-helpers/trivial-build-helpers.chapter.md
index 4648c7985542..384e25035060 100644
--- a/doc/build-helpers/trivial-build-helpers.chapter.md
+++ b/doc/build-helpers/trivial-build-helpers.chapter.md
@@ -502,9 +502,14 @@ concatScript "my-file" [ file1 file2 ]
 
 ## `writeShellApplication` {#trivial-builder-writeShellApplication}
 
-This can be used to easily produce a shell script that has some dependencies (`runtimeInputs`). It automatically sets the `PATH` of the script to contain all of the listed inputs, sets some sanity shellopts (`errexit`, `nounset`, `pipefail`), and checks the resulting script with [`shellcheck`](https://github.com/koalaman/shellcheck).
+`writeShellApplication` is similar to `writeShellScriptBin` and `writeScriptBin` but supports runtime dependencies with `runtimeInputs`.
+Writes an executable shell script to `/nix/store/<store path>/bin/<name>` and checks its syntax with [`shellcheck`](https://github.com/koalaman/shellcheck) and the `bash`'s `-n` option.
+Some basic Bash options are set by default (`errexit`, `nounset`, and `pipefail`), but can be overridden with `bashOptions`.
 
-For example, look at the following code:
+Extra arguments may be passed to `stdenv.mkDerivation` by setting `derivationArgs`; note that variables set in this manner will be set when the shell script is _built,_ not when it's run.
+Runtime environment variables can be set with the `runtimeEnv` argument.
+
+For example, the following shell application can refer to `curl` directly, rather than needing to write `${curl}/bin/curl`:
 
 ```nix
 writeShellApplication {
@@ -518,10 +523,6 @@ writeShellApplication {
 }
 ```
 
-Unlike with normal `writeShellScriptBin`, there is no need to manually write out `${curl}/bin/curl`, setting the PATH
-was handled by `writeShellApplication`. Moreover, the script is being checked with `shellcheck` for more strict
-validation.
-
 ## `symlinkJoin` {#trivial-builder-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 subdirectory contained within.