Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
common-eval-args.hh
Go to the documentation of this file.
1#pragma once
3
4#include "args.hh"
5#include "canon-path.hh"
6#include "common-args.hh"
7#include "search-path.hh"
8
9#include <filesystem>
10
11namespace nix {
12
13class Store;
14
15namespace fetchers { struct Settings; }
16
17class EvalState;
18struct EvalSettings;
20class Bindings;
21struct SourcePath;
22
23namespace flake { struct Settings; }
24
28extern fetchers::Settings fetchSettings;
29
33extern EvalSettings evalSettings;
34
38extern flake::Settings flakeSettings;
39
43extern CompatibilitySettings compatibilitySettings;
44
45struct MixEvalArgs : virtual Args, virtual MixRepair
46{
47 static constexpr auto category = "Common evaluation options";
48
49 MixEvalArgs();
50
51 Bindings * getAutoArgs(EvalState & state);
52
53 LookupPath lookupPath;
54
55 std::optional<std::string> evalStoreUrl;
56
57private:
58 struct AutoArgExpr { std::string expr; };
59 struct AutoArgString { std::string s; };
60 struct AutoArgFile { std::filesystem::path path; };
61 struct AutoArgStdin { };
62
63 using AutoArg = std::variant<AutoArgExpr, AutoArgString, AutoArgFile, AutoArgStdin>;
64
65 std::map<std::string, AutoArg> autoArgs;
66};
67
71SourcePath lookupFileArg(EvalState & state, std::string_view s, const Path * baseDir = nullptr);
72
73}
Definition args.hh:28
Definition attr-set.hh:48
Definition eval.hh:182
Definition store-api.hh:169
return s
Definition lexer.l:459
Definition compatibility-settings.hh:6
Definition eval-settings.hh:13
Definition search-path.hh:16
Definition source-path.hh:22
Definition fetch-settings.hh:15
std::string Path
Definition types.hh:22