mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-16 03:06:17 +02:00
6fd2f42c2d
Rename SearchPath to LookupPath and searchPath to lookupPath
46 lines
1 KiB
C++
46 lines
1 KiB
C++
#pragma once
|
|
///@file
|
|
|
|
#include "args.hh"
|
|
#include "canon-path.hh"
|
|
#include "common-args.hh"
|
|
#include "search-path.hh"
|
|
|
|
#include <filesystem>
|
|
|
|
namespace nix {
|
|
|
|
class Store;
|
|
class EvalState;
|
|
class Bindings;
|
|
struct SourcePath;
|
|
|
|
struct MixEvalArgs : virtual Args, virtual MixRepair
|
|
{
|
|
static constexpr auto category = "Common evaluation options";
|
|
|
|
MixEvalArgs();
|
|
|
|
Bindings * getAutoArgs(EvalState & state);
|
|
|
|
LookupPath lookupPath;
|
|
|
|
std::optional<std::string> evalStoreUrl;
|
|
|
|
private:
|
|
struct AutoArgExpr { std::string expr; };
|
|
struct AutoArgString { std::string s; };
|
|
struct AutoArgFile { std::filesystem::path path; };
|
|
struct AutoArgStdin { };
|
|
|
|
using AutoArg = std::variant<AutoArgExpr, AutoArgString, AutoArgFile, AutoArgStdin>;
|
|
|
|
std::map<std::string, AutoArg> autoArgs;
|
|
};
|
|
|
|
/**
|
|
* @param baseDir Optional [base directory](https://nixos.org/manual/nix/unstable/glossary#gloss-base-directory)
|
|
*/
|
|
SourcePath lookupFileArg(EvalState & state, std::string_view s, const Path * baseDir = nullptr);
|
|
|
|
}
|