2017-05-02 11:17:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "types.hh"
|
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
2020-08-12 16:32:36 +00:00
|
|
|
class Store;
|
|
|
|
|
2017-05-02 11:17:37 +00:00
|
|
|
struct Machine {
|
|
|
|
|
2022-02-21 15:37:25 +00:00
|
|
|
const std::string storeUri;
|
|
|
|
const std::vector<std::string> systemTypes;
|
|
|
|
const std::string sshKey;
|
2017-05-02 11:17:37 +00:00
|
|
|
const unsigned int maxJobs;
|
|
|
|
const unsigned int speedFactor;
|
2022-02-21 15:37:25 +00:00
|
|
|
const std::set<std::string> supportedFeatures;
|
|
|
|
const std::set<std::string> mandatoryFeatures;
|
2017-05-02 12:36:59 +00:00
|
|
|
const std::string sshPublicHostKey;
|
2017-05-02 11:17:37 +00:00
|
|
|
bool enabled = true;
|
|
|
|
|
2022-02-21 15:37:25 +00:00
|
|
|
bool allSupported(const std::set<std::string> & features) const;
|
2017-05-02 11:17:37 +00:00
|
|
|
|
2022-02-21 15:37:25 +00:00
|
|
|
bool mandatoryMet(const std::set<std::string> & features) const;
|
2017-05-02 11:17:37 +00:00
|
|
|
|
|
|
|
Machine(decltype(storeUri) storeUri,
|
|
|
|
decltype(systemTypes) systemTypes,
|
|
|
|
decltype(sshKey) sshKey,
|
|
|
|
decltype(maxJobs) maxJobs,
|
|
|
|
decltype(speedFactor) speedFactor,
|
|
|
|
decltype(supportedFeatures) supportedFeatures,
|
2017-05-02 12:36:59 +00:00
|
|
|
decltype(mandatoryFeatures) mandatoryFeatures,
|
|
|
|
decltype(sshPublicHostKey) sshPublicHostKey);
|
2020-08-12 16:32:36 +00:00
|
|
|
|
|
|
|
ref<Store> openStore() const;
|
2017-05-02 11:17:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector<Machine> Machines;
|
|
|
|
|
|
|
|
void parseMachines(const std::string & s, Machines & machines);
|
|
|
|
|
2017-05-02 11:44:10 +00:00
|
|
|
Machines getMachines();
|
|
|
|
|
2017-05-02 11:17:37 +00:00
|
|
|
}
|