Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
installable-value.hh
Go to the documentation of this file.
1#pragma once
3
6#include "lix/libexpr/eval.hh"
8
9namespace nix {
10
11struct DrvInfo;
13
14struct App
15{
16 std::vector<DerivedPath> context;
17 Path program;
18 // FIXME: add args, sandbox settings, metadata, ...
19};
20
22{
23 App unresolved;
24 App resolve(EvalState & state, ref<Store> evalStore, ref<Store> store);
25};
26
34struct ExtraPathInfoValue : ExtraPathInfo
35{
39 struct Value {
43 std::optional<NixInt::Inner> priority;
44
51 std::string attrPath;
52
57 };
58
59 Value value;
60
61 ExtraPathInfoValue(Value && v)
62 : value(v)
63 { }
64
65 virtual ~ExtraPathInfoValue() = default;
66};
67
72struct InstallableValue : Installable
73{
75
76 InstallableValue(ref<eval_cache::CachingEvaluator> evaluator) : evaluator(evaluator) {}
77
78 virtual ~InstallableValue() { }
79
80 virtual std::pair<Value *, PosIdx> toValue(EvalState & state) = 0;
81
87 virtual std::vector<ref<eval_cache::AttrCursor>> getCursors(EvalState & state);
88
94
95 UnresolvedApp toApp(EvalState & state);
96
97 static InstallableValue & require(Installable & installable);
98 static ref<InstallableValue> require(ref<Installable> installable);
99
100protected:
101
116 std::optional<DerivedPathWithInfo> trySinglePathToDerivedPaths(
117 EvalState & state, Value & v, const PosIdx pos, std::string_view errorCtx
118 );
119};
120
121}
Definition eval.hh:685
Definition pos-idx.hh:9
Definition ref.hh:19
Definition installable-value.hh:15
Definition get-drvs.hh:16
Definition outputs-spec.hh:97
Definition installable-value.hh:39
std::optional< NixInt::Inner > priority
Definition installable-value.hh:43
ExtendedOutputsSpec extendedOutputsSpec
Definition installable-value.hh:56
std::string attrPath
Definition installable-value.hh:51
Definition installable-value.hh:35
Definition installables.hh:63
std::optional< DerivedPathWithInfo > trySinglePathToDerivedPaths(EvalState &state, Value &v, const PosIdx pos, std::string_view errorCtx)
Definition installable-value.cc:46
virtual ref< eval_cache::AttrCursor > getCursor(EvalState &state)
Definition installable-value.cc:18
virtual std::vector< ref< eval_cache::AttrCursor > > getCursors(EvalState &state)
Definition installable-value.cc:9
Definition installables.hh:112
Definition command.hh:112
Definition installable-value.hh:22
Definition value.hh:190
std::string Path
Definition types.hh:28