Nix 2.93.3
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
7
8namespace nix {
9
10class Store;
11
12typedef std::string FlakeId;
13
34struct FlakeRef
35{
41
46
47 bool operator==(const FlakeRef & other) const;
48
49 FlakeRef(fetchers::Input && input, const Path & subdir)
50 : input(std::move(input)), subdir(subdir)
51 { }
52
53 // FIXME: change to operator <<.
54 std::string to_string() const;
55
56 fetchers::Attrs toAttrs() const;
57
58 kj::Promise<Result<FlakeRef>> resolve(ref<Store> store) const;
59
60 static FlakeRef fromAttrs(const fetchers::Attrs & attrs);
61
62 kj::Promise<Result<std::pair<fetchers::Tree, FlakeRef>>> fetchTree(ref<Store> store) const;
63};
64
65std::ostream & operator << (std::ostream & str, const FlakeRef & flakeRef);
66
67FlakeRef parseFlakeRef(
68 const std::string & url,
69 const std::optional<Path> & baseDir = {},
70 bool allowMissing = false,
71 bool isFlake = true);
72
73std::optional<FlakeRef> maybeParseFlake(
74 const std::string & url, const std::optional<Path> & baseDir = {});
75
76std::pair<FlakeRef, std::string> parseFlakeRefWithFragment(
77 const std::string & url,
78 const std::optional<Path> & baseDir = {},
79 bool allowMissing = false,
80 bool isFlake = true);
81
82std::optional<std::pair<FlakeRef, std::string>> maybeParseFlakeRefWithFragment(
83 const std::string & url, const std::optional<Path> & baseDir = {});
84
85std::tuple<FlakeRef, std::string, ExtendedOutputsSpec> parseFlakeRefWithFragmentAndExtendedOutputsSpec(
86 const std::string & url,
87 const std::optional<Path> & baseDir = {},
88 bool allowMissing = false,
89 bool isFlake = true);
90
91
92}
Definition store-api.hh:195
Definition ref.hh:19
Definition flakeref.hh:35
Path subdir
Definition flakeref.hh:45
fetchers::Input input
Definition flakeref.hh:40
Definition fetchers.hh:39
std::string Path
Definition types.hh:28