Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
common-eval-args.hh File Reference

Go to the source code of this file.

Classes

struct  nix::MixEvalArgs

Functions

kj::Promise< Result< EvalPaths::PathResult< SourcePath, ThrownError > > > nix::lookupFileArg (Evaluator &state, std::string_view fileArg)
 Resolve an argument that is generally a file, but could be something that is easy to resolve to a file, like a <lookup path> or a tarball URL.

Function Documentation

◆ lookupFileArg()

kj::Promise< Result< EvalPaths::PathResult< SourcePath, ThrownError > > > nix::lookupFileArg ( Evaluator & state,
std::string_view fileArg )

Resolve an argument that is generally a file, but could be something that is easy to resolve to a file, like a <lookup path> or a tarball URL.

In particular, this will resolve and fetch pseudo-URLs starting with channel:, flakerefs starting with flake:, and anything that nix::fetchers::downloadTarball() can take.

Non-absolute files are looked up relative to the current directory(?) FIXME: the process's current directory or EvalState's current directory?

Parameters
stateThe nix::EvalState to base settings, store, and nixPath from.
fileArgThe the path-ish to resolve.
Returns
A nix::SourcePath to the resolved and fetched file.
Exceptions
nix::FileTransferErrorfrom nix::fetchers::downloadTarball(). Probably others.
nix::ThrownErrorfor failed search path lookup. Probably others.