Release 2.19 (2023-11-17)
-
The experimental
nixcommand can now act as a shebang interpreter by appending the contents of any#! nixlines 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-flakeis no longer needed, as its functionality is now part of theflakesexperimental feature. To get the previous behavior, use the--file/--exprflags accordingly. -
There is a new flake installable syntax
flakeref#.attrPathwhere the "." prefix specifies thatattrPathis interpreted from the root of the flake outputs, with no searching of default attribute prefixes likepackages.<SYSTEM>orlegacyPackages.<SYSTEM>. -
Nix adds
apple-virtto the default system features on macOS systems that support virtualization. This is similar to what's done for thekvmsystem feature on Linux hosts. -
Add a new built-in function
builtins.convertHash. -
nix-shellshebang lines now support single-quoted arguments. -
builtins.fetchTreeis 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 lockonly creates lock files and adds missing inputs now. It will never update existing inputs. -
nix flake updatedoes 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-fileand--update-inputhave been removed from all commands operating on installables. They are superceded bynix flake update.
-
-
Commit signature verification for the
builtins.fetchGitis added as the newverified-fetchesexperimental feature. -
nix path-info --json(experimental) now returns a JSON map rather than JSON list. Thepathfield of each object has instead become the key in the outer map, since it is unique. Thevalidfield also goes away because we just usenullinstead.-
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_DIRSis now populated with the path to the/sharesubdirectory of the current profile. This means that command completion scripts,.desktopfiles, and similar artifacts installed vianix-envornix profile(experimental) can be found by any program that follows the XDG Base Directory Specification. -
A new command
nix store addhas been added. It replacesnix store add-fileandnix store add-pathwhich are now deprecated.