Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
downstream-placeholder.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/util/hash.hh"
6#include "nix/store/path.hh"
8
9namespace nix {
10
19template<typename Input>
20using DrvRef = std::variant<OutputName, Input>;
21
42class DownstreamPlaceholder
43{
48 Hash hash;
49
53 DownstreamPlaceholder(Hash hash)
54 : hash(hash)
55 {
56 }
57
58public:
63 std::string render() const;
64
74 static DownstreamPlaceholder unknownCaOutput(
75 const StorePath & drvPath,
76 OutputNameView outputName,
77 const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings);
78
88 static DownstreamPlaceholder unknownDerivation(
89 const DownstreamPlaceholder & drvPlaceholder,
90 OutputNameView outputName,
91 const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings);
92
101 static DownstreamPlaceholder fromSingleDerivedPathBuilt(
102 const SingleDerivedPath::Built & built,
103 const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings);
104};
105
106} // namespace nix
107
108namespace nlohmann {
109
110template<typename Item>
111struct adl_serializer<nix::DrvRef<Item>>
112{
113 static nix::DrvRef<Item> from_json(const json & json);
114 static void to_json(json & json, const nix::DrvRef<Item> & t);
115};
116
117extern template struct adl_serializer<nix::DrvRef<nix::StorePath>>;
118extern template struct adl_serializer<nix::DrvRef<nix::SingleDerivedPath>>;
119
120} // namespace nlohmann
static DownstreamPlaceholder unknownCaOutput(const StorePath &drvPath, OutputNameView outputName, const ExperimentalFeatureSettings &xpSettings=experimentalFeatureSettings)
Definition downstream-placeholder.cc:12
std::string render() const
Definition downstream-placeholder.cc:7
static DownstreamPlaceholder unknownDerivation(const DownstreamPlaceholder &drvPlaceholder, OutputNameView outputName, const ExperimentalFeatureSettings &xpSettings=experimentalFeatureSettings)
Definition downstream-placeholder.cc:23
static DownstreamPlaceholder fromSingleDerivedPathBuilt(const SingleDerivedPath::Built &built, const ExperimentalFeatureSettings &xpSettings=experimentalFeatureSettings)
Definition downstream-placeholder.cc:36
Definition path.hh:33
std::variant< OutputName, Input > DrvRef
Definition downstream-placeholder.hh:20
std::string_view OutputNameView
Definition outputs-spec.hh:24
Definition configuration.hh:558
Definition hash.hh:58