nix-super/src/libcmd/common-eval-args.hh

40 lines
780 B
C++
Raw Normal View History

#pragma once
///@file
#include "args.hh"
#include "canon-path.hh"
2023-04-28 17:57:37 +03:00
#include "common-args.hh"
#include "search-path.hh"
namespace nix {
class Store;
class EvalState;
class Bindings;
struct SourcePath;
2023-04-28 17:57:37 +03:00
struct MixEvalArgs : virtual Args, virtual MixRepair
{
static constexpr auto category = "Common evaluation options";
MixEvalArgs();
Bindings * getAutoArgs(EvalState & state);
SearchPath searchPath;
std::optional<std::string> evalStoreUrl;
private:
2024-03-01 15:14:14 +02:00
struct AutoArgExpr { std::string expr; };
struct AutoArgString { std::string s; };
using AutoArg = std::variant<AutoArgExpr, AutoArgString>;
std::map<std::string, AutoArg> autoArgs;
};
SourcePath lookupFileArg(EvalState & state, std::string_view s, const Path * baseDir = nullptr);
}