12#include <nlohmann/json_fwd.hpp>
18namespace nix::fetchers {
33 friend struct InputScheme;
41 std::shared_ptr<InputScheme> scheme;
57 const std::string & url,
bool requireTree =
true);
61 const ParsedURL & url,
bool requireTree =
true);
74 std::string toURLString(
const std::map<std::string, std::string> & extraQuery = {})
const;
76 std::string to_string()
const;
78 Attrs toAttrs()
const;
106 std::optional<std::string>
isRelative()
const;
120 bool operator ==(
const Input & other)
const noexcept;
122 bool operator <(
const Input & other)
const
124 return attrs < other.attrs;
127 bool contains(
const Input & other)
const;
146 static void checkLocks(Input specified, Input & result);
157 std::pair<ref<SourceAccessor>, Input> getAccessorUnchecked(
ref<Store> store)
const;
161 Input applyOverrides(
162 std::optional<std::string>
ref,
163 std::optional<Hash> rev)
const;
165 void clone(
const Path & destDir)
const;
175 std::string_view contents,
176 std::optional<std::string> commitMsg)
const;
178 std::string getName()
const;
183 std::string getType()
const;
184 std::optional<Hash> getNarHash()
const;
185 std::optional<std::string> getRef()
const;
186 std::optional<Hash> getRev()
const;
187 std::optional<uint64_t> getRevCount()
const;
215 virtual std::optional<Input> inputFromURL(
217 const ParsedURL & url,
bool requireTree)
const = 0;
219 virtual std::optional<Input> inputFromAttrs(
221 const Attrs & attrs)
const = 0;
243 virtual Input applyOverrides(
245 std::optional<std::string>
ref,
246 std::optional<Hash> rev)
const;
248 virtual void clone(
const Input & input,
const Path & destDir)
const;
250 virtual std::optional<std::filesystem::path>
getSourcePath(
const Input & input)
const;
252 virtual void putFile(
255 std::string_view contents,
256 std::optional<std::string> commitMsg)
const;
265 virtual bool isDirect(
const Input & input)
const
269 {
return std::nullopt; }
271 virtual bool isLocked(
const Input & input)
const
274 virtual std::optional<std::string> isRelative(
const Input & input)
const
275 {
return std::nullopt; }
278void registerInputScheme(std::shared_ptr<InputScheme> && fetcher);
280nlohmann::json dumpRegisterInputSchemeInfo();
284 std::string type =
"ssh-ed25519";
287 auto operator <=>(
const PublicKey &)
const =
default;
290std::string publicKeys_to_string(
const std::vector<PublicKey>&);
std::map< std::string, Attr > Attrs
Definition attrs.hh:22
Definition canon-path.hh:41
Definition store-api.hh:169
ChunkedVector< std::string, 8192 > store
Definition lexer.l:1011
std::optional< SourcePath > getSourcePath() const
Definition lexer.l:6577
virtual std::optional< time_t > getLastModified()
Definition lexer.l:4585
Definition source-accessor.hh:42
Definition fetchers.hh:283
Definition fetch-settings.hh:15
std::string Path
Definition types.hh:22