Nix  2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
installables.hh
Go to the documentation of this file.
1#pragma once
3
4#include "lix/libexpr/eval.hh"
11
12#include <optional>
13
14namespace nix {
15
16struct DrvInfo;
17
18enum class Realise {
24 Outputs,
40};
41
45enum class OperateOn {
49 Output,
54};
55
64{
65 virtual ~ExtraPathInfo() = default;
66};
67
73{
74 DerivedPath path;
76};
77
84{
85 BuiltPath path;
87 std::optional<BuildResult> result;
88};
89
94typedef std::vector<DerivedPathWithInfo> DerivedPathsWithInfo;
95
96struct Installable;
97
102typedef std::vector<ref<Installable>> Installables;
103
113{
114 virtual ~Installable() { }
115
123 virtual std::string what() const = 0;
124
132
142
150 virtual std::optional<StorePath> getStorePath()
151 {
152 return {};
153 }
154
155 static std::vector<BuiltPathWithResult> build(
156 EvalState & state,
157 ref<Store> evalStore,
158 ref<Store> store,
159 Realise mode,
160 const Installables & installables,
161 BuildMode bMode = bmNormal);
162
163 static std::vector<std::pair<ref<Installable>, BuiltPathWithResult>> build2(
164 EvalState & state,
165 ref<Store> evalStore,
166 ref<Store> store,
167 Realise mode,
168 const Installables & installables,
169 BuildMode bMode = bmNormal);
170
171 static std::set<StorePath> toStorePathSet(
172 EvalState & state,
173 ref<Store> evalStore,
174 ref<Store> store,
175 Realise mode,
176 OperateOn operateOn,
177 const Installables & installables);
178
179 static std::vector<StorePath> toStorePaths(
180 EvalState & state,
181 ref<Store> evalStore,
182 ref<Store> store,
183 Realise mode,
184 OperateOn operateOn,
185 const Installables & installables);
186
187 static StorePath toStorePath(
188 EvalState & state,
189 ref<Store> evalStore,
190 ref<Store> store,
191 Realise mode,
192 OperateOn operateOn,
193 ref<Installable> installable);
194
195 static std::set<StorePath> toDerivations(
196 EvalState & state,
197 ref<Store> store,
198 const Installables & installables,
199 bool useDeriver = false);
200
201 static BuiltPaths toBuiltPaths(
202 EvalState & state,
203 ref<Store> evalStore,
204 ref<Store> store,
205 Realise mode,
206 OperateOn operateOn,
207 const Installables & installables);
208};
209
210}
Definition eval.hh:673
Definition path.hh:21
Definition ref.hh:17
OperateOn
Definition installables.hh:45
Realise
Definition installables.hh:18
std::vector< ref< Installable > > Installables
Definition installables.hh:102
std::vector< DerivedPathWithInfo > DerivedPathsWithInfo
Definition installables.hh:94
Definition installables.hh:84
Definition built-path.hh:83
Definition derivations.hh:324
Definition installables.hh:73
Definition derived-path.hh:225
Definition installables.hh:64
Definition installables.hh:113
virtual std::string what() const =0
DerivedPathWithInfo toDerivedPath(EvalState &state)
Definition installables.cc:379
virtual DerivedPathsWithInfo toDerivedPaths(EvalState &state)=0
virtual std::optional< StorePath > getStorePath()
Definition installables.hh:150