diff options
Diffstat (limited to 'src/libexpr/flake/flakeref.hh')
-rw-r--r-- | src/libexpr/flake/flakeref.hh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libexpr/flake/flakeref.hh b/src/libexpr/flake/flakeref.hh index f552c99d8..9febc639d 100644 --- a/src/libexpr/flake/flakeref.hh +++ b/src/libexpr/flake/flakeref.hh @@ -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); |