Nix  2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::fetchers::Input Struct Reference

#include <fetchers.hh>

Public Member Functions

ParsedURL toURL () const
 
std::string toURLString (const std::map< std::string, std::string > &extraQuery={}) const
 
std::string to_string () const
 
Attrs toAttrs () const
 
bool isDirect () const
 
bool isLocked () const
 
bool hasAllInfo () const
 
bool operator== (const Input &other) const
 
bool contains (const Input &other) const
 
kj::Promise< Result< std::pair< Tree, Input > > > fetch (ref< Store > store) const
 
Input applyOverrides (std::optional< std::string > ref, std::optional< Hash > rev) const
 
void clone (const Path &destDir) const
 
std::optional< PathgetSourcePath () const
 
void putFile (const CanonPath &path, std::string_view contents, std::optional< std::string > commitMsg) const
 
std::string getName () const
 
StorePath computeStorePath (Store &store) const
 
std::string getType () const
 
std::optional< HashgetNarHash () const
 
std::optional< std::string > getRef () const
 
std::optional< HashgetRev () const
 
std::optional< uint64_t > getRevCount () const
 
std::optional< time_t > getLastModified () const
 

Static Public Member Functions

static Input fromURL (const std::string &url, bool requireTree=true)
 
static Input fromURL (const ParsedURL &url, bool requireTree=true)
 
static Input fromAttrs (Attrs &&attrs)
 

Public Attributes

std::shared_ptr< InputSchemescheme
 
Attrs attrs
 
bool locked = false
 
bool direct = true
 
std::optional< Pathparent
 

Friends

struct InputScheme
 

Detailed Description

The Input object is generated by a specific fetcher, based on the user-supplied input attribute in the flake.nix file, and contains the information that the specific fetcher needs to perform the actual fetch. The Input object is most commonly created via the "fromURL()" or "fromAttrs()" static functions which are provided the url or attrset specified in the flake file.

Member Function Documentation

◆ fetch()

kj::Promise< Result< std::pair< Tree, Input > > > nix::fetchers::Input::fetch ( ref< Store > store) const

Fetch the input into the Nix store, returning the location in the Nix store and the locked input.

◆ hasAllInfo()

bool nix::fetchers::Input::hasAllInfo ( ) const

Check whether the input carries all necessary info required for cache insertion and substitution. These fields are used to uniquely identify cached trees within the "tarball TTL" window without necessarily indicating that the input's origin is unchanged.

◆ isDirect()

bool nix::fetchers::Input::isDirect ( ) const
inline

Check whether this is a "direct" input, that is, not one that goes through a registry.

◆ isLocked()

bool nix::fetchers::Input::isLocked ( ) const
inline

Check whether this is a "locked" input, that is, one that contains a commit hash or content hash.

◆ putFile()

void nix::fetchers::Input::putFile ( const CanonPath & path,
std::string_view contents,
std::optional< std::string > commitMsg ) const

Write a file to this input, for input types that support writing. Optionally commit the change (for e.g. Git inputs).

Member Data Documentation

◆ parent

std::optional<Path> nix::fetchers::Input::parent

path of the parent of this input, used for relative path resolution


The documentation for this struct was generated from the following files: