1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-23 02:39:37 +01:00

Make flake input fetching lazy

As long as the flake input is locked, it is now only fetched when it
is evaluated (e.g. "nixpkgs" is fetched when
"inputs.nixpkgs.<something>" is evaluated).

This required adding an "id" attribute to the members of "inputs" in
lockfiles, e.g.

  "inputs": {
    "nixpkgs/release-19.03": {
      "id": "nixpkgs",
      "inputs": {},
      "narHash": "sha256-eYtxncIMFVmOHaHBtTdPGcs/AnJqKqA6tHCm0UmPYQU=",
      "nonFlakeInputs": {},
      "uri": "github:edolstra/nixpkgs/e9d5882bb861dc48f8d46960e7c820efdbe8f9c1"
    }
  }

because the flake ID needs to be known beforehand to construct the
"inputs" attrset.

Fixes #2913.
This commit is contained in:
Eelco Dolstra 2019-06-04 19:10:35 +02:00
parent c7c562416c
commit 6dbd5c26e6
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
6 changed files with 272 additions and 187 deletions

10
src/nlohmann/json_fwd.hpp Normal file
View file

@ -0,0 +1,10 @@
#pragma once
namespace nlohmann {
struct json : basic_json<>
{
using basic_json<>::basic_json;
};
}