From 184c6605b0719a7f35ab25b1f9526435b229eefb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Jul 2022 15:44:45 +0200 Subject: [PATCH] nix flake pin: Use lazyFetch() --- src/nix/registry.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/nix/registry.cc b/src/nix/registry.cc index c496f94f8..39d9702a0 100644 --- a/src/nix/registry.cc +++ b/src/nix/registry.cc @@ -183,14 +183,12 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand void run(nix::ref store) override { - if (locked.empty()) { - locked = url; - } + if (locked.empty()) locked = url; auto registry = getRegistry(); auto ref = parseFlakeRef(url); - auto locked_ref = parseFlakeRef(locked); + auto lockedRef = parseFlakeRef(locked); registry->remove(ref.input); - auto [tree, resolved] = locked_ref.resolve(store).input.fetch(store); + auto [accessor, resolved] = lockedRef.resolve(store).input.lazyFetch(store); fetchers::Attrs extraAttrs; if (ref.subdir != "") extraAttrs["dir"] = ref.subdir; registry->add(ref.input, resolved, extraAttrs);