![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
#include <fetchers.hh>
Classes | |
| struct | AttributeInfo |
Public Member Functions | |
| virtual std::optional< Input > | inputFromURL (const ParsedURL &url, bool requireTree) const =0 |
| virtual std::optional< Input > | inputFromAttrs (const Attrs &attrs) const =0 |
| virtual std::string_view | schemeName () const =0 |
| virtual std::string | schemeDescription () const =0 |
| virtual const std::map< std::string, AttributeInfo > & | allowedAttrs () const =0 |
| virtual ParsedURL | toURL (const Input &input) const |
| virtual Input | applyOverrides (const Input &input, std::optional< std::string > ref, std::optional< Hash > rev) const |
| virtual void | clone (const Settings &settings, Store &store, const Input &input, const std::filesystem::path &destDir) const |
| virtual std::optional< std::filesystem::path > | getSourcePath (const Input &input) const |
| virtual void | putFile (const Input &input, const CanonPath &path, std::string_view contents, std::optional< std::string > commitMsg) const |
| virtual std::pair< ref< SourceAccessor >, Input > | getAccessor (const Settings &settings, Store &store, const Input &input) const =0 |
| virtual std::optional< ExperimentalFeature > | experimentalFeature () const |
| virtual bool | isDirect (const Input &input) const |
| virtual std::optional< std::string > | getFingerprint (Store &store, const Input &input) const |
| virtual bool | isLocked (const Settings &settings, const Input &input) const |
| virtual std::optional< std::filesystem::path > | isRelative (const Input &input) const |
| virtual std::optional< ParsedURL > | localRepoURL (const std::filesystem::path &path) const |
| virtual std::optional< std::string > | getAccessToken (const fetchers::Settings &settings, const std::string &host, const std::string &url) const |
The InputScheme represents a type of fetcher. Each fetcher registers with nix at startup time. When processing an Input, each scheme is given an opportunity to "recognize" that input from the user-provided url or attributes and return an Input object to represent the input if it is recognized. The Input object contains the information the fetcher needs to actually perform the fetch() when called.
|
pure virtual |
Allowed attributes in an attribute set that is converted to an input, and documentation for each attribute.
type is not included from this map, because the type field is parsed first to choose which scheme; type is always required.
Implemented in nix::fetchers::CurlInputScheme, nix::fetchers::GitArchiveInputScheme, nix::fetchers::GitInputScheme, nix::fetchers::IndirectInputScheme, nix::fetchers::MercurialInputScheme, nix::fetchers::PathInputScheme, and nix::fetchers::TarballInputScheme.
|
virtual |
Is this InputScheme part of an experimental feature?
Reimplemented in nix::fetchers::GitArchiveInputScheme, nix::fetchers::IndirectInputScheme, and nix::fetchers::PathInputScheme.
|
inlinevirtual |
A URL for path if it is the root of a repository of this scheme, e.g. a directory containing .git.
Reimplemented in nix::fetchers::GitInputScheme, and nix::fetchers::MercurialInputScheme.
|
pure virtual |
Longform description of this scheme, for documentation purposes.
Implemented in nix::fetchers::FileInputScheme, nix::fetchers::GitHubInputScheme, nix::fetchers::GitInputScheme, nix::fetchers::GitLabInputScheme, nix::fetchers::IndirectInputScheme, nix::fetchers::MercurialInputScheme, nix::fetchers::PathInputScheme, nix::fetchers::SourceHutInputScheme, and nix::fetchers::TarballInputScheme.
|
pure virtual |
What is the name of the scheme?
The type attribute is used to select which input scheme is used, and then the other fields are forwarded to that input scheme.
Implemented in nix::fetchers::FileInputScheme, nix::fetchers::GitHubInputScheme, nix::fetchers::GitInputScheme, nix::fetchers::GitLabInputScheme, nix::fetchers::IndirectInputScheme, nix::fetchers::MercurialInputScheme, nix::fetchers::PathInputScheme, nix::fetchers::SourceHutInputScheme, and nix::fetchers::TarballInputScheme.