Nix 2.26.3
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 "derivations.hh"
5#include "store-api.hh"
6
7#include <nlohmann/json_fwd.hpp>
8
9namespace nix {
10
11class ParsedDerivation
12{
13 StorePath drvPath;
14 BasicDerivation & drv;
15 std::unique_ptr<nlohmann::json> structuredAttrs;
16
17public:
18
19 ParsedDerivation(const StorePath & drvPath, BasicDerivation & drv);
20
21 ~ParsedDerivation();
22
23 const nlohmann::json * getStructuredAttrs() const
24 {
25 return structuredAttrs.get();
26 }
27
28 std::optional<std::string> getStringAttr(const std::string & name) const;
29
30 bool getBoolAttr(const std::string & name, bool def = false) const;
31
32 std::optional<Strings> getStringsAttr(const std::string & name) const;
33
34 StringSet getRequiredSystemFeatures() const;
35
36 bool canBuildLocally(Store & localStore) const;
37
38 bool willBuildLocally(Store & localStore) const;
39
40 bool substitutesAllowed() const;
41
42 bool useUidRange() const;
43
44 std::optional<nlohmann::json> prepareStructuredAttrs(Store & store, const StorePathSet & inputPaths);
45};
46
47std::string writeStructuredAttrsShell(const nlohmann::json & json);
48
49}
Definition path.hh:27
Definition store-api.hh:169
ChunkedVector< std::string, 8192 > store
Definition lexer.l:1011
const std::string_view & name
Definition lexer.l:1709
Definition derivations.hh:285