forked from lix-project/lix
1a68710d4d
This is useful for one-off situations where you want to specify a builder on the command line instead of having to mess with nix.machines. E.g. $ nix-build -A hello --argstr system x86_64-darwin \ --option builders 'root@macstadium1 x86_64-darwin' will perform the specified build on "macstadium1". It also removes the need for a separate nix.machines file since you can specify builders in nix.conf directly. (In fact nix.machines is yet another hack that predates the general nix.conf configuration file, IIRC.) Note: this option is supported by the daemon for trusted users. The fact that this allows trusted users to specify paths to SSH keys to which they don't normally have access is maybe a bit too much trust...
38 lines
923 B
C++
38 lines
923 B
C++
#pragma once
|
|
|
|
#include "types.hh"
|
|
|
|
namespace nix {
|
|
|
|
struct Machine {
|
|
|
|
const string storeUri;
|
|
const std::vector<string> systemTypes;
|
|
const string sshKey;
|
|
const unsigned int maxJobs;
|
|
const unsigned int speedFactor;
|
|
const std::set<string> supportedFeatures;
|
|
const std::set<string> mandatoryFeatures;
|
|
bool enabled = true;
|
|
|
|
bool allSupported(const std::set<string> & features) const;
|
|
|
|
bool mandatoryMet(const std::set<string> & features) const;
|
|
|
|
Machine(decltype(storeUri) storeUri,
|
|
decltype(systemTypes) systemTypes,
|
|
decltype(sshKey) sshKey,
|
|
decltype(maxJobs) maxJobs,
|
|
decltype(speedFactor) speedFactor,
|
|
decltype(supportedFeatures) supportedFeatures,
|
|
decltype(mandatoryFeatures) mandatoryFeatures);
|
|
};
|
|
|
|
typedef std::vector<Machine> Machines;
|
|
|
|
void parseMachines(const std::string & s, Machines & machines);
|
|
|
|
Machines getMachines();
|
|
|
|
}
|