Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::fetchers::InputScheme Struct Referenceabstract

#include <fetchers.hh>

Inheritance diagram for nix::fetchers::InputScheme:
nix::fetchers::CurlInputScheme nix::fetchers::GitArchiveInputScheme nix::fetchers::GitInputScheme nix::fetchers::IndirectInputScheme nix::fetchers::MercurialInputScheme nix::fetchers::PathInputScheme nix::fetchers::FileInputScheme nix::fetchers::TarballInputScheme nix::fetchers::GitHubInputScheme nix::fetchers::GitLabInputScheme nix::fetchers::SourceHutInputScheme

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

Detailed Description

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.

Member Function Documentation

◆ allowedAttrs()

virtual const std::map< std::string, AttributeInfo > & nix::fetchers::InputScheme::allowedAttrs ( ) const
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.

◆ experimentalFeature()

std::optional< ExperimentalFeature > nix::fetchers::InputScheme::experimentalFeature ( ) const
virtual

◆ localRepoURL()

virtual std::optional< ParsedURL > nix::fetchers::InputScheme::localRepoURL ( const std::filesystem::path & path) const
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.

◆ schemeDescription()

◆ schemeName()

virtual std::string_view nix::fetchers::InputScheme::schemeName ( ) const
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.


The documentation for this struct was generated from the following files:
  • libfetchers/include/nix/fetchers/fetchers.hh
  • libfetchers/fetchers.cc