aboutsummaryrefslogtreecommitdiff
path: root/src/nix/repl.md
diff options
context:
space:
mode:
authorTom Bereknyei <tomberek@gmail.com>2022-03-11 13:26:08 -0500
committerTom Bereknyei <tomberek@gmail.com>2022-05-18 21:20:59 -0400
commit5640b528349c43717aa501797a4f337373ebf3e4 (patch)
treedafde5d19c66eac53a077604db1d5f73b71ba0a3 /src/nix/repl.md
parent81567a096258026148b42f3048be9b2ba295b41a (diff)
repl: use installables
Diffstat (limited to 'src/nix/repl.md')
-rw-r--r--src/nix/repl.md30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/nix/repl.md b/src/nix/repl.md
index 9b6f2bee3..be1498e5b 100644
--- a/src/nix/repl.md
+++ b/src/nix/repl.md
@@ -24,10 +24,34 @@ R""(
* Interact with Nixpkgs in the REPL:
```console
- # nix repl '<nixpkgs>'
+ # nix repl --file example.nix
+ Loading Installable ''...
+ Added 3 variables.
- Loading '<nixpkgs>'...
- Added 12428 variables.
+ # nix repl --expr '{a={b=3;c=4;};}'
+ Loading Installable ''...
+ Added 1 variables.
+
+ # nix repl --expr '{a={b=3;c=4;};}' a
+ Loading Installable ''...
+ Added 1 variables.
+
+ # nix repl nixpkgs
+ Loading Installable 'flake:nixpkgs#'...
+ Added 5 variables.
+
+ nix-repl> legacyPackages.x86_64-linux.emacs.name
+ "emacs-27.1"
+
+ nix-repl> legacyPackages.x86_64-linux.emacs.name
+ "emacs-27.1"
+
+ nix-repl> :q
+
+ # nix repl --expr 'import <nixpkgs>{}' --impure
+
+ Loading Installable ''...
+ Added 12439 variables.
nix-repl> emacs.name
"emacs-27.1"