Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
output.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/store/path.hh"
9
10#include <variant>
11
12namespace nix {
13
14struct StoreDirConfig;
15
16namespace derivation {
17
21struct Output
22{
27 {
28 StorePath path;
29
30 bool operator==(const InputAddressed &) const = default;
31 auto operator<=>(const InputAddressed &) const = default;
32 };
33
38 struct CAFixed
39 {
46
53 StorePath path(const StoreDirConfig & store, std::string_view drvName, OutputNameView outputName) const;
54
55 bool operator==(const CAFixed &) const = default;
56 auto operator<=>(const CAFixed &) const = default;
57 };
58
65 {
70
74 HashAlgorithm hashAlgo;
75
76 bool operator==(const CAFloating &) const = default;
77 auto operator<=>(const CAFloating &) const = default;
78 };
79
84 struct Deferred
85 {
86 bool operator==(const Deferred &) const = default;
87 auto operator<=>(const Deferred &) const = default;
88 };
89
94 struct Impure
95 {
100
104 HashAlgorithm hashAlgo;
105
106 bool operator==(const Impure &) const = default;
107 auto operator<=>(const Impure &) const = default;
108 };
109
110 typedef std::variant<InputAddressed, CAFixed, CAFloating, Deferred, Impure> Raw;
111
112 Raw raw;
113
114 bool operator==(const Output &) const = default;
115 auto operator<=>(const Output &) const = default;
116
117 MAKE_WRAPPER_CONSTRUCTOR(Output);
118
122 Output() = delete;
123
130 std::optional<StorePath>
131 path(const StoreDirConfig & store, std::string_view drvName, OutputNameView outputName) const;
132};
133
134template<typename Out = Output>
135using Outputs = std::map<std::string, Out>;
136
143typedef std::map<std::string, std::pair<Output, std::optional<StorePath>>> OutputsAndOptPaths;
144
145} // namespace derivation
146
147using DerivationOutput = derivation::Output;
148
149} // namespace nix
150
151JSON_IMPL_WITH_XP_FEATURES(nix::DerivationOutput)
Definition path.hh:33
std::string_view OutputNameView
Definition outputs-spec.hh:24
Definition derivation-options.cc:339
std::map< std::string, std::pair< Output, std::optional< StorePath > > > OutputsAndOptPaths
Definition output.hh:143
Definition content-address.hh:32
Definition content-address.hh:162
Definition store-dir-config.hh:29
Definition output.hh:39
ContentAddress ca
Definition output.hh:45
StorePath path(const StoreDirConfig &store, std::string_view drvName, OutputNameView outputName) const
Definition output.cc:26
HashAlgorithm hashAlgo
Definition output.hh:74
ContentAddressMethod method
Definition output.hh:69
Definition output.hh:85
Definition output.hh:95
HashAlgorithm hashAlgo
Definition output.hh:104
ContentAddressMethod method
Definition output.hh:99
Definition output.hh:22
std::optional< StorePath > path(const StoreDirConfig &store, std::string_view drvName, OutputNameView outputName) const
Definition output.cc:11