writeShellApplication: buildInputs -> runtimeInputs

+5 -5
+2 -2
doc/builders/trivial-builders.chapter.md
··· 49 50 ## `writeShellApplication` {#trivial-builder-writeShellApplication} 51 52 - This can be used to easily produce a shell script that has some dependencies (`buildInputs`). 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). 53 54 For example, look at the following code: 55 ··· 57 writeShellApplication { 58 name = "show-nixos-org"; 59 60 - buildInputs = [ curl w3m ]; 61 62 text = '' 63 curl -s 'https://nixos.org' | w3m -dump -T text/html
··· 49 50 ## `writeShellApplication` {#trivial-builder-writeShellApplication} 51 52 + 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). 53 54 For example, look at the following code: 55 ··· 57 writeShellApplication { 58 name = "show-nixos-org"; 59 60 + runtimeInputs = [ curl w3m ]; 61 62 text = '' 63 curl -s 'https://nixos.org' | w3m -dump -T text/html
+3 -3
pkgs/build-support/trivial-builders.nix
··· 260 * # Writes my-file to /nix/store/<store path>/bin/my-file and makes executable. 261 * writeShellApplication { 262 * name = "my-file"; 263 - * buildInputs = [ curl w3m ]; 264 * text = '' 265 * curl -s 'https://nixos.org' | w3m -dump -T text/html 266 * ''; ··· 269 writeShellApplication = 270 { name 271 , text 272 - , buildInputs ? [ ] 273 , checkPhase ? null 274 }: 275 writeTextFile { ··· 282 set -o nounset 283 set- o pipefail 284 285 - export PATH="${makeBinPath buildInputs}:$PATH" 286 287 ${text} 288 '';
··· 260 * # Writes my-file to /nix/store/<store path>/bin/my-file and makes executable. 261 * writeShellApplication { 262 * name = "my-file"; 263 + * runtimeInputs = [ curl w3m ]; 264 * text = '' 265 * curl -s 'https://nixos.org' | w3m -dump -T text/html 266 * ''; ··· 269 writeShellApplication = 270 { name 271 , text 272 + , runtimeInputs ? [ ] 273 , checkPhase ? null 274 }: 275 writeTextFile { ··· 282 set -o nounset 283 set- o pipefail 284 285 + export PATH="${makeBinPath runtimeInputs}:$PATH" 286 287 ${text} 288 '';