Skip to content

Commit

Permalink
doc: apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomberek committed Aug 18, 2023
1 parent 1383b04 commit 5d33afe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions doc/manual/src/release-notes/rl-next.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
- 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.

Some examples:
```
#!/usr/bin/env nix
#! nix shell --file ``<nixpkgs>`` hello --command bash
#! nix shell --file ``<nixpkgs>`` hello cowsay --command bash

hello | cowsay
```
Expand Down
15 changes: 8 additions & 7 deletions src/nix/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <installables> --command <interpreter>
```

where *real-interpreter* is the “real” script interpreter that will be
where <interpreter> 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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5d33afe

Please sign in to comment.