1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-05 08:11:47 +02:00

Fix lock file generation

Before:

   "requires": {
        "nixpkgs": {
            "uri": "nixpkgs"
        }
    },

After:

    "requires": {
        "nixpkgs": {
            "uri": "github:edolstra/nixpkgs/f10e8a02eb7fa2b4a070f30cf87f4efcc7f3186d"
        }
    },
This commit is contained in:
Eelco Dolstra 2019-04-16 15:40:58 +02:00
parent 8c4e759efd
commit 3d0e81051f
4 changed files with 42 additions and 35 deletions

View file

@ -37,20 +37,28 @@ std::shared_ptr<FlakeRegistry> readRegistry(const Path &);
void writeRegistry(const FlakeRegistry &, const Path &);
struct FlakeSourceInfo
{
FlakeRef flakeRef;
Path storePath;
std::optional<Hash> rev;
std::optional<uint64_t> revCount;
// date
FlakeSourceInfo(const FlakeRef & flakeRef) : flakeRef(flakeRef) { }
};
struct Flake
{
FlakeId id;
FlakeRef ref;
std::string description;
Path path;
std::optional<uint64_t> revCount;
FlakeSourceInfo sourceInfo;
std::vector<FlakeRef> requires;
LockFile lockFile;
std::map<FlakeAlias, FlakeRef> nonFlakeRequires;
Value * vProvides; // FIXME: gc
// date
// content hash
Flake(const FlakeRef flakeRef) : ref(flakeRef) {};
Flake(const FlakeRef & flakeRef, FlakeSourceInfo && sourceInfo)
: ref(flakeRef), sourceInfo(sourceInfo) {};
};
struct NonFlake