nix flake info --json: Dump attr-style flakeref

This commit is contained in:
Eelco Dolstra 2020-03-28 22:59:38 +01:00
parent 2fccef0c59
commit 4989c04dd2

View file

@ -100,6 +100,8 @@ static nlohmann::json flakeToJson(const Store & store, const Flake & flake)
j["description"] = *flake.description;
j["edition"] = flake.edition;
j["url"] = flake.lockedRef.to_string();
j["original"] = attrsToJson(flake.originalRef.toAttrs());
j["locked"] = attrsToJson(flake.lockedRef.toAttrs());
if (auto rev = flake.lockedRef.input->getRev())
j["revision"] = rev->to_string(Base16, false);
if (flake.sourceInfo->info.revCount)