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

#include <derived-path.hh>

Public Member Functions

const StorePath & getBaseStorePath () const
std::string to_string (const StoreDirConfig &store) const
std::string to_string_legacy (const StoreDirConfig &store) const
bool operator== (const DerivedPathBuilt &) const noexcept
bool operator< (const DerivedPathBuilt &) const noexcept

Static Public Member Functions

static DerivedPathBuilt parse (const StoreDirConfig &store, ref< const SingleDerivedPath >, std::string_view, const ExperimentalFeatureSettings &xpSettings=experimentalFeatureSettings)

Public Attributes

ref< const SingleDerivedPath > drvPath
OutputsSpec outputs

Detailed Description

A set of derived paths that are built from a derivation

Built derived paths are pair of a derivation and some output names. They are evaluated by building the derivation, and then replacing the output names with the resulting outputs.

Note that does mean a derived store paths evaluates to multiple opaque paths, which is sort of icky as expressions are supposed to evaluate to single values. Perhaps this should have just a single output name.

Member Function Documentation

◆ getBaseStorePath()

const StorePath & nix::DerivedPath::Built::getBaseStorePath ( ) const

Get the store path this is ultimately derived from (by realising and projecting outputs).

Note that this is not a property of the store object being referred to, but just of this path — how we happened to be referring to that store object. In other words, this means this function breaks "referential transparency". It should therefore be used only with great care.

◆ parse()

DerivedPath::Built nix::DerivedPath::Built::parse ( const StoreDirConfig & store,
ref< const SingleDerivedPath > drv,
std::string_view outputsS,
const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings )
static

The caller splits on the separator, so it works for both variants.

Parameters
xpSettingsStop-gap to avoid globals during unit tests.

◆ to_string()

std::string nix::DerivedPath::Built::to_string ( const StoreDirConfig & store) const

Uses ^ as the separator

◆ to_string_legacy()

std::string nix::DerivedPath::Built::to_string_legacy ( const StoreDirConfig & store) const

Uses ! as the separator


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