Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
parsed-derivations.hh
Go to the documentation of this file.
1#pragma once
3
4#include <nlohmann/json.hpp>
5
6#include "nix/util/types.hh"
7#include "nix/store/path.hh"
8
9namespace nix {
10
11class Store;
12
13namespace derivation {
14template<typename Input>
15struct Options;
16struct Output;
17} // namespace derivation
18
20{
21 static constexpr std::string_view envVarName{"__json"};
22
23 nlohmann::json::object_t structuredAttrs;
24
31 std::optional<std::string> verbatim;
32
38 bool operator==(const StructuredAttrs & other) const;
39
43 static StructuredAttrs parse(std::string_view encoded);
44
49 static std::optional<StructuredAttrs> tryExtract(StringPairs & env);
50
55 std::pair<std::string_view, std::string> unparse() const;
56
61 static void checkKeyNotInUse(const StringPairs & env);
62
63 nlohmann::json::object_t prepareStructuredAttrs(
64 Store & store,
65 const derivation::Options<StorePath> & drvOptions,
66 const StorePathSet & inputPaths,
67 const std::map<std::string, derivation::Output> & outputs) const;
68
80 static std::string writeShell(const nlohmann::json::object_t & prepared);
81};
82
83} // namespace nix
Definition store-api.hh:397
Definition derivation-options.cc:339
Definition parsed-derivations.hh:20
static StructuredAttrs parse(std::string_view encoded)
Definition parsed-derivations.cc:12
static void checkKeyNotInUse(const StringPairs &env)
Definition parsed-derivations.cc:61
std::pair< std::string_view, std::string > unparse() const
Definition parsed-derivations.cc:53
std::optional< std::string > verbatim
Definition parsed-derivations.hh:31
bool operator==(const StructuredAttrs &other) const
Definition parsed-derivations.cc:25
static std::optional< StructuredAttrs > tryExtract(StringPairs &env)
Definition parsed-derivations.cc:41
static std::string writeShell(const nlohmann::json::object_t &prepared)
Definition parsed-derivations.cc:145
Definition derivation-options.hh:99
Definition output.hh:22
StringMap StringPairs
Definition types.hh:32