aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/flake/flakeref.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-01-31 19:16:40 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-01-31 19:16:40 +0100
commit8414685c0f0c0d744c70d438894e4ecd7a078808 (patch)
tree3c7ca4bf6116f0d7dc863f4737518213767e7455 /src/libexpr/flake/flakeref.hh
parentdbefe9e6b8e4db54be0bd63d3318019d0e3043ac (diff)
Change lock file format to use an attribute representation of flake refs rather than URLs
Diffstat (limited to 'src/libexpr/flake/flakeref.hh')
-rw-r--r--src/libexpr/flake/flakeref.hh7
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);