Nix 2.36.0
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 "nix/util/args.hh"
10
11#include <filesystem>
12
13namespace nix {
14
15class Store;
16
17namespace fetchers {
18struct Settings;
19}
20
21class EvalState;
23class Bindings;
24
25namespace flake {
26struct Settings;
27}
28
32extern fetchers::Settings fetchSettings;
33
37extern EvalSettings evalSettings;
38
42extern flake::Settings flakeSettings;
43
47extern CompatibilitySettings compatibilitySettings;
48
49struct MixEvalArgs : virtual Args, virtual MixRepair
50{
51 static constexpr auto category = "Common evaluation options";
52
53 MixEvalArgs();
54
55 const Bindings * getAutoArgs(EvalState & state);
56
57 LookupPath lookupPath;
58
59 std::optional<StoreReference> evalStoreUrl;
60
61private:
62 struct AutoArgExpr
63 {
64 std::string expr;
65 };
66
67 struct AutoArgString
68 {
69 std::string s;
70 };
71
72 struct AutoArgFile
73 {
74 std::filesystem::path path;
75 };
76
77 struct AutoArgStdin
78 {};
79
80 using AutoArg = std::variant<AutoArgExpr, AutoArgString, AutoArgFile, AutoArgStdin>;
81
82 std::map<std::string, AutoArg> autoArgs;
83};
84
88SourcePath lookupFileArg(EvalState & state, std::string_view s, const std::filesystem::path * baseDir = nullptr);
89
90} // namespace nix
Definition args.hh:29
Definition attr-set.hh:67
Definition eval.hh:420
Definition store-api.hh:397
Definition compatibility-settings.hh:6
Definition eval-settings.hh:50
Definition search-path.hh:16
Definition source-path.hh:22
Definition fetch-settings.hh:27
Definition settings.hh:18