Change lock file format to use an attribute representation of flake refs rather than URLs
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user