Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::Derivation Struct Reference
Inheritance diagram for nix::Derivation:
nix::BasicDerivation

Public Member Functions

std::string unparse (const StoreDirConfig &store, bool maskOutputs, DerivedPathMap< StringSet >::ChildNode::Map *actualInputs=nullptr) const
 
std::optional< BasicDerivationtryResolve (Store &store, Store *evalStore=nullptr) const
 
std::optional< BasicDerivationtryResolve (Store &store, const std::map< std::pair< StorePath, std::string >, StorePath > &inputDrvOutputs) const
 
void checkInvariants (Store &store, const StorePath &drvPath) const
 
 Derivation (const BasicDerivation &bd)
 
 Derivation (BasicDerivation &&bd)
 
nlohmann::json toJSON (const StoreDirConfig &store) const
 
bool operator== (const Derivation &) const =default
 
- Public Member Functions inherited from nix::BasicDerivation
 BasicDerivation (BasicDerivation &&)=default
 
 BasicDerivation (const BasicDerivation &)=default
 
BasicDerivationoperator= (BasicDerivation &&)=default
 
BasicDerivationoperator= (const BasicDerivation &)=default
 
bool isBuiltin () const
 
DerivationType type () const
 
StringSet outputNames () const
 
DerivationOutputsAndOptPaths outputsAndOptPaths (const StoreDirConfig &store) const
 
void applyRewrites (const StringMap &rewrites)
 
bool operator== (const BasicDerivation &) const =default
 

Static Public Member Functions

static Derivation fromJSON (const StoreDirConfig &store, const nlohmann::json &json, const ExperimentalFeatureSettings &xpSettings=experimentalFeatureSettings)
 
- Static Public Member Functions inherited from nix::BasicDerivation
static std::string_view nameFromPath (const StorePath &storePath)
 

Public Attributes

DerivedPathMap< std::set< OutputName > > inputDrvs
 
- Public Attributes inherited from nix::BasicDerivation
DerivationOutputs outputs
 
StorePathSet inputSrcs
 
std::string platform
 
Path builder
 
Strings args
 
StringPairs env
 
std::string name
 

Member Function Documentation

◆ checkInvariants()

void nix::Derivation::checkInvariants ( Store & store,
const StorePath & drvPath ) const

Check that the derivation is valid and does not present any illegal states.

This is mainly a matter of checking the outputs, where our C++ representation supports all sorts of combinations we do not yet allow.

◆ tryResolve() [1/2]

std::optional< BasicDerivation > nix::Derivation::tryResolve ( Store & store,
const std::map< std::pair< StorePath, std::string >, StorePath > & inputDrvOutputs ) const

Like the above, but instead of querying the Nix database for realisations, uses a given mapping from input derivation paths + output names to actual output store paths.

◆ tryResolve() [2/2]

std::optional< BasicDerivation > nix::Derivation::tryResolve ( Store & store,
Store * evalStore = nullptr ) const

Return the underlying basic derivation but with these changes:

  1. Input drvs are emptied, but the outputs of them that were used are added directly to input sources.
  2. Input placeholders are replaced with realized input store paths.

◆ unparse()

std::string nix::Derivation::unparse ( const StoreDirConfig & store,
bool maskOutputs,
DerivedPathMap< StringSet >::ChildNode::Map * actualInputs = nullptr ) const

Print a derivation.

Member Data Documentation

◆ inputDrvs

DerivedPathMap<std::set<OutputName> > nix::Derivation::inputDrvs

inputs that are sub-derivations


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