PSA: Use nixos.org tarballs for your flake inputs!

In theory the zstd version should be an order of magnitude faster to decompress after downloading. In practice:

$ time xz -d ./nixexprs.tar.xz
xz -d ./nixexprs.tar.xz  3.67s user 0.44s system 431% cpu 0.953 total

$ time zstd -d ./nixexprs.tar.zst
./nixexprs.tar.zst  : 279162880 bytes
zstd -d ./nixexprs.tar.zst  0.23s user 0.14s system 150% cpu 0.244 total

It is in fact an order of magnitude difference, but how much that 3sec or so matters to you depends on what you’re doing.

4 Likes

The xz tarballs will eventually be deprecated

9 Likes

I’d like some clarification on that

When I set up my system, I had to do a whole thing with nix-index and change my fish configuration

Am I understanding correctly that this is no longer required, and a stock install with the above nixpkgs.url = will have things set up so that cowsay (without it installed) will print something like the following ?

The program 'cowsay' is currently not installed. It is provided by
several packages. You can try it by typing one of the following:

  nix-shell -p neo-cowsay
  nix-shell -p cowsay
2 Likes

Yes, it should work out of the box with 26.05 or unstable at this point. It looks in the nixpkgs tree being used for pkgs, and if it finds a programs.sqlite file, it enables automatically:

10 Likes

Nice thanks, I’ll update my config asap !

Thanks for this PSA! I’ve added a little function to my Nix flake input/lock syncer that automatically goes and proposes updates to nixos.org tarballs where possible, so I don’t have to do this manually for all my flakes (or update which revisions are locked before I care to):

$ iqan tarball .
Flake: /Users/kivikakk/g/vyx
----------------------------

input nixpkgs-unstable can use the nixos-unstable channel tarball
in flake.nix: github:NixOS/nixpkgs/nixos-unstable -> https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst
release: nixos-26.11pre1064949.34ab99075ac4 (rev unchanged)
locked:  https://releases.nixos.org/nixos/unstable/nixos-26.11pre1064949.34ab99075ac4/nixexprs.tar.zst
(C)onvert to tarball, or (I)gnore? C

input nixpkgs-darwin can use the nixpkgs-26.05-darwin channel tarball
in flake.nix: github:NixOS/nixpkgs/nixpkgs-26.05-darwin -> https://channels.nixos.org/nixpkgs-26.05-darwin/nixexprs.tar.zst
release: nixpkgs-darwin-26.05pre1012914.f6107e546a50 (rev unchanged)
locked:  https://releases.nixos.org/nixpkgs/26.05-darwin/nixpkgs-darwin-26.05pre1012914.f6107e546a50/nixexprs.tar.zst
(C)onvert to tarball, or (I)gnore? C

input nixpkgs can use the nixos-26.05 channel tarball
in flake.nix: github:NixOS/nixpkgs/nixos-26.05 -> https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst
release: nixos-26.05.8639.c5c4a43b0e80 (rev unchanged)
locked:  https://releases.nixos.org/nixos/26.05/nixos-26.05.8639.c5c4a43b0e80/nixexprs.tar.zst
(C)onvert to tarball, or (I)gnore? C

input nixpkgs-iosevka can use the nixos-25.11 channel tarball
in flake.nix: github:NixOS/nixpkgs/nixos-25.11 -> https://channels.nixos.org/nixos-25.11/nixexprs.tar.zst
release: nixos-25.11.6495.e764fc9a4058 (rev unchanged)
locked:  https://releases.nixos.org/nixos/25.11/nixos-25.11.6495.e764fc9a4058/nixexprs.tar.xz
(C)onvert to tarball, or (I)gnore? C
$
5 Likes

There was a thread where @TLATER mentioned this a while ago, albeit with the .xz archives instead.

At the time, I’d made a PR on the Nix templates repo (which I see you’ve found) Move channels to tarballs by peterc-s · Pull Request #100 · NixOS/templates · GitHub

I might get round to swapping it over to the .tar.zst archives instead but the PR was incomplete and no maintainer has commented.

2 Likes

If you want to update it, then I’ll do my best to get someone to merge it :slight_smile:

