Release 2.9 (2022-05-30)
-
Running Nix with the new
--debuggerflag will cause it to start a repl session if an exception is thrown during evaluation, or ifbuiltins.breakis called. From there you can inspect the values of variables and evaluate Nix expressions. In debug mode, the following new repl commands are available::env Show env stack :bt Show trace stack :st Show current trace :st <idx> Change to another trace in the stack :c Go until end of program, exception, or builtins.break(). :s Go one stepRead more about the debugger here.
-
Nix now provides better integration with zsh's
run-helpfeature. It is now included in the Nix installation in the form of an autoloadable shell function,run-help-nix. It picks up Nix subcommands from the currently typed in command and directs the user to the associated man pages. -
nix replhas a new build-and-link (:bl) command that builds a derivation while creating GC root symlinks. -
The path produced by
builtins.toFileis now allowed to be imported or read even with restricted evaluation. Note that this will not work with a read-only store. -
nix buildhas a new--print-out-pathsflag to print the resulting output paths. This matches the default behaviour ofnix-build. -
You can now specify which outputs of a derivation
nixshould operate on using the syntaxinstallable^outputs, e.g.nixpkgs#glibc^dev,staticornixpkgs#glibc^*. By default,nixwill use the outputs specified by the derivation'smeta.outputsToInstallattribute if it exists, or all outputs otherwise. -
builtins.fetchTree(and flake inputs) can now be used to fetch plain files over thehttp(s)andfileprotocols in addition to directory tarballs.