Nix  2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
flakeref.hh
Go to the documentation of this file.
1#pragma once
3
5#include "lix/libutil/hash.hh"
8
9#include <variant>
10
11namespace nix {
12
13class Store;
14
15typedef std::string FlakeId;
16
38{
44
49
50 bool operator==(const FlakeRef & other) const;
51
53 : input(std::move(input)), subdir(subdir)
54 { }
55
56 // FIXME: change to operator <<.
57 std::string to_string() const;
58
59 fetchers::Attrs toAttrs() const;
60
61 kj::Promise<Result<FlakeRef>> resolve(ref<Store> store) const;
62
63 static FlakeRef fromAttrs(const fetchers::Attrs & attrs);
64
65 kj::Promise<Result<std::pair<fetchers::Tree, FlakeRef>>> fetchTree(ref<Store> store) const;
66};
67
68std::ostream & operator << (std::ostream & str, const FlakeRef & flakeRef);
69
70FlakeRef parseFlakeRef(
71 const std::string & url,
72 const std::optional<Path> & baseDir = {},
73 bool allowMissing = false,
74 bool isFlake = true);
75
76std::optional<FlakeRef> maybeParseFlake(
77 const std::string & url, const std::optional<Path> & baseDir = {});
78
79std::pair<FlakeRef, std::string> parseFlakeRefWithFragment(
80 const std::string & url,
81 const std::optional<Path> & baseDir = {},
82 bool allowMissing = false,
83 bool isFlake = true);
84
85std::optional<std::pair<FlakeRef, std::string>> maybeParseFlakeRefWithFragment(
86 const std::string & url, const std::optional<Path> & baseDir = {});
87
88std::tuple<FlakeRef, std::string, ExtendedOutputsSpec> parseFlakeRefWithFragmentAndExtendedOutputsSpec(
89 const std::string & url,
90 const std::optional<Path> & baseDir = {},
91 bool allowMissing = false,
92 bool isFlake = true);
93
94
95}
Definition ref.hh:17
Definition flakeref.hh:38
Path subdir
Definition flakeref.hh:48
fetchers::Input input
Definition flakeref.hh:43
Definition fetchers.hh:39
std::string Path
Definition types.hh:28