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

#include <installables.hh>

Inheritance diagram for nix::Installable:
nix::InstallableDerivedPath nix::InstallableValue nix::InstallableAttrPath nix::InstallableFlake

Public Member Functions

virtual std::string what () const =0
 
virtual DerivedPathsWithInfo toDerivedPaths ()=0
 
DerivedPathWithInfo toDerivedPath ()
 
virtual std::optional< StorePathgetStorePath ()
 

Static Public Member Functions

static std::vector< BuiltPathWithResultbuild (ref< Store > evalStore, ref< Store > store, Realise mode, const Installables &installables, BuildMode bMode=bmNormal)
 
static std::vector< std::pair< ref< Installable >, BuiltPathWithResult > > build2 (ref< Store > evalStore, ref< Store > store, Realise mode, const Installables &installables, BuildMode bMode=bmNormal)
 
static std::set< StorePathtoStorePathSet (ref< Store > evalStore, ref< Store > store, Realise mode, OperateOn operateOn, const Installables &installables)
 
static std::vector< StorePathtoStorePaths (ref< Store > evalStore, ref< Store > store, Realise mode, OperateOn operateOn, const Installables &installables)
 
static StorePath toStorePath (ref< Store > evalStore, ref< Store > store, Realise mode, OperateOn operateOn, ref< Installable > installable)
 
static std::set< StorePathtoDerivations (ref< Store > store, const Installables &installables, bool useDeriver=false)
 
static BuiltPaths toBuiltPaths (ref< Store > evalStore, ref< Store > store, Realise mode, OperateOn operateOn, const Installables &installables)
 

Detailed Description

Installables are the main positional arguments for the Nix Command-line.

This base class is very flexible, and just assumes and the Installable refers to a collection of derived paths with extra info.

Member Function Documentation

◆ getStorePath()

virtual std::optional< StorePath > nix::Installable::getStorePath ( )
inlinevirtual

Return a value only if this installable is a store path or a symlink to it.

Todo
should we move this to InstallableDerivedPath? It is only supposed to work there anyways. Can always downcast.

Reimplemented in nix::InstallableDerivedPath.

◆ toDerivedPath()

DerivedPathWithInfo nix::Installable::toDerivedPath ( )

A convenience wrapper of the above for when we expect an installable to produce a single derived path only.

If no or multiple derived paths are produced, and error is raised.

◆ toDerivedPaths()

virtual DerivedPathsWithInfo nix::Installable::toDerivedPaths ( )
pure virtual

Get the collection of derived pathswith info" that this Installable instalallable denotes.

This is the main method of this class

Implemented in nix::InstallableDerivedPath, and nix::InstallableFlake.

◆ what()

virtual std::string nix::Installable::what ( ) const
pure virtual

What Installable is this?

Prints back valid CLI syntax that would result in this same installable. It doesn't need to be exactly what the user wrote, just something that means the same thing.

Implemented in nix::InstallableDerivedPath, and nix::InstallableFlake.


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