diff --git a/src/libstore/derivation-options.cc b/src/libstore/derivation-options.cc index f6bac2868..40c4e6d15 100644 --- a/src/libstore/derivation-options.cc +++ b/src/libstore/derivation-options.cc @@ -138,7 +138,7 @@ DerivationOptions::fromStructuredAttrs(const StringMap & env, const StructuredAt if (auto maxClosureSize = get(output, "maxClosureSize")) checks.maxClosureSize = maxClosureSize->get(); - auto get_ = [&](const std::string & name) -> std::optional { + auto get_ = [&output = output](const std::string & name) -> std::optional { if (auto i = get(output, name)) { StringSet res; for (auto j = i->begin(); j != i->end(); ++j) {