Release 2.36.0 (2026-11-16)
Packaging
-
Starting with this release,
nix-installerbinaries are shipped alongside other binary artifacts in releases.nixos.org.You can run the installer with:
curl -sSfL https://channels.nixos.org/nix-latest/nix-installer | sh -s -- installIt’s built for
x86_64-linux,aarch64-linuxandaarch64-darwinplatforms and only supports multi-user installations. -
Cross-built binary releases for
powerpc64-linuxandpowerpc64le-linuxplatforms #16274 -
Scripted installer supports busybox-based systems (e.g. Alpine) in single-user mode #16537
-
The scripted installer sets the correct store mtime #16558
Improvements
-
Daemon worker spawning rework #15857 #16659
Previously,
nix-daemonaccepting on thenix-daemon.socketwould spawn a worker process byfork()-ing without callingexecv*. This has historically been a source of issues around fork-unsafe dependencies and in Nix itself. The most notorious instance of this issue has been Nix on macOS, which discourages such use of fork(2), and has caused numerous issues in the past (mostly around the use ofSecureTransportTLS backend in libcurl and aws-c-io).Now
nix-daemonspawns a worker processes by spawning and executing itself in--stdiomode by redirecting stdin/stdout to the accepted socket and forcing the trust level with the stabilised--force-trustedand--force-untrustedflags. The path to the current binary is either/proc/self/exeon Linux, acquired via_NSGetExecutablePathon macOS, orKERN_PROC_PATHNAMEsysctl on FreeBSD.No functional changes are expected from this, though there are minor user-visible behavioral changes:
nix-daemonno longer needs to be restarted for/etc/nix/nix.confchanges to take effect in the daemon worker (note that this doesn’t apply to settings likeallowed-usersortrusted-users).- The command line of the worker process no longer has the form
nix-daemon <peer pid>. Previously, the PID of the daemon client process was inserted intoargv[1]. This also obviates the need for passing the no-op--daemonflag for making room for the PID inargv[1]. The peer PID is now part of theargv[0]in the form ofnix-daemon.worker-<peer pid>. This is an internal debugging feature used for correlating the daemon worker process with its client.
-
daemon-trust-override,--process-opsstabilisation #16637 #16659daemon-trust-overrideexperimental feature has been stabilised. This change was needed to facilitate the daemon worker spawning rework.--force-untrustednow behaves correctly when the--stdiodaemon worker’s store is another remote store backed by another daemon.--force-untrusted,--force-trusted,--default-trust,--process-opsflags accepted bynix-daemonandnix daemonare no longer experimental. -
Daemon enables cgroup controllers for build cgroups #9675 #16024
With
use-cgroups, the daemon now enables thecpu,memory,ioandpidscontrollers in its cgroup’scgroup.subtree_control, so per-build cgroups exposememory.peak,io.statetc. instead of onlycpu.stat. This requires the controllers to be delegated to the daemon’s cgroup (e.g. systemdDelegate=yes). -
Nix now finds Darwin runtime garbage collector roots without
lsof#3011 #13990On Darwin, the garbage collector now uses
libprocto retain store paths referenced by running processes through their working directories, open files, mapped regions, or environment variables. This avoids the slowlsoffallback and adds environment-variable roots, whichlsofcould not discover.macOS does not expose the environment variables of entitled binaries while System Integrity Protection is enabled, so those roots remain unavailable.
-
nix run,nix searchandnix bundlenow auto-call functions #5316 #15895If an installable given with
--fileor--exprevaluates to a function, it is now called automatically, provided each of its arguments has a default value or is passed with--arg/--argstr. This makesnix run,nix searchandnix bundlebehave likenix build,nix shell,nix-buildandnix-env --query.For example,
nix run --impure --expr '{ pkgs ? import <nixpkgs> {} }: pkgs.hello'now works instead of failing witherror: attribute 'type' does not exist.nix evalandnix edit, which show the value itself rather than a package, are unchanged. -
Build cgroups are named after the derivation #16516
Per-build cgroups are now named
nix-build@<drv-hash>-<uid>when a build user is used, andnix-build@<drv-hash>-<pid>otherwise. They replacenix-build-uid-<uid>andnix-build-pid-<pid>-<counter>, so external tools can locate the cgroup of a given derivation’s build. -
Add an alias for optimise. #1902 #11326 #11577 #15997
Add “optimize” as a linguistic variation of “optimise”. Now both the
nix-storeandnix storecommands work with the same spelling. -
Downloads and store path copying produces significantly less log updates for
internal-jsonlogger #16671 #16670Tools such as
nix-output-monitorwere previously significantly bottlenecked parsing on the order of tens of MB/s of JSON. Download progress updates are now chunked and rate-limited. Bandwidth requirements for the logger are now significantly lower. -
Styled output on stdout is plain when stdout is not a terminal #4626 #9486 #16710 #16711
nix profile list,nix profile history,nix flake metadata,nix flake show,nix searchandnix store diff-closuresno longer write ANSI bold and color to stdout when it is not a terminal, or whenNO_COLORis set. SetCLICOLOR_FORCEto keep the styling. -
Add
nix versioncommand with--jsonoption #16201 A--versionflag is more like a modern subcommand than a flag, and this provides a place for JSON output, making it easier to consume in scripts. When--jsonis passed, the output includes library versions.nix --version -vvoutput also includes library versions in human-readable comma-separated format. -
Bash completions now handle redirections #16648
File names after redirections (e.g.
nix log nixpkgs#hello > /tmp/hello-lo<TAB>) can now be completed. -
Nix now makes use of reflinking via
copy_file_rangewhen copying files on filesystem that support it #15410
Error message improvements
-
Start of infinite recursion is now visible #16296
When Nix reports a trace for an infinitely recursive evaluation, it will now let you discern the cycle from the code that leads up to the cycle.
Example:
nix eval --expr 'let f = builtins.add f 1; in toString f' --show-traceerror: … while calling the 'toString' builtin at «string»:1:30: 1| let f = builtins.add f 1; in toString f | ^ … entering the infinite recursion … while calling the 'add' builtin at «string»:1:9: 1| let f = builtins.add f 1; in toString f | ^ error: infinite recursion encountered -
builtins.warnnow supports unindented multi-line messages #14794builtins.warnnow preserves the formatting of messages that start with a newline instead of adding indentation to align them with the warning prefix. -
builtins.addErrorContextkeeps the error from value when context fails #8283 #16618If evaluating context in
builtins.addErrorContext context valuefails, the error from value now propagates, with the error from context in its trace. Library authors can therefore use more complex context expressions without the risk of hiding the error from value.addErrorContextcan no longer be abused to catch uncatchable errors likeabort. -
Error traces now show both the selection site in addition to the definition site when an attribute is retrieved and both locations are known. #16249
-
Error traces now always show the derivations that were getting instantiated #16282
-
All operators in error traces are displayed, and consistently #16301
-
Error messages for interrupted downloads are more concise #16095 #16646 #14757
Bug fixes
-
nix developno longer disables ASLR on Linux #16624.Previously,
nix developwould enableADDR_NO_RANDOMIZEpersonality bit. This disabled ASLR for all subsequent commands run in the devshell.Additionally,
impersonate-linux-26setting has been removed. If you require this, you can change the personality manually or usedeterministic-unamefrom Nixpkgs depending on the use-case. -
File descriptors are more reliably closed in children processes #16247 #16717 #16749
Also, Nix daemon no longer performs 1 million close syscalls (commonly configured RLIMIT_NOFILE for the daemon) for each spawned derivation builder on macOS by relying on libproc for closing file descriptors in the child.
-
post-build-hookis no longer run in a mount namespace with a writable Nix store #16247 -
builtins.pathExistsno longer swallows access errors from evaluating its argument #16728Since Nix 2.20,
builtins.pathExistsaccidentally recovered from access errors caused by evaluating its argument. Consider:$ nix eval --expr 'builtins.pathExists (builtins.readFile /etc/passwd)'This evaluated to
false, even thoughbuiltins.readFile /etc/passwdwould throw, andbuiltins.pathExistsnever saw a supposed path.Now the error propagates, as it did in Nix 2.19 and earlier. This invocation fails with the same error observed by calling
builtins.readFile /etc/passwdin isolation. -
Store garbage collector can now delete App bundles on macOS #16626 #16719
Previously, even when run as
rootNix attempted to make directories writable for deletion, which is not allowed for App bundles on macOS and would fail withOperation not permitted. Nix now skips thechmodwhen run as root on macOS.Additionally, when run with
DAC_OVERRIDEcapability on Linux,chmodoperation is also skipped. -
nix eval --write-tois stricter about what it writes #16760nix eval --write-tonow requires attributes to correspond to a single file name. In particular, it rejects attribute names that contain/or are empty, in addition to rejecting.and..as it did already. Previously, an attribute such as{ "a/b" = "..."; }was written to a nested patha/b, which is a bit of an “injection”.Attribute sets can also now be nested at most 64 levels deep, the same limit as for NARs.
(The output is also now written in the same way as NARs are unpacked, which hardens it in a bunch of ways.)
-
Path-like flake references detect Mercurial checkouts
A path-like flake reference such as
.used to become agit+file:input only inside a Git repository, and apath:input everywhere else. In a Mercurial checkout that copied the whole directory to the store,.hgand untracked files included, and the flake had norev.Such a reference now resolves to
hg+file:, so only tracked files are copied. This needs thehgexecutable, ashg+file:inputs always did.Input schemes, including ones from
plugin-files, can resolve a path-like flake reference to their own scheme by implementingInputScheme::localRepoURL(). -
S3:
endpoint=host:portfixed, deprecated in favour of full URLsBare
host:portvalues for theendpointparameter ofs3://store URLs were misparsed (the host was taken as a URL scheme). This is fixed, but the bare form and the separateschemeparameter are deprecated: use a full URL such asendpoint=https://minio.example.cominstead. -
Boost.Context bug causing incorrect daemeon exception detection has been worked around in Nix and Nixpkgs, with a fix contributed upstream #16197 #16174.
This would cause spurious aborts in
nix replwhenbuiltins.toFileor other primops that fetch to the store failed. It only affected builds of Nix using Boost’s fcontext coroutine backend with libstdc++ standard library. -
NUL bytes in derivation
builderandargsattributes are rejected #16245This issue was not possible to encounter from the Nix evaluator, since Nix strings disallow embedded NUL bytes but could lead to silent truncation in other cases.
-
Derivation parser is now more strict #16237 #16284
The derivation ATerm parser now rejects derivations that are not in the form that’s produced by the evaluator.
-
The NAR parser is stricter when file contents are discarded #16325
When computing the NAR listing (
.lsfiles) and other operations that discard contents of regular files in NARs, Nix did not sufficiently validate padding bytes. -
Store path basenames that don’t have the hash part followed by
-are properly rejected #16257. -
Truncated Brotli compressed NARs no longer cause Nix to loop infinitely #16575.
-
Errors while writing to compressed streams (e.g. copying to a local binary cache store) no longer cause a crash #16664
-
Non-lexically-canonical home-path literals (e.g.
~/repos/nixpkgs/.) no longer crash the evaluator #16651 -
Deleting profiles with unexpected
mtimeno longer triggers a crash #16634 -
Internal source tree names no longer leak into evaluation results of
builtins.toXMLand value printing #16780This is a regression from 2.32 for
pure-evalmode, which is now fixed. -
builtins.readDir builtins.storeDirno longer fails in impure evaluation mode #16780Since 2.32, it would fail with
error: path '/nix/store/' is not in the Nix store. -
Logging has been hardened against crafted inputs #16784 #16456
Nix now handles malformed inputs from derivation builders more robustly and warns on unknown activities and result types.
-
While reading git objects, Nix now rejects duplicate Git tree entries and unsorted trees #16793
ca-derivations
-
Add new
nix store build-trace deletecommand #15655 -
Implement new
builder-rpc-v0feature; see #15793 below underdynamic-derivations. While motivated primarily by the dynamic derivations feature, registering outputs is also useful for content-addressing derivations. The builder can learn the calculated content-addressed path of one of its outputs before creating others, removing the need for any rewriting on the nix-daemon side after the derivation finishes. -
Error instead of crashing when realisations cannot be queried #16014
dynamic-derivations
- Implement new
builder-rpc-v0feature #15793 This PR adds support for creating new store objects within a derivation at runtime, then registering them as an output. nix store add --scanfor creating references, as well as inbuilder-rpc-v0#16163
C API
- Expose evaluator helpers for working with derivation trees #15842
nix_get_derivation,nix_value_auto_call_function - Fix
nix_get_external#15954
Contributing
- Establish AI policy #15984
Contributors
This release was made possible by the following 68 contributors:
- Angel J (@iamanaws)
- saara (@misspenalty)
- Krithik Rao (@KritR)
- Michael Daniels (@mdaniels5757)
- Kip Landergren (@klandergren)
- Lisanna Dettwyler (@lisanna-dettwyler)
- Vladimir Petrzhikovskii (@0xdeafbeef)
- John Ericson (@Ericson2314)
- figsoda (@figsoda)
- raf (@NotAShelf)
- Amaan Qureshi (@amaanq)
- Jazzkid (@Jazzkid0)
- Sergei Zimmerman (@xokdvium)
- StepBroBD (@stepbrobd)
- dram (@dramforever)
- Jonas Chevalier (@zimbatm)
- yunfachi (@yunfachi)
- Matthew Kenigsberg (@mkenigs)
- Jake Hillion (@JakeHillion)
- Marshall Porter (@meop)
- Robert Hensing (@roberth)
- Philip Taron (@PhilipTaronQ)
- Anton Kesy (@antonkesy)
- Jens Petersen (@juhp)
- Valentin Gagarin (@fricklerhandwerk)
- HHH (@H7TPS)
- Ihar Hrachyshka (@booxter)
- Jörg Thalheim (@Mic92)
- Sandro (@SuperSandro2000)
- faukah (@faukah)
- Rohit Singh (@sinrohit-desco)
- Artemis Tosini (@artemist)
- Gaétan Lepage (@GaetanLepage)
- Yaroslav Kuznetsov (@YENGISAY)
- Bang Lee (@Qusic)
- Francesco Gazzetta (@fgaz)
- Farid Zakaria (@fzakaria)
- reee (@qsxDree)
- Evan Quiney (@Evanev7)
- Cosima Neidahl (@OPNA2608)
- Domen Kožar (@domenkozar)
- Jacek Galowicz (@tfc)
- sulewicz-gq (@sulewicz-gq)
- Grayson Tinker (@GraysonTinker)
- fsagbuya (@fsagbuya)
- tomberek (@tomberek)
- Chad Zawistowski (@czawistowski-nvidia)
- Eelco Dolstra (@edolstra)
- adisbladis (@adisbladis)
- Dennis (@DerDennisOP)
- aetos (@aetosdios27)
- Zapolyarny (@ZapolyarnyDev)
- Yuta Fudaba (@ph0ryn)
- Carl (@Lillecarl)
- Riccardo Mazzarini (@noib3)
- Jonathan De Troye (@detroyejr)
- ulucs (@ulucs)
- Jamie Magee (@JamieMagee)
- Filippo (@Filippo-Galli)
- Adam Dinwoodie (@me-and)
- Jeremy Fleischman (@jfly)
- Philip Taron (@philiptaron)
- Thiago Kenji Okada (@thiagokokada)
- Alex (@filaka771)
- Ryan Hendrickson (@rhendric)
- Michael Vorburger (@vorburger)
- awsmadi (@awsmadi)
- Philipp Otterbein