Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
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
9
namespace
nix {
10
11
class
Store
;
12
13
namespace
derivation
{
14
template
<
typename
Input>
15
struct
Options
;
16
struct
Output
;
17
}
// namespace derivation
18
19
struct
StructuredAttrs
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
nix::Store
Definition
store-api.hh:397
path.hh
nix::derivation
Definition
derivation-options.cc:339
nix::StructuredAttrs
Definition
parsed-derivations.hh:20
nix::StructuredAttrs::parse
static StructuredAttrs parse(std::string_view encoded)
Definition
parsed-derivations.cc:12
nix::StructuredAttrs::checkKeyNotInUse
static void checkKeyNotInUse(const StringPairs &env)
Definition
parsed-derivations.cc:61
nix::StructuredAttrs::unparse
std::pair< std::string_view, std::string > unparse() const
Definition
parsed-derivations.cc:53
nix::StructuredAttrs::verbatim
std::optional< std::string > verbatim
Definition
parsed-derivations.hh:31
nix::StructuredAttrs::operator==
bool operator==(const StructuredAttrs &other) const
Definition
parsed-derivations.cc:25
nix::StructuredAttrs::tryExtract
static std::optional< StructuredAttrs > tryExtract(StringPairs &env)
Definition
parsed-derivations.cc:41
nix::StructuredAttrs::writeShell
static std::string writeShell(const nlohmann::json::object_t &prepared)
Definition
parsed-derivations.cc:145
nix::derivation::Options
Definition
derivation-options.hh:99
nix::derivation::Output
Definition
output.hh:22
types.hh
nix::StringPairs
StringMap StringPairs
Definition
types.hh:32
libstore
include
nix
store
parsed-derivations.hh
Generated by
1.18.0