mirror of
https://github.com/NixOS/nix.dev.git
synced 2024-10-18 14:32:43 -04:00
add subsections to modes of running examples
reorder to have the REPL first (it's fewer steps)
This commit is contained in:
parent
155ad688bc
commit
b0023d2ade
|
@ -85,6 +85,24 @@ The following example is a Nix expression adding two numbers:
|
|||
|
||||
3
|
||||
|
||||
#### Interactive evaluation
|
||||
|
||||
Use `nix repl` to evaluate Nix expressions interactively (by typing them on the command line):
|
||||
|
||||
```console
|
||||
nix repl
|
||||
```
|
||||
|
||||
Welcome to Nix 2.5.1. Type :? for help.
|
||||
|
||||
```console
|
||||
nix-repl> 1 + 2
|
||||
```
|
||||
|
||||
3
|
||||
|
||||
#### Evaluating Nix files
|
||||
|
||||
Use `nix-instantiate --eval` to evaluate the expression in a Nix file.
|
||||
|
||||
```console
|
||||
|
@ -107,20 +125,6 @@ nix-instantiate --eval
|
|||
3
|
||||
:::
|
||||
|
||||
Use `nix repl` to evaluate Nix expressions interactively (by typing them on the command line):
|
||||
|
||||
```console
|
||||
nix repl
|
||||
```
|
||||
|
||||
Welcome to Nix 2.5.1. Type :? for help.
|
||||
|
||||
```console
|
||||
nix-repl> 1 + 2
|
||||
```
|
||||
|
||||
3
|
||||
|
||||
## Reading the Nix language without fear
|
||||
|
||||
You will quickly encounter Nix language expressions that may look very complicated.
|
||||
|
|
Loading…
Reference in a new issue