1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 19:57:59 +02:00

Registry: Use attr notation instead of URLs

This commit is contained in:
Eelco Dolstra 2020-02-06 14:27:31 +01:00
parent be2580be01
commit 379852a152
5 changed files with 110 additions and 47 deletions

View file

@ -8,18 +8,7 @@ namespace nix::flake {
FlakeRef flakeRefFromJson(const nlohmann::json & json)
{
fetchers::Input::Attrs attrs;
for (auto & i : json.items()) {
if (i.value().is_number())
attrs.emplace(i.key(), i.value().get<int64_t>());
else if (i.value().is_string())
attrs.emplace(i.key(), i.value().get<std::string>());
else
throw Error("unsupported input attribute type in lock file");
}
return FlakeRef::fromAttrs(attrs);
return FlakeRef::fromAttrs(jsonToAttrs(json));
}
FlakeRef getFlakeRef(