1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 06:21:14 +02:00

Change lock file format to use an attribute representation of flake refs rather than URLs

This commit is contained in:
Eelco Dolstra 2020-01-31 19:16:40 +01:00
parent dbefe9e6b8
commit 8414685c0f
12 changed files with 293 additions and 39 deletions

View file

@ -2,6 +2,7 @@
#include "types.hh"
#include "hash.hh"
#include "fetchers/fetchers.hh"
#include <variant>
@ -9,8 +10,6 @@ namespace nix {
class Store;
namespace fetchers { struct Input; }
typedef std::string FlakeId;
struct FlakeRef
@ -30,6 +29,8 @@ struct FlakeRef
// FIXME: change to operator <<.
std::string to_string() const;
fetchers::Input::Attrs toAttrs() const;
/* Check whether this is a "direct" flake reference, that is, not
a flake ID, which requires a lookup in the flake registry. */
bool isDirect() const;
@ -39,6 +40,8 @@ struct FlakeRef
bool isImmutable() const;
FlakeRef resolve(ref<Store> store) const;
static FlakeRef fromAttrs(const fetchers::Input::Attrs & attrs);
};
std::ostream & operator << (std::ostream & str, const FlakeRef & flakeRef);