From 122a9ae66c0121367e4e1d7fa2a9343762c7d6b1 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Sat, 27 Jun 2026 00:04:39 +0300 Subject: [PATCH 1/2] Pull nixpkgs as tarball from channels.nixos.org Actually working solution for https://github.com/NixOS/flake-registry/pull/61. Don't even ask what "exact" is doing here, but it's load-bearing for this to work. Stuff like `nix flake metadata nixpkgs/nixos-26.05` uses the channel tarballs, while `nix flake metadata nixpkgs/master` falls back to `github:nixos/nixpkgs/master`. --- flake-registry.json | 83 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/flake-registry.json b/flake-registry.json index b5e62e1..70cbb5a 100644 --- a/flake-registry.json +++ b/flake-registry.json @@ -331,6 +331,89 @@ "type": "github" } }, + { + "from": { + "id": "nixpkgs", + "type": "indirect" + }, + "exact": true, + "to": { + "type": "tarball", + "url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz" + } + }, + { + "from": { + "id": "nixpkgs", + "type": "indirect", + "ref": "nixpkgs-unstable" + }, + "exact": true, + "to": { + "type": "tarball", + "url": "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz" + } + }, + { + "from": { + "id": "nixpkgs", + "type": "indirect", + "ref": "nixos-unstable" + }, + "exact": true, + "to": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz" + } + }, + { + "from": { + "id": "nixpkgs", + "type": "indirect", + "ref": "nixos-unstable-small" + }, + "exact": true, + "to": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-unstable-small/nixexprs.tar.xz" + } + }, + { + "from": { + "id": "nixpkgs", + "type": "indirect", + "ref": "nixos-26.05" + }, + "exact": true, + "to": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz" + } + }, + { + "from": { + "id": "nixpkgs", + "type": "indirect", + "ref": "nixos-26.05-small" + }, + "exact": true, + "to": { + "type": "tarball", + "url": "https://channels.nixos.org/nixos-26.05-small/nixexprs.tar.xz" + } + }, + { + "from": { + "id": "nixpkgs", + "type": "indirect", + "ref": "nixpkgs-26.05-darwin" + }, + "exact": true, + "to": { + "type": "tarball", + "url": "https://channels.nixos.org/nixpkgs-26.05-darwin/nixexprs.tar.xz" + } + }, { "from": { "id": "nixpkgs", From 147c155dfd5e25a949b998ac486490c28e23c64b Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman Date: Sat, 27 Jun 2026 00:17:07 +0300 Subject: [PATCH 2/2] Disable sortedness check Registry resolution algorithm is order-dependent, and to get the desired behavior with nixpkgs the indirect entry to `github:nixos/nixpkgs` should come after all other exact entries. --- ci.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci.sh b/ci.sh index f6a4ccb..b4fa04f 100755 --- a/ci.sh +++ b/ci.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -# Test that the flake-registry.json format is sorted & valid +# Test that the flake-registry.json format is valid set -euo pipefail cd "$(dirname "$0")" # Ensure current flake-registry.json file is sorted. -nix registry list --tarball-ttl 0 --flake-registry "$PWD/flake-registry.json" \ - | grep -- '^global ' | LC_ALL=C sort -u -c +nix registry list --tarball-ttl 0 --flake-registry "$PWD/flake-registry.json" | + grep -- '^global ' nix run --flake-registry "$PWD/flake-registry.json" nixpkgs#hello