1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

Add flake registry

This will eventually be moved to nixos.org.
This commit is contained in:
Eelco Dolstra 2019-02-11 13:01:39 +01:00
parent dcae46ab14
commit 52419f8db3
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 19 additions and 2 deletions

View file

@ -17,15 +17,19 @@ const EvalState::FlakeRegistry & EvalState::getFlakeRegistry()
if (!evalSettings.pureEval) {
#if 0
auto registryUri = "file:///home/eelco/Dev/gists/nix-flakes/registry.json";
auto registryFile = getDownloader()->download(DownloadRequest(registryUri));
#endif
auto json = nlohmann::json::parse(*registryFile.data);
auto registryFile = readFile(settings.nixDataDir + "/nix/flake-registry.json");
auto json = nlohmann::json::parse(registryFile);
auto version = json.value("version", 0);
if (version != 1)
throw Error("flake registry '%s' has unsupported version %d", registryUri, version);
throw Error("flake registry '%s' has unsupported version %d", registryFile, version);
auto flakes = json["flakes"];
for (auto i = flakes.begin(); i != flakes.end(); ++i) {