Release 2.19 (2023-11-17)
-
The experimental
nix
command can now act as a shebang interpreter by appending the contents of any#! nix
lines and the script's location into a single call. -
URL flake references now support percent-encoded characters.
-
Path-like flake references now accept arbitrary unicode characters (except
#
and?
). -
The experimental feature
repl-flake
is no longer needed, as its functionality is now part of theflakes
experimental feature. To get the previous behavior, use the--file/--expr
flags accordingly. -
There is a new flake installable syntax
flakeref#.attrPath
where the "." prefix specifies thatattrPath
is interpreted from the root of the flake outputs, with no searching of default attribute prefixes likepackages.<SYSTEM>
orlegacyPackages.<SYSTEM>
. -
Nix adds
apple-virt
to the default system features on macOS systems that support virtualization. This is similar to what's done for thekvm
system feature on Linux hosts. -
Add a new built-in function
builtins.convertHash
. -
nix-shell
shebang lines now support single-quoted arguments. -
builtins.fetchTree
is now its own experimental feature,fetch-tree
. This allows stabilising it independently of the rest of what is encompassed byflakes
. -
The interface for creating and updating lock files has been overhauled:
-
nix flake lock
only creates lock files and adds missing inputs now. It will never update existing inputs. -
nix flake update
does the same, but will update inputs.- Passing no arguments will update all inputs of the current flake, just like it already did.
- Passing input names as arguments will ensure only those are updated. This replaces the functionality of
nix flake lock --update-input
- To operate on a flake outside the current directory, you must now pass
--flake path/to/flake
.
-
The flake-specific flags
--recreate-lock-file
and--update-input
have been removed from all commands operating on installables. They are superceded bynix flake update
.
-
-
Commit signature verification for the
builtins.fetchGit
is added as the newverified-fetches
experimental feature. -
nix path-info --json
(experimental) now returns a JSON map rather than JSON list. Thepath
field of each object has instead become the key in the outer map, since it is unique. Thevalid
field also goes away because we just usenull
instead.-
Old way:
[ { "path": "/nix/store/8fv91097mbh5049i9rglc73dx6kjg3qk-bash-5.2-p15", "valid": true, // ... }, { "path": "/nix/store/wffw7l0alvs3iw94cbgi1gmmbmw99sqb-home-manager-path", "valid": false } ]
-
New way
{ "/nix/store/8fv91097mbh5049i9rglc73dx6kjg3qk-bash-5.2-p15": { // ... }, "/nix/store/wffw7l0alvs3iw94cbgi1gmmbmw99sqb-home-manager-path": null, }
This makes it match
nix derivation show
, which also maps store paths to information. -
-
When Nix is installed using the binary installer, in supported shells (Bash, Zsh, Fish)
XDG_DATA_DIRS
is now populated with the path to the/share
subdirectory of the current profile. This means that command completion scripts,.desktop
files, and similar artifacts installed vianix-env
ornix profile
(experimental) can be found by any program that follows the XDG Base Directory Specification. -
A new command
nix store add
has been added. It replacesnix store add-file
andnix store add-path
which are now deprecated.