Awesome, switched immediately! Are there any hosted mirrors of nix-community repos such as home-manager or stylix? If not, might be a good next step

1 Like

That would be up to those projects to host and serve compliant tarballs.

1 Like

Or anyone could set up a Git mirror of the repositories outside of GitHub.

Nixpkgs is a special case because of how large it is and how frequently it changes; publishing tarballs on official infra is more practical than expecting some poor community member to keep an up-to-date mirror of that whole thing. But Home Manager, Stylix, etc. are much more tractable, and Git mirroring is a common enough desire for there to be several off-the-shelf solutions for it. Just about anyone who cares about reducing our GitHub dependency could be the change they want to see, with respect to those projects.

2 Likes

That already exists for h-m at Robert Helgesson / home-manager · GitLab.
Dunno about stylix.

2 Likes

I’ve updated it! Still not sure if you will get anyone to merge it as it seems like it’s not actively maintained.

Hey, I have a little question: Is this working (= should this work) for overlays?

Thanks + KR


I use this inputs in my flake:

  • nixpkgs.url = “https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz”;
  • nixpkgs-unstable.url = “https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz”;
    • (I uses this as pkgs.unstable.PACKAGE)

Today I tried this overlay to install bun from the unstable channel (w/ pkgs.unstable.bun).
After rebuilding I got bun version 1.3.13 (w/ bun -v), which is the current stable version.

After that I switched (back) the unstable input to nixpkgs-unstable.url = “github:nixos/nixpkgs/nixos-unstable?shallow=1”;, rebuilt and got bun version 1.4.2 (w/ bun -v), which is the current unstable version.

Wdym by overlay? Share your code.

2 Likes

Strangely enough, I can confirm this lol. I’m also using the tarballs, switched as of yesterday, and pkgs.bun.version reports 1.3.13.

That’s odd.

$ nix-instantiate -I "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" --eval --expr "(import <nixpkgs> {}).bun.version"
unpacking 'https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz' into the Git cache...
"1.4.2"

Also just tried:

$ cat flake.nix 
{
  description = "A very basic flake";

  inputs = {
    nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.zst";
  };

  outputs = inputs: {
    packages = builtins.mapAttrs (system: pkgs: {
      hello = pkgs.hello;

      bun = pkgs.bun;

      default = inputs.self.packages.${system}.hello;
    }) inputs.nixpkgs.legacyPackages;
  };
}


$ NIX_CONFIG="extra-experimental-features = nix-command flakes" nix eval .#bun.version
warning: creating lock file "/home/user/tmp/flake_tarball_test/flake.lock": 
• Added input 'nixpkgs':
    'https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1072974.02f5696b0e60/nixexprs.tar.zst?narHash=sha256-iR1Jj6svMpvLxPWA40qp%2BWUpg3MStLXJy5TZrP2cPes%3D' (2026-09-13)
"1.4.2"

Impossible to help diagnose that without seeing your config. Overlays as a whole are definitely not affected. This is me testing to make sure:

$ git diff -p
...
   my.user.packages = builtins.attrValues {
     inherit (pkgs)
       amdgpu_top
+      bun
       caligula # image flashing
       dorion # discord
       element-desktop
...
       patches = [ ./tokyonight-customization.patch ];
     });
   };
+  bunTestOverlay = self: super: {
+    bun = super.callPackage "${inputs.unstable}/pkgs/by-name/bu/bun/package.nix" {};
+  };
 }

Result:

$ bun --version
1.4.2

Are you sure your flake.lock wasn’t just on a stale version of unstable?

Try reproducing the problem and then running nix flake metadata to check which version of unstable your input is pointing to. Mine looks like this:

unstable: https://releases.nixos.org/nixos/unstable/nixos-26.11pre1073009.ef34387ddd75/nixexprs.tar.zst?narHash=sha256-3i80JnZ9pZ7tWReb/Sqpc32cfzffCu8TWLnbnH0hN9c%3D (2026-09-13 08:01:44)

nixos-unstable moved from bun 1.3.13 to 1.4.2 roughly 7 hours ago. Yesterday, 1.3.13 was the expected version.

3 Likes