Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
installables.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/store/path.hh"
10
11#include <optional>
12
13namespace nix {
14
15struct PackageInfo;
16
17enum class Realise {
23 Outputs,
29 Derivation,
39};
40
44enum class OperateOn {
52 Derivation
53};
54
63{
64 virtual ~ExtraPathInfo() = default;
65};
66
72{
73 DerivedPath path;
75};
76
83{
84 BuiltPath path;
86 std::optional<BuildResult> result;
87};
88
89BuiltPaths toBuiltPaths(const std::vector<BuiltPathWithResult> & builtPathsWithResult);
90
95typedef std::vector<DerivedPathWithInfo> DerivedPathsWithInfo;
96
97struct Installable;
98
103typedef std::vector<ref<Installable>> Installables;
104
114{
115 virtual ~Installable() {}
116
124 virtual std::string what() const = 0;
125
133
143
151 virtual std::optional<StorePath> getStorePath()
152 {
153 return {};
154 }
155
156 static std::vector<BuiltPathWithResult> build(
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 ref<Store> evalStore,
165 ref<Store> store,
166 Realise mode,
167 const Installables & installables,
168 BuildMode bMode = bmNormal);
169
170 static std::set<StorePath> toStorePathSet(
171 ref<Store> evalStore, ref<Store> store, Realise mode, OperateOn operateOn, const Installables & installables);
172
173 static std::vector<StorePath> toStorePaths(
174 ref<Store> evalStore, ref<Store> store, Realise mode, OperateOn operateOn, const Installables & installables);
175
176 static StorePath toStorePath(
177 ref<Store> evalStore, ref<Store> store, Realise mode, OperateOn operateOn, ref<Installable> installable);
178
179 static std::set<StorePath>
180 toDerivations(ref<Store> store, const Installables & installables, bool useDeriver = false);
181
182 static BuiltPaths toBuiltPaths(
183 ref<Store> evalStore, ref<Store> store, Realise mode, OperateOn operateOn, const Installables & installables);
184};
185
186} // namespace nix
Definition path.hh:33
Definition ref.hh:58
OperateOn
Definition installables.hh:44
@ Output
Definition installables.hh:48
Realise
Definition installables.hh:17
@ Nothing
Definition installables.hh:38
std::vector< ref< Installable > > Installables
Definition installables.hh:103
std::vector< DerivedPathWithInfo > DerivedPathsWithInfo
Definition installables.hh:95
Definition installables.hh:83
Definition built-path.hh:83
Definition installables.hh:72
Definition derived-path.hh:238
Definition installables.hh:63
Definition installables.hh:114
virtual std::string what() const =0
DerivedPathWithInfo toDerivedPath()
Definition installables.cc:412
virtual DerivedPathsWithInfo toDerivedPaths()=0
virtual std::optional< StorePath > getStorePath()
Definition installables.hh:151
Definition get-drvs.hh:16