Skip to content

Commit dda265f

Browse files
committed
Reapply "Actually ignore system/user registries during locking"
This reverts commit 3b5f0d9.
1 parent 7880afc commit dda265f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/libflake/flakeref.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ FlakeRef FlakeRef::resolve(
3939
ref<Store> store,
4040
const fetchers::RegistryFilter & filter) const
4141
{
42-
auto [input2, extraAttrs] = lookupInRegistries(store, input);
42+
auto [input2, extraAttrs] = lookupInRegistries(store, input, filter);
4343
return FlakeRef(std::move(input2), fetchers::maybeGetStrAttr(extraAttrs, "dir").value_or(subdir));
4444
}
4545

tests/functional/flakes/flakes.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ nix store gc
220220
nix registry list --flake-registry "file://$registry" --refresh | grepQuiet flake3
221221
mv "$registry.tmp" "$registry"
222222

223+
# Ensure that locking ignores the user registry.
224+
mkdir -p "$TEST_HOME/.config/nix"
225+
ln -sfn "$registry" "$TEST_HOME/.config/nix/registry.json"
226+
nix flake metadata flake1
227+
expectStderr 1 nix flake update --flake-registry '' --flake "$flake3Dir" | grepQuiet "cannot find flake 'flake:flake1' in the flake registries"
228+
rm "$TEST_HOME/.config/nix/registry.json"
229+
223230
# Test whether flakes are registered as GC roots for offline use.
224231
# FIXME: use tarballs rather than git.
225232
rm -rf "$TEST_HOME/.cache"

0 commit comments

Comments
 (0)