From af2afa218f5e4c9b2a7eb589ca0916939d93a5e3 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 25 Jun 2026 13:43:14 +0200 Subject: [PATCH 1/5] nixos/channel: add zstd flavored nixexprs tarball This can significantly speed up consumption of nixexprs because zstd decompress is generally 10x faster than xz. (cherry picked from commit 69353cef31aba396015c342c3e4e7a52f89ea683) --- nixos/lib/make-channel.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/lib/make-channel.nix b/nixos/lib/make-channel.nix index e366006e908c..f4fca9bf2f7b 100644 --- a/nixos/lib/make-channel.nix +++ b/nixos/lib/make-channel.nix @@ -18,7 +18,10 @@ pkgs.releaseTools.makeSourceTarball { officialRelease = false; # FIXME: fix this in makeSourceTarball inherit version versionSuffix; - buildInputs = [ pkgs.nix ]; + buildInputs = with pkgs; [ + nix + zstd + ]; distPhase = '' rm -rf .git @@ -33,5 +36,10 @@ pkgs.releaseTools.makeSourceTarball { cd .. chmod -R u+w $releaseName tar cfJ $out/tarballs/$releaseName.tar.xz $releaseName + tar \ + --create \ + --file="$out/tarballs/$releaseName.tar.zst" \ + --use-compress-program="zstd -19 -T$NIX_BUILD_CORES" \ + $releaseName ''; } From 18d8df8f4825f0783b8571371bc8a0d0bdf7d700 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 25 Jun 2026 14:04:47 +0200 Subject: [PATCH 2/5] make-tarball.nix: add zstd flavored nixexprs tarball This can significantly speed up consumption of nixexprs because zstd decompress is generally 10x faster than xz. (cherry picked from commit 1088aac127e43eedf50daf50f1c32378aa60368d) --- pkgs/top-level/make-tarball.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/top-level/make-tarball.nix b/pkgs/top-level/make-tarball.nix index 3318b17ba926..356d519e82c9 100644 --- a/pkgs/top-level/make-tarball.nix +++ b/pkgs/top-level/make-tarball.nix @@ -24,6 +24,7 @@ pkgs.releaseTools.sourceTarball { jq lib-tests brotli + zstd ]; configurePhase = '' @@ -79,5 +80,22 @@ pkgs.releaseTools.sourceTarball { --mode=ug+w \ --hard-dereference \ $src $(pwd)/{.version-suffix,.git-revision} + + tar \ + --create \ + --use-compress-program="zstd -19 -T0" \ + --file=$out/tarballs/$releaseName.tar.zst \ + --absolute-names \ + --transform="s|^$src|$releaseName|g" \ + --transform="s|^$(pwd)|$releaseName|g" \ + --owner=0 \ + --group=0 \ + --numeric-owner \ + --format=gnu \ + --sort=name \ + --mtime="@$SOURCE_DATE_EPOCH" \ + --mode=ug+w \ + --hard-dereference \ + $src $(pwd)/{.version-suffix,.git-revision} ''; } From 12684ce725792934e625184d0c000d2612d1ccf6 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 25 Jun 2026 15:39:23 +0200 Subject: [PATCH 3/5] nixos/channel: apply reproducibility fixes from make-tarball.nix These changes are ported from 72e89d74616d, f7672530de22 and e30966158634. (cherry picked from commit 290af9f23f059235c89edad63ec57b14013784cb) --- nixos/lib/make-channel.nix | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/nixos/lib/make-channel.nix b/nixos/lib/make-channel.nix index f4fca9bf2f7b..fd2be792b7ac 100644 --- a/nixos/lib/make-channel.nix +++ b/nixos/lib/make-channel.nix @@ -35,11 +35,32 @@ pkgs.releaseTools.makeSourceTarball { NIX_STATE_DIR=$TMPDIR nix-env -f ../$releaseName/default.nix -qaP --meta --show-trace --xml \* > /dev/null cd .. chmod -R u+w $releaseName - tar cfJ $out/tarballs/$releaseName.tar.xz $releaseName + XZ_OPT="-T0" tar \ + --create \ + --file=$out/tarballs/$releaseName.tar.xz \ + --xz \ + --absolute-names \ + --owner=0 \ + --group=0 \ + --numeric-owner \ + --format=gnu \ + --sort=name \ + --mtime="@$SOURCE_DATE_EPOCH" \ + --hard-dereference \ + $releaseName + tar \ --create \ --file="$out/tarballs/$releaseName.tar.zst" \ - --use-compress-program="zstd -19 -T$NIX_BUILD_CORES" \ + --use-compress-program="zstd -19 -T0" \ + --absolute-names \ + --owner=0 \ + --group=0 \ + --numeric-owner \ + --format=gnu \ + --sort=name \ + --mtime="@$SOURCE_DATE_EPOCH" \ + --hard-dereference \ $releaseName ''; } From 5a052d98452d2015c47afde8ffe38c0ac24fc8c7 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 25 Jun 2026 15:54:59 +0200 Subject: [PATCH 4/5] nixos/doc/rl, doc/rl: announce nixexprs.tar.xz discontinuation We need to allow some time for users to migrate between the tarballs and can reasonably link that to the 26.11 EOL one year from now. Until then our channel and tarball jobs will be twice as big. (cherry picked from commit 6026336a39764b450a270174d1fd97bc7f670195) --- doc/release-notes/rl-2611.section.md | 12 +++++++++++- nixos/doc/manual/release-notes/rl-2611.section.md | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/doc/release-notes/rl-2611.section.md b/doc/release-notes/rl-2611.section.md index 6f2246688d21..b2ed8a86318b 100644 --- a/doc/release-notes/rl-2611.section.md +++ b/doc/release-notes/rl-2611.section.md @@ -4,7 +4,17 @@ -- Create the first release note entry in this section! +- The {file}`nixexprs.tar.xz` tarball will be discontinued together with Nixpkgs + 27.05 after 2027-12-31. Migrate to the {file}`nixexprs.tar.zst` tarball + instead. + + This affects for example users who pull Nixpkgs as a flake input from + https://channels.nixos.org: + + ```diff + -nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz"; + +nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst"; + ``` ## Backward Incompatibilities {#sec-nixpkgs-release-26.11-incompatibilities} diff --git a/nixos/doc/manual/release-notes/rl-2611.section.md b/nixos/doc/manual/release-notes/rl-2611.section.md index 4f3a9d0d9a80..1539b800fbcd 100644 --- a/nixos/doc/manual/release-notes/rl-2611.section.md +++ b/nixos/doc/manual/release-notes/rl-2611.section.md @@ -4,7 +4,17 @@ -- Create the first release note entry in this section! +- The {file}`nixexprs.tar.xz` tarball will be discontinued together with Nixpkgs + 27.05 after 2027-12-31. Migrate to the {file}`nixexprs.tar.zst` tarball + instead. + + This affects for example users who pull Nixpkgs as a flake input from + https://channels.nixos.org: + + ```diff + -nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz"; + +nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst"; + ``` ## New Modules {#sec-release-26.11-new-modules} From fb644007ef67409f6dcf3d8b9cfa735e49526681 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 8 Jul 2026 10:34:14 +0200 Subject: [PATCH 5/5] {nixos/channel,make-tarball.nix}: argue for unbounded compression threads (cherry picked from commit 54dc8286f92edbe3aa7129f5c242e2e68b37602e) --- nixos/lib/make-channel.nix | 3 +++ pkgs/top-level/make-tarball.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nixos/lib/make-channel.nix b/nixos/lib/make-channel.nix index fd2be792b7ac..098be3237dae 100644 --- a/nixos/lib/make-channel.nix +++ b/nixos/lib/make-channel.nix @@ -35,6 +35,9 @@ pkgs.releaseTools.makeSourceTarball { NIX_STATE_DIR=$TMPDIR nix-env -f ../$releaseName/default.nix -qaP --meta --show-trace --xml \* > /dev/null cd .. chmod -R u+w $releaseName + + # The compression tasks are shortlived; use all available CPUs (-T0) to + # prioritize fast channel advancement. XZ_OPT="-T0" tar \ --create \ --file=$out/tarballs/$releaseName.tar.xz \ diff --git a/pkgs/top-level/make-tarball.nix b/pkgs/top-level/make-tarball.nix index 356d519e82c9..eeaea8a32f36 100644 --- a/pkgs/top-level/make-tarball.nix +++ b/pkgs/top-level/make-tarball.nix @@ -64,6 +64,9 @@ pkgs.releaseTools.sourceTarball { # Some context: https://github.com/NixOS/infra/issues/438 distPhase = '' mkdir -p $out/tarballs + + # The compression tasks are shortlived; use all available CPUs (-T0) to + # prioritize fast channel advancement. XZ_OPT="-T0" tar \ --create \ --xz \