diff --git a/lix/libexpr/flake/flake.cc b/lix/libexpr/flake/flake.cc index 3317026eb..2943925aa 100644 --- a/lix/libexpr/flake/flake.cc +++ b/lix/libexpr/flake/flake.cc @@ -943,16 +943,14 @@ LockedFlake lockFlake( Value callFlake(EvalState & state, const LockedFlake & lockedFlake) { Value vLocks; - Value vRootSrc; Value vRootSubdir; vLocks = {NewValueAs::string, lockedFlake.lockFile.to_string()}; - emitTreeAttrs( + Value vRootSrc = emitTreeAttrs( state.ctx, *lockedFlake.flake.sourceInfo, lockedFlake.flake.lockedRef.input, - vRootSrc, false, lockedFlake.flake.forceDirty ); diff --git a/lix/libexpr/flake/flake.hh b/lix/libexpr/flake/flake.hh index bdd848133..478e48d6a 100644 --- a/lix/libexpr/flake/flake.hh +++ b/lix/libexpr/flake/flake.hh @@ -202,12 +202,11 @@ LockedFlake lockFlake( Value callFlake(EvalState & state, const LockedFlake & lockedFlake); } -void emitTreeAttrs( +Value emitTreeAttrs( Evaluator & state, const fetchers::Tree & tree, const fetchers::Input & input, - Value & v, bool emptyRevFallback = false, - bool forceDirty = false); - + bool forceDirty = false +); } diff --git a/lix/libexpr/primops/fetchTree.cc b/lix/libexpr/primops/fetchTree.cc index ddba5567a..f0f90cd12 100644 --- a/lix/libexpr/primops/fetchTree.cc +++ b/lix/libexpr/primops/fetchTree.cc @@ -14,13 +14,13 @@ namespace nix { -void emitTreeAttrs( +Value emitTreeAttrs( Evaluator & state, const fetchers::Tree & tree, const fetchers::Input & input, - Value & v, bool emptyRevFallback, - bool forceDirty) + bool forceDirty +) { assert(input.isLocked()); @@ -71,7 +71,7 @@ void emitTreeAttrs( }; } - v = {NewValueAs::attrs, attrs}; + return {NewValueAs::attrs, attrs}; } std::string fixURI(std::string uri, EvalState & state, const std::string & defaultScheme = "file") @@ -223,7 +223,7 @@ static void fetchTree( state.ctx.paths.allowPath(tree.storePath); - emitTreeAttrs(state.ctx, tree, input2, v, params.emptyRevFallback, false); + v = emitTreeAttrs(state.ctx, tree, input2, params.emptyRevFallback, false); } void prim_fetchTree(EvalState & state, Value * * args, Value & v)