diff --git a/doc/builders/trivial-builders.chapter.md b/doc/builders/trivial-builders.chapter.md index 4c0318a2541a..c3a3572cd9f4 100644 --- a/doc/builders/trivial-builders.chapter.md +++ b/doc/builders/trivial-builders.chapter.md @@ -49,7 +49,7 @@ Many more commands wrap `writeTextFile` including `writeText`, `writeTextDir`, ` ## `writeShellApplication` {#trivial-builder-writeShellApplication} -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). +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). For example, look at the following code: @@ -57,7 +57,7 @@ For example, look at the following code: writeShellApplication { name = "show-nixos-org"; - buildInputs = [ curl w3m ]; + runtimeInputs = [ curl w3m ]; text = '' curl -s 'https://nixos.org' | w3m -dump -T text/html diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 506f84310160..e0571632e760 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -260,7 +260,7 @@ rec { * # Writes my-file to /nix/store//bin/my-file and makes executable. * writeShellApplication { * name = "my-file"; - * buildInputs = [ curl w3m ]; + * runtimeInputs = [ curl w3m ]; * text = '' * curl -s 'https://nixos.org' | w3m -dump -T text/html * ''; @@ -269,7 +269,7 @@ rec { writeShellApplication = { name , text - , buildInputs ? [ ] + , runtimeInputs ? [ ] , checkPhase ? null }: writeTextFile { @@ -282,7 +282,7 @@ rec { set -o nounset set- o pipefail - export PATH="${makeBinPath buildInputs}:$PATH" + export PATH="${makeBinPath runtimeInputs}:$PATH" ${text} '';