Nix 2.26.3
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

Public Member Functions

virtual std::optional< InputinputFromURL (const Settings &settings, const ParsedURL &url, bool requireTree) const =0
 
virtual std::optional< InputinputFromAttrs (const Settings &settings, const Attrs &attrs) const =0
 
virtual std::string_view schemeName () const =0
 
virtual StringSet 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 Input &input, const 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 >, InputgetAccessor (ref< Store > store, const Input &input) const =0
 
virtual std::optional< ExperimentalFeatureexperimentalFeature () const
 
virtual bool isDirect (const Input &input) const
 
virtual std::optional< std::string > getFingerprint (ref< Store > store, const Input &input) const
 
virtual bool isLocked (const Input &input) const
 
virtual std::optional< std::string > isRelative (const Input &input) 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 StringSet nix::fetchers::InputScheme::allowedAttrs ( ) const
pure virtual

Allowed attributes in an attribute set that is converted to an input.

type is not included from this set, 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, and nix::fetchers::PathInputScheme.

◆ experimentalFeature()

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

◆ 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: