mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-24 14:56:15 +02:00
nix flake pin: Use lazyFetch()
This commit is contained in:
parent
c0555c8e1f
commit
184c6605b0
1 changed files with 3 additions and 5 deletions
|
@ -183,14 +183,12 @@ struct CmdRegistryPin : RegistryCommand, EvalCommand
|
|||
|
||||
void run(nix::ref<nix::Store> 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);
|
||||
|
|
Loading…
Reference in a new issue