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

#include <derived-path.hh>

Inheritance diagram for nix::DerivedPath:

Public Types

using Raw = _DerivedPathRaw
 
using Opaque = DerivedPathOpaque
 
using Built = DerivedPathBuilt
 

Public Member Functions

const Raw & raw () const
 
bool operator== (const DerivedPath &) const =default
 
const StorePathgetBaseStorePath () const
 
std::string to_string (const StoreDirConfig &store) const
 
std::string to_string_legacy (const StoreDirConfig &store) const
 
nlohmann::json toJSON (Store &store) const
 

Static Public Member Functions

static DerivedPath parse (const StoreDirConfig &store, std::string_view, const ExperimentalFeatureSettings &xpSettings=experimentalFeatureSettings)
 
static DerivedPath parseLegacy (const StoreDirConfig &store, std::string_view, const ExperimentalFeatureSettings &xpSettings=experimentalFeatureSettings)
 
static DerivedPath fromSingle (const SingleDerivedPath &)
 

Detailed Description

A "derived path" is a very simple sort of expression that evaluates to one or more (concrete) store paths. It is either:

  • opaque, in which case it is just a single concrete store path with possibly no known derivation
  • built, in which case it is a pair of a derivation path and some output names.

Member Function Documentation

◆ fromSingle()

DerivedPath nix::DerivedPath::fromSingle ( const SingleDerivedPath & req)
static

Convert a SingleDerivedPath to a DerivedPath.

◆ getBaseStorePath()

const StorePath & nix::DerivedPath::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 nix::DerivedPath::parse ( const StoreDirConfig & store,
std::string_view s,
const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings )
static

Uses ^ as the separator

Parameters
xpSettingsStop-gap to avoid globals during unit tests.

◆ parseLegacy()

DerivedPath nix::DerivedPath::parseLegacy ( const StoreDirConfig & store,
std::string_view s,
const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings )
static

Uses ! as the separator

Parameters
xpSettingsStop-gap to avoid globals during unit tests.

◆ to_string()

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

Uses ^ as the separator

◆ to_string_legacy()

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

Uses ! as the separator


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