2017-05-02 13:17:37 +02:00
|
|
|
#pragma once
|
|
|
|
|
2020-05-27 22:56:34 +02:00
|
|
|
#include "libutil/types.hh"
|
2017-05-02 13:17:37 +02:00
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
|
|
|
struct Machine {
|
2020-05-24 23:29:21 +02:00
|
|
|
const std::string storeUri;
|
|
|
|
const std::vector<std::string> systemTypes;
|
|
|
|
const std::string sshKey;
|
2017-05-02 13:17:37 +02:00
|
|
|
const unsigned int maxJobs;
|
|
|
|
const unsigned int speedFactor;
|
2020-05-24 23:29:21 +02:00
|
|
|
const std::set<std::string> supportedFeatures;
|
|
|
|
const std::set<std::string> mandatoryFeatures;
|
2017-05-02 14:36:59 +02:00
|
|
|
const std::string sshPublicHostKey;
|
2017-05-02 13:17:37 +02:00
|
|
|
bool enabled = true;
|
2020-05-17 17:31:57 +02:00
|
|
|
|
2020-05-24 23:29:21 +02:00
|
|
|
bool allSupported(const std::set<std::string>& features) const;
|
2020-05-17 17:31:57 +02:00
|
|
|
|
2020-05-24 23:29:21 +02:00
|
|
|
bool mandatoryMet(const std::set<std::string>& features) const;
|
2020-05-17 17:31:57 +02:00
|
|
|
|
2020-05-20 23:58:43 +02:00
|
|
|
Machine(decltype(storeUri)& storeUri, decltype(systemTypes)& systemTypes,
|
|
|
|
decltype(sshKey)& sshKey, decltype(maxJobs) maxJobs,
|
2017-05-02 13:17:37 +02:00
|
|
|
decltype(speedFactor) speedFactor,
|
2020-05-20 23:58:43 +02:00
|
|
|
decltype(supportedFeatures)& supportedFeatures,
|
|
|
|
decltype(mandatoryFeatures)& mandatoryFeatures,
|
|
|
|
decltype(sshPublicHostKey)& sshPublicHostKey);
|
2017-05-02 13:17:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector<Machine> Machines;
|
|
|
|
|
|
|
|
void parseMachines(const std::string& s, Machines& machines);
|
|
|
|
|
2017-05-02 13:44:10 +02:00
|
|
|
Machines getMachines();
|
|
|
|
|
2017-05-02 13:17:37 +02:00
|
|
|
} // namespace nix
|