1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 23:03:53 -04:00

Include "original" and "locked" in nix flake prefetch --json

This commit is contained in:
Andrea Bedini 2023-09-18 16:57:18 +08:00 committed by tomberek
parent 62ddb6851f
commit add7c99c3b

View file

@ -1342,6 +1342,8 @@ struct CmdFlakePrefetch : FlakeCommand, MixJSON
auto res = nlohmann::json::object();
res["storePath"] = store->printStorePath(tree.storePath);
res["hash"] = hash.to_string(SRI, true);
res["original"] = fetchers::attrsToJSON(resolvedRef.toAttrs());
res["locked"] = fetchers::attrsToJSON(lockedRef.toAttrs());
logger->cout(res.dump());
} else {
notice("Downloaded '%s' to '%s' (hash '%s').",