@@ -1523,7 +1523,7 @@ adl_serializer<DerivationOutput>::from_json(const json & _json, const Experiment
15231523 }
15241524}
15251525
1526- void adl_serializer<Derivation >::to_json(json & res, const Derivation & d)
1526+ void adl_serializer<BasicDerivation >::to_json(json & res, const BasicDerivation & d)
15271527{
15281528 res = nlohmann::json::object ();
15291529
@@ -1549,24 +1549,6 @@ void adl_serializer<Derivation>::to_json(json & res, const Derivation & d)
15491549 for (auto & input : d.inputSrcs )
15501550 inputsList.emplace_back (input);
15511551 }
1552-
1553- auto doInput = [&](this const auto & doInput, const auto & inputNode) -> nlohmann::json {
1554- auto value = nlohmann::json::object ();
1555- value[" outputs" ] = inputNode.value ;
1556- {
1557- auto next = nlohmann::json::object ();
1558- for (auto & [outputId, childNode] : inputNode.childMap )
1559- next[outputId] = doInput (childNode);
1560- value[" dynamicOutputs" ] = std::move (next);
1561- }
1562- return value;
1563- };
1564-
1565- auto & inputDrvsObj = inputsObj[" drvs" ];
1566- inputDrvsObj = nlohmann::json::object ();
1567- for (auto & [inputDrv, inputNode] : d.inputDrvs .map ) {
1568- inputDrvsObj[inputDrv.to_string ()] = doInput (inputNode);
1569- }
15701552 }
15711553
15721554 res[" system" ] = d.platform ;
@@ -1578,6 +1560,28 @@ void adl_serializer<Derivation>::to_json(json & res, const Derivation & d)
15781560 res[" structuredAttrs" ] = d.structuredAttrs ->structuredAttrs ;
15791561}
15801562
1563+ void adl_serializer<Derivation>::to_json(json & res, const Derivation & d)
1564+ {
1565+ adl_serializer<BasicDerivation>::to_json (res, static_cast <const BasicDerivation &>(d));
1566+
1567+ auto doInput = [&](this const auto & doInput, const auto & inputNode) -> nlohmann::json {
1568+ auto value = nlohmann::json::object ();
1569+ value[" outputs" ] = inputNode.value ;
1570+ {
1571+ auto next = nlohmann::json::object ();
1572+ for (auto & [outputId, childNode] : inputNode.childMap )
1573+ next[outputId] = doInput (childNode);
1574+ value[" dynamicOutputs" ] = std::move (next);
1575+ }
1576+ return value;
1577+ };
1578+
1579+ auto & inputDrvsObj = res[" inputs" ][" drvs" ];
1580+ inputDrvsObj = nlohmann::json::object ();
1581+ for (auto & [inputDrv, inputNode] : d.inputDrvs .map )
1582+ inputDrvsObj[inputDrv.to_string ()] = doInput (inputNode);
1583+ }
1584+
15811585Derivation adl_serializer<Derivation>::from_json(const json & _json, const ExperimentalFeatureSettings & xpSettings)
15821586{
15831587 using nlohmann::detail::value_t ;
0 commit comments