mirror of
https://github.com/NixOS/nix.dev.git
synced 2024-10-18 00:06:26 -04:00
Compare commits
3 commits
ba60e22fc6
...
e5e937db35
Author | SHA1 | Date | |
---|---|---|---|
e5e937db35 | |||
05b0bbf038 | |||
62cdf3f0cc |
|
@ -85,6 +85,13 @@ It's only possible to cross compile between `aarch64-darwin` and `x86_64-darwin`
|
|||
|
||||
It is possible to explore them in `nix repl`:
|
||||
|
||||
:::{note}
|
||||
[Starting with Nix 2.19](https://nix.dev/manual/nix/latest/release-notes/rl-2.19), `nix repl` requires the `-f` / `--file` flag:
|
||||
```shell-session
|
||||
$ nix repl -f '<nixpkgs>' -I nixpkgs=channel:nixos-23.11
|
||||
```
|
||||
:::
|
||||
|
||||
```shell-session
|
||||
$ nix repl '<nixpkgs>' -I nixpkgs=channel:nixos-23.11
|
||||
Welcome to Nix 2.18.1. Type :? for help.
|
||||
|
|
|
@ -848,6 +848,55 @@ in
|
|||
|
||||
<!-- TODO: link to escaping rules -->
|
||||
|
||||
(indented-strings)=
|
||||
### Indented strings
|
||||
|
||||
Also known as “multi-line strings”.
|
||||
|
||||
The Nix language offers convenience syntax for character strings which span multiple lines that have common indentation.
|
||||
|
||||
Indented strings are denoted by *double single quotes* (`'' ''`).
|
||||
|
||||
Example:
|
||||
|
||||
```{code-block} nix
|
||||
:class: expression
|
||||
''
|
||||
multi
|
||||
line
|
||||
string
|
||||
''
|
||||
```
|
||||
|
||||
```{code-block}
|
||||
:class: value
|
||||
"multi\nline\nstring\n"
|
||||
```
|
||||
|
||||
Equal amounts of prepended white space are trimmed from the result.
|
||||
|
||||
Example:
|
||||
|
||||
```{code-block} nix
|
||||
:class: expression
|
||||
''
|
||||
one
|
||||
two
|
||||
three
|
||||
''
|
||||
```
|
||||
|
||||
```{code-block}
|
||||
:class: value
|
||||
"one\n two\n three\n"
|
||||
```
|
||||
|
||||
:::{note}
|
||||
Indented strings also support [string interpolation](string-interpolation). See the section on Nix's [`string`](https://nix.dev/manual/nix/stable/language/values#type-string) type in the [Nix manual](https://nix.dev/manual/nix/stable/).
|
||||
:::
|
||||
|
||||
<!-- TODO: See [escaping rules](). -->
|
||||
|
||||
(file-system-paths)=
|
||||
### File system paths
|
||||
|
||||
|
@ -975,51 +1024,6 @@ While you will encounter many such examples, we recommend to [avoid lookup paths
|
|||
[nixpkgs]: https://github.com/NixOS/nixpkgs
|
||||
[manual-primitives]: https://nix.dev/manual/nix/stable/language/values.html#primitives
|
||||
|
||||
(indented-strings)=
|
||||
### Indented strings
|
||||
|
||||
Also known as “multi-line strings”.
|
||||
|
||||
The Nix language offers convenience syntax for character strings which span multiple lines that have common indentation.
|
||||
|
||||
Indented strings are denoted by *double single quotes* (`'' ''`).
|
||||
|
||||
Example:
|
||||
|
||||
```{code-block} nix
|
||||
:class: expression
|
||||
''
|
||||
multi
|
||||
line
|
||||
string
|
||||
''
|
||||
```
|
||||
|
||||
```{code-block}
|
||||
:class: value
|
||||
"multi\nline\nstring\n"
|
||||
```
|
||||
|
||||
Equal amounts of prepended white space are trimmed from the result.
|
||||
|
||||
Example:
|
||||
|
||||
```{code-block} nix
|
||||
:class: expression
|
||||
''
|
||||
one
|
||||
two
|
||||
three
|
||||
''
|
||||
```
|
||||
|
||||
```{code-block}
|
||||
:class: value
|
||||
"one\n two\n three\n"
|
||||
```
|
||||
|
||||
<!-- TODO: See [escaping rules](). -->
|
||||
|
||||
(functions)=
|
||||
## Functions
|
||||
|
||||
|
|
Loading…
Reference in a new issue