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:
parent
be2580be01
commit
379852a152
5 changed files with 110 additions and 47 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue