1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 03:01:47 +02:00

fetchOrSubstituteTree(): Return an accessor

This prepares lazy access to flake.nix etc.
This commit is contained in:
Eelco Dolstra 2025-02-04 16:14:34 +01:00
parent 3c109095de
commit 1ab97a70f5
4 changed files with 54 additions and 19 deletions

View file

@ -289,6 +289,12 @@ std::pair<StorePath, FlakeRef> FlakeRef::fetchTree(ref<Store> store) const
return {std::move(storePath), FlakeRef(std::move(lockedInput), subdir)};
}
std::pair<ref<SourceAccessor>, FlakeRef> FlakeRef::lazyFetch(ref<Store> store) const
{
auto [accessor, lockedInput] = input.getAccessor(store);
return {accessor, FlakeRef(std::move(lockedInput), subdir)};
}
std::tuple<FlakeRef, std::string, ExtendedOutputsSpec> parseFlakeRefWithFragmentAndExtendedOutputsSpec(
const fetchers::Settings & fetchSettings,
const std::string & url,