nix-repl
Start an interactive Nix expression evaluator
TLDR
SYNOPSIS
nix repl [options] [files]
DESCRIPTION
nix repl starts an interactive read-eval-print loop for the Nix expression language. It is useful for exploring package attributes, debugging expressions, and prototyping configuration.Expressions are evaluated lazily. The REPL offers tab completion for attribute names and accepts colon-prefixed meta commands (see REPL COMMANDS) in addition to ordinary Nix expressions.
PARAMETERS
FILES
Nix files whose top-level attributes are brought into scope.--expr EXPR
Evaluate the given expression and bring its attributes into scope.--file PATH
Load attributes from the given Nix file (deprecated positional form still works).--arg NAME EXPR
Pass the named argument as a Nix expression to the loaded file or flake.--argstr NAME STRING
Pass the named argument as a string.--help
Display help information.
REPL COMMANDS
:?
Show the list of available REPL commands.:l PATH
Load a Nix file and add its attributes to the scope.:r
Reload all loaded files.:b EXPR
Build a derivation and print its output paths.:e EXPR
Open the location of the given value in `$EDITOR`.:t EXPR
Show the type of the given expression.:q
Exit the REPL (Ctrl-D also works).
CAVEATS
Part of the experimental `nix` command (enable with `experimental-features = nix-command flakes`). The older standalone `nix-repl` binary is deprecated in favor of `nix repl`. Use `:?` inside the REPL for the full command list.
HISTORY
`nix repl` provides interactive evaluation for exploring and debugging Nix expressions. It superseded the separate `nix-repl` tool when the unified `nix` command was introduced.
SEE ALSO
nix(1), nix-eval(1), nix-instantiate(1)
