diff --git a/src/libfetchers/parser.hh b/src/libfetchers/parser.hh index e700f8443ec..df5f20b3e5c 100644 --- a/src/libfetchers/parser.hh +++ b/src/libfetchers/parser.hh @@ -187,7 +187,7 @@ namespace nix::fetchers { this->parsers ); - schema = std::make_shared(Schema{attrSchema}); + schema = std::make_shared(attrSchema); this->attrSchema = std::get_if(&schema->choice); assert(this->attrSchema); } diff --git a/src/libfetchers/schema.hh b/src/libfetchers/schema.hh index 014c2d04f61..92238c0f699 100644 --- a/src/libfetchers/schema.hh +++ b/src/libfetchers/schema.hh @@ -42,6 +42,9 @@ struct Schema { std::variant choice; bool operator==(const Schema & other) const; + + Schema(Primitive && p) : choice(p) {}; + Schema(Attrs && p) : choice(p) {}; }; }