mirror of
https://github.com/NixOS/nix.dev.git
synced 2024-10-18 14:32:43 -04:00
uniform format for code samples
This commit is contained in:
parent
e4bfdf0707
commit
ef5f3823cc
|
@ -76,9 +76,10 @@ Use `nix-instantiate --eval` to evaluate the expression in a Nix file.
|
|||
echo 1 + 2 > file.nix
|
||||
|
||||
nix-instantiate --eval file.nix
|
||||
3
|
||||
```
|
||||
|
||||
3
|
||||
|
||||
:::{note}
|
||||
`nix-instantiate --eval` will evaluate `default.nix` if no file name is specified.
|
||||
|
||||
|
@ -86,20 +87,25 @@ nix-instantiate --eval file.nix
|
|||
echo 1 + 2 > default.nix
|
||||
|
||||
nix-instantiate --eval
|
||||
3
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
nix-repl> 1 + 2
|
||||
3
|
||||
```
|
||||
|
||||
Welcome to Nix 2.5.1. Type :? for help.
|
||||
|
||||
```console
|
||||
nix-repl> 1 + 2
|
||||
```
|
||||
|
||||
3
|
||||
|
||||
# Names and values
|
||||
|
||||
There are two ways to assign names to values in Nix: attribute sets and `let` expressions.
|
||||
|
|
Loading…
Reference in a new issue