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:
parent
dbefe9e6b8
commit
8414685c0f
12 changed files with 293 additions and 39 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue