Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
aterm.hh
Go to the documentation of this file.
1#pragma once
3
6
7namespace nix {
8
9struct Source;
10struct Sink;
11
12namespace derivation {
13
23inline constexpr bool defaultSupportWindowsStoreDir =
24#ifdef _WIN32
25 true
26#else
27 false
28#endif
29 ;
30
34template<typename Out>
35std::string unparse(
36 const Derivation<std::set<SingleDerivedPath>, Out> & drv,
37 const StoreDirConfig & store,
38 bool supportWindowsStoreDir = defaultSupportWindowsStoreDir);
39
40extern template std::string unparse(const Full & drv, const StoreDirConfig & store, bool supportWindowsStoreDir);
41extern template std::string
42unparse(const FullDeferred & drv, const StoreDirConfig & store, bool supportWindowsStoreDir);
43extern template std::string
44unparse(const FullInputAddressed & drv, const StoreDirConfig & store, bool supportWindowsStoreDir);
45
46namespace masked {
47struct HashInputs;
48}
49
62template<typename Inputs, typename Out>
64 // Regular `FullInputs` case takes the `Output` variant, or either of
65 // the input-addressing alternatives on their own
66 (std::is_same_v<Inputs, FullInputs>
67 && (std::is_same_v<Out, Output> || std::is_same_v<Out, Output::InputAddressed>
68 || std::is_same_v<Out, Output::Deferred>) )
69 // Masked hash is only for input addressing, with masked (`Deferred`) or unmasked (`InputAddressed`) outputs
70 || (std::is_same_v<Inputs, masked::HashInputs>
71 && (std::is_same_v<Out, Output::InputAddressed> || std::is_same_v<Out, Output::Deferred>) );
72
80template<typename Inputs, typename Out>
82std::string unparse(
83 const Derivation<Inputs, Out> & drv,
84 const StoreDirConfig & store,
85 bool supportWindowsStoreDir = defaultSupportWindowsStoreDir);
86
91 const StoreDirConfig & store,
92 std::string && s,
93 std::string_view name,
94 bool supportWindowsStoreDir = defaultSupportWindowsStoreDir,
95 const ExperimentalFeatureSettings & xpSettings = experimentalFeatureSettings);
96
97Source & read(Source & in, const StoreDirConfig & store, Basic & drv, std::string_view name);
98void write(Sink & out, const StoreDirConfig & store, const Basic & drv);
99
100} // namespace derivation
101
102} // namespace nix
Definition derivation-options.cc:339
Derivation< std::set< SingleDerivedPath > > Full
Derivation that depends on the outputs of other derivations in addition.
Definition derivations.hh:168
Derivation< StorePathSet > Basic
Derivation that depends only on other store objects.
Definition derivations.hh:160
Full parse(const StoreDirConfig &store, std::string &&s, std::string_view name, bool supportWindowsStoreDir, const ExperimentalFeatureSettings &xpSettings)
Definition aterm.cc:442
std::string unparse(const Derivation< Inputs, Out > &drv, const StoreDirConfig &store, bool supportWindowsStoreDir)
Definition aterm.cc:791
constexpr bool defaultSupportWindowsStoreDir
Definition aterm.hh:23
Derivation< std::set< SingleDerivedPath >, Output::InputAddressed > FullInputAddressed
Full, but statically known to be input-addressed.
Definition derivations.hh:204
Derivation< std::set< SingleDerivedPath >, Output::Deferred > FullDeferred
Full, but statically known to have no output paths yet.
Definition derivations.hh:196
Definition configuration.hh:558
Definition serialise.hh:18
Definition serialise.hh:95
Definition store-dir-config.hh:29
Definition derivations.hh:208