Nix  2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::Derivation Struct Reference
Inheritance diagram for nix::Derivation:
[legend]
Collaboration diagram for nix::Derivation:
[legend]

Public Member Functions

std::string unparse (const Store &store, bool maskOutputs, DerivedPathMap< StringSet >::ChildNode::Map *actualInputs=nullptr) const
 
kj::Promise< Result< std::optional< BasicDerivation > > > tryResolve (Store &store, Store *evalStore=nullptr) const
 
kj::Promise< Result< std::optional< BasicDerivation > > > tryResolve (Store &store, const std::map< std::pair< StorePath, std::string >, StorePath > &inputDrvOutputs) const
 
kj::Promise< Result< void > > checkInvariants (Store &store, const StorePath &drvPath) const
 
 Derivation (const BasicDerivation &bd)
 
 Derivation (BasicDerivation &&bd)
 
JSON toJSON (const Store &store) const
 
 GENERATE_CMP (Derivation, static_cast< const BasicDerivation & >(*me), me->inputDrvs)
 
- Public Member Functions inherited from nix::BasicDerivation
bool isBuiltin () const
 
DerivationType type () const
 
StringSet outputNames () const
 
DerivationOutputsAndOptPaths outputsAndOptPaths (const Store &store) const
 
 GENERATE_CMP (BasicDerivation, me->outputs, me->inputSrcs, me->platform, me->builder, me->args, me->env, me->name)
 

Static Public Member Functions

static Derivation fromJSON (const Store &store, const 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()

kj::Promise< Result< 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]

kj::Promise< Result< 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]

kj::Promise< Result< 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 Store & 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: