nix: fix system/user registries (#401428)

This commit is contained in:
Jörg Thalheim
2025-04-25 09:16:41 +02:00
committed by GitHub
2 changed files with 55 additions and 0 deletions
@@ -186,6 +186,10 @@ lib.makeExtensible (
version = "2.28.2";
hash = "sha256-yl+hlZ/VFHIZwPIDEs4ysOYgprW4VEORfSyvScF7Cwg=";
self_attribute_name = "nix_2_28";
patches = [
# fixes user/system registries regression: https://github.com/NixOS/nix/issues/13050
./patches/0001-Revert-Actually-ignore-system-user-registries-during.patch
];
};
nixComponents_git = nixDependencies.callPackage ./modular/packages.nix rec {
@@ -0,0 +1,51 @@
From 8df4f5db3c71046f5deaeb913e5ec0d16f70b5a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Thu, 24 Apr 2025 14:17:18 +0200
Subject: [PATCH] Revert "Actually ignore system/user registries during
locking"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit a08477975d90dc0d2c9f89d2a417bedb5b266931.
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
src/libflake/flake/flakeref.cc | 2 +-
tests/functional/flakes/flakes.sh | 7 -------
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/src/libflake/flake/flakeref.cc b/src/libflake/flake/flakeref.cc
index 1580c2846..6e95eb767 100644
--- a/src/libflake/flake/flakeref.cc
+++ b/src/libflake/flake/flakeref.cc
@@ -39,7 +39,7 @@ FlakeRef FlakeRef::resolve(
ref<Store> store,
const fetchers::RegistryFilter & filter) const
{
- auto [input2, extraAttrs] = lookupInRegistries(store, input, filter);
+ auto [input2, extraAttrs] = lookupInRegistries(store, input);
return FlakeRef(std::move(input2), fetchers::maybeGetStrAttr(extraAttrs, "dir").value_or(subdir));
}
diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh
index b67a0964a..d8c9f254d 100755
--- a/tests/functional/flakes/flakes.sh
+++ b/tests/functional/flakes/flakes.sh
@@ -220,13 +220,6 @@ nix store gc
nix registry list --flake-registry "file://$registry" --refresh | grepQuiet flake3
mv "$registry.tmp" "$registry"
-# Ensure that locking ignores the user registry.
-mkdir -p "$TEST_HOME/.config/nix"
-ln -sfn "$registry" "$TEST_HOME/.config/nix/registry.json"
-nix flake metadata flake1
-expectStderr 1 nix flake update --flake-registry '' --flake "$flake3Dir" | grepQuiet "cannot find flake 'flake:flake1' in the flake registries"
-rm "$TEST_HOME/.config/nix/registry.json"
-
# Test whether flakes are registered as GC roots for offline use.
# FIXME: use tarballs rather than git.
rm -rf "$TEST_HOME/.cache"
--
2.49.0