mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-24 14:56:15 +02:00
Set lockedRef correctly
This commit is contained in:
parent
885a09c3fa
commit
ad4b7669db
3 changed files with 12 additions and 3 deletions
|
@ -203,6 +203,7 @@ static Flake readFlake(
|
|||
EvalState & state,
|
||||
const FlakeRef & originalRef,
|
||||
const FlakeRef & resolvedRef,
|
||||
const FlakeRef & lockedRef,
|
||||
InputAccessor & accessor,
|
||||
const InputPath & lockRootPath)
|
||||
{
|
||||
|
@ -220,7 +221,7 @@ static Flake readFlake(
|
|||
Flake flake {
|
||||
.originalRef = originalRef,
|
||||
.resolvedRef = resolvedRef,
|
||||
.lockedRef = resolvedRef, // FIXME
|
||||
.lockedRef = lockedRef,
|
||||
.path = flakePath,
|
||||
};
|
||||
|
||||
|
@ -319,9 +320,9 @@ static Flake getFlake(
|
|||
resolvedRef = originalRef.resolve(state.store);
|
||||
}
|
||||
|
||||
auto [accessor, input] = resolvedRef.input.lazyFetch(state.store);
|
||||
auto [accessor, lockedRef] = resolvedRef.lazyFetch(state.store);
|
||||
|
||||
return readFlake(state, originalRef, resolvedRef, state.registerAccessor(accessor), lockRootPath);
|
||||
return readFlake(state, originalRef, resolvedRef, lockedRef, state.registerAccessor(accessor), lockRootPath);
|
||||
}
|
||||
|
||||
Flake getFlake(EvalState & state, const FlakeRef & originalRef, bool allowLookup, FlakeCache & flakeCache)
|
||||
|
|
|
@ -238,6 +238,12 @@ std::pair<fetchers::Tree, FlakeRef> FlakeRef::fetchTree(ref<Store> store) const
|
|||
return {std::move(tree), FlakeRef(std::move(lockedInput), subdir)};
|
||||
}
|
||||
|
||||
std::pair<ref<InputAccessor>, FlakeRef> FlakeRef::lazyFetch(ref<Store> store) const
|
||||
{
|
||||
auto [accessor, lockedInput] = input.lazyFetch(store);
|
||||
return {accessor, FlakeRef(std::move(lockedInput), subdir)};
|
||||
}
|
||||
|
||||
std::tuple<FlakeRef, std::string, OutputsSpec> parseFlakeRefWithFragmentAndOutputsSpec(
|
||||
const std::string & url,
|
||||
const std::optional<Path> & baseDir,
|
||||
|
|
|
@ -58,6 +58,8 @@ struct FlakeRef
|
|||
static FlakeRef fromAttrs(const fetchers::Attrs & attrs);
|
||||
|
||||
std::pair<fetchers::Tree, FlakeRef> fetchTree(ref<Store> store) const;
|
||||
|
||||
std::pair<ref<InputAccessor>, FlakeRef> lazyFetch(ref<Store> store) const;
|
||||
};
|
||||
|
||||
std::ostream & operator << (std::ostream & str, const FlakeRef & flakeRef);
|
||||
|
|
Loading…
Reference in a new issue