mirror of
https://github.com/NixOS/nix.git
synced 2025-12-06 00:51:00 +01:00
Ignore local registries for lock file generation
When resolving indirect flake references like `nixpkgs` in `flake.nix` files, Nix will no longer use the system and user flake registries. It will only use the global flake registry and overrides given on the command line via `--override-flake`.
This commit is contained in:
parent
ab5a9cf2db
commit
7ddf7300b5
8 changed files with 51 additions and 7 deletions
|
|
@ -178,7 +178,8 @@ Registries getRegistries(const Settings & settings, ref<Store> store)
|
|||
|
||||
std::pair<Input, Attrs> lookupInRegistries(
|
||||
ref<Store> store,
|
||||
const Input & _input)
|
||||
const Input & _input,
|
||||
const RegistryFilter & filter)
|
||||
{
|
||||
Attrs extraAttrs;
|
||||
int n = 0;
|
||||
|
|
@ -190,6 +191,7 @@ std::pair<Input, Attrs> lookupInRegistries(
|
|||
if (n > 100) throw Error("cycle detected in flake registry for '%s'", input.to_string());
|
||||
|
||||
for (auto & registry : getRegistries(*input.settings, store)) {
|
||||
if (filter && !filter(registry->type)) continue;
|
||||
// FIXME: O(n)
|
||||
for (auto & entry : registry->entries) {
|
||||
if (entry.exact) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue