diff --git a/doc/manual/src/release-notes/rl-next.md b/doc/manual/src/release-notes/rl-next.md index 04b2301c137..609c32ea774 100644 --- a/doc/manual/src/release-notes/rl-next.md +++ b/doc/manual/src/release-notes/rl-next.md @@ -23,8 +23,8 @@ - Introduce a new [`outputOf`](@docroot@/language/builtins.md#builtins-outputOf) builtin. It is part of the [`dynamic-derivations`](@docroot@/contributing/experimental-features.md#xp-feature-dynamic-derivations) experimental feature. -- The experimental nix command is now a `#!-interpreter` by appending the - contents of any `#! nix` lines and the script's location to a single call. +- The experimental `nix` command is now a `#!-interpreter` by concatenating the + contents of any `#! nix` lines and the script's location into a single call. Verbatim strings may be passed in double backtick (```` `` ````) quotes. `--file` and `--expr` resolve relative paths based on the script location. @@ -32,7 +32,7 @@ Some examples: ``` #!/usr/bin/env nix - #! nix shell --file ```` hello --command bash + #! nix shell --file ```` hello cowsay --command bash hello | cowsay ``` diff --git a/src/nix/shell.md b/src/nix/shell.md index 43b6bddbcda..89fb7fd59e4 100644 --- a/src/nix/shell.md +++ b/src/nix/shell.md @@ -59,17 +59,17 @@ done by starting the script with the following lines: ```bash #! /usr/bin/env nix -#! nix shell installables --command real-interpreter +#! nix shell --command ``` -where *real-interpreter* is the “real” script interpreter that will be +where is the interpreter that will be invoked by `nix shell` after it has obtained the dependencies and initialised the environment, and *installables* are the attribute names of the dependencies in Nixpkgs. -The lines starting with `#! nix` specify options (see above). Note that you -cannot write `#! /usr/bin/env nix shell -i ...` because many operating systems -only allow one argument in `#!` lines. +The lines starting with `#! nix` are concatenated into a single call. Note that +you cannot write `#! /usr/bin/env nix shell -i ...` because many operating +systems only allow one argument in `#!` lines. For example, here is a Python script that depends on Python and the `prettytable` package: @@ -120,8 +120,9 @@ terraform "$@" > **Note** > -> You must use double backticks (```` `` ````) when passing a simple Nix expression -> in a nix shell shebang. +> You can use double backticks (```` `` ````) when passing what would usually +> be a double-quoted string in order to support multi-line strings +> in a nix shebang. Finally, using the merging of multiple nix shell shebangs the following Haskell script uses a specific branch of Nixpkgs/NixOS (the 21.11 stable