Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
machines.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/util/ref.hh"
6
7namespace nix {
8
9class Store;
10
11struct Machine;
12
13typedef std::vector<Machine> Machines;
14
15struct Machine
16{
17
18 const StoreReference storeUri;
27 const std::optional<std::filesystem::path> sshKey;
28 const unsigned int maxJobs;
29 const float speedFactor;
30 const StringSet supportedFeatures;
31 const StringSet mandatoryFeatures;
32 const std::string sshPublicHostKey;
33 bool enabled = true;
34
39 bool systemSupported(const std::string & system) const;
40
45 bool allSupported(const StringSet & features) const;
46
50 bool mandatoryMet(const StringSet & features) const;
51
52 Machine(
53 const std::string & storeUri,
54 decltype(systemTypes) systemTypes,
55 decltype(sshKey) sshKey,
56 decltype(maxJobs) maxJobs,
57 decltype(speedFactor) speedFactor,
58 decltype(supportedFeatures) supportedFeatures,
59 decltype(mandatoryFeatures) mandatoryFeatures,
60 decltype(sshPublicHostKey) sshPublicHostKey);
61
67 StoreReference completeStoreReference() const;
68
77 ref<Store> openStore() const;
78
86 static Machines parseConfig(const StringSet & defaultSystems, const std::string & config);
87};
88
89} // namespace nix
Definition store-api.hh:397
Definition ref.hh:58
Definition machines.hh:16
bool allSupported(const StringSet &features) const
Definition machines.cc:47
const StringSet systemTypes
Definition machines.hh:26
bool mandatoryMet(const StringSet &features) const
Definition machines.cc:54
StoreReference completeStoreReference() const
Definition machines.cc:61
ref< Store > openStore() const
Definition machines.cc:95
bool systemSupported(const std::string &system) const
Definition machines.cc:42
static Machines parseConfig(const StringSet &defaultSystems, const std::string &config)
Definition machines.cc:205
std::set< std::string, std::less<> > StringSet
Definition types.hh:45