Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::EvalPaths Class Reference

Classes

struct  PathResult

Public Member Functions

 EvalPaths (AsyncIoRoot &aio, const ref< Store > &store, SearchPath searchPath, EvalErrorContext &errors)
const SearchPathsearchPath () const
void allowPath (const Path &path)
void allowPath (const StorePath &storePath)
void allowAndSetStorePathString (const StorePath &storePath, Value &v)
CheckedSourcePath checkSourcePath (const SourcePath &path)
CheckedSourcePath resolveExprPath (SourcePath path)
void checkURI (const std::string &uri)
Path toRealPath (const Path &path, const NixStringContext &context)
kj::Promise< Result< PathResult< SourcePath, ThrownError > > > findFile (const std::string_view path)
kj::Promise< Result< PathResult< SourcePath, ThrownError > > > findFile (const SearchPath &searchPath, const std::string_view path, const PosIdx pos=noPos)
kj::Promise< Result< std::optional< std::string > > > resolveSearchPathPath (const SearchPath::Path &path)
kj::Promise< Result< PathResult< StorePath, EvalError > > > copyPathToStore (NixStringContext &context, const SourcePath &path, RepairFlag repair=NoRepair)
void mkStorePathString (const StorePath &storePath, Value &v)

Member Function Documentation

◆ allowAndSetStorePathString()

void nix::EvalPaths::allowAndSetStorePathString ( const StorePath & storePath,
Value & v )

Allow access to a store path and return it as a string.

◆ allowPath() [1/2]

void nix::EvalPaths::allowPath ( const Path & path)

Allow access to a path.

◆ allowPath() [2/2]

void nix::EvalPaths::allowPath ( const StorePath & storePath)

Allow access to a store path. Note that this gets remapped to the real store path if store is a chroot store.

◆ checkSourcePath()

CheckedSourcePath nix::EvalPaths::checkSourcePath ( const SourcePath & path)

Check whether access to a path is allowed and throw an error if not. Otherwise return the canonicalised path.

◆ findFile()

kj::Promise< Result< EvalPaths::PathResult< SourcePath, ThrownError > > > nix::EvalPaths::findFile ( const std::string_view path)

Look up a file in the search path.

◆ mkStorePathString()

void nix::EvalPaths::mkStorePathString ( const StorePath & storePath,
Value & v )

Create a string representing a store path.

The string is the printed store path with a context containing a single NixStringContextElem::Opaque element of that store path.

◆ resolveExprPath()

CheckedSourcePath nix::EvalPaths::resolveExprPath ( SourcePath path)

If path refers to a directory, then append "/default.nix".

◆ resolveSearchPathPath()

kj::Promise< Result< std::optional< std::string > > > nix::EvalPaths::resolveSearchPathPath ( const SearchPath::Path & path)

Try to resolve a search path value (not the optinal key part)

If the specified search path element is a URI, download it.

If it is not found, return std::nullopt

◆ toRealPath()

Path nix::EvalPaths::toRealPath ( const Path & path,
const NixStringContext & context )

When using a diverted store and 'path' is in the Nix store, map 'path' to the diverted location (e.g. /nix/store/foo is mapped to /home/alice/my-nix/nix/store/foo). However, this is only done if the context is not empty, since otherwise we're probably trying to read from the actual /nix/store. This is intended to distinguish between import-from-derivation and sources stored in the actual /nix/store.


The documentation for this class was generated from the following files:
  • lix/libexpr/eval.hh
  • lix/libexpr/eval.cc