Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
machines.hh
Go to the documentation of this file.
1#pragma once
3
4#include "lix/libutil/ref.hh"
6#include <kj/async.h>
7#include <set>
8#include <vector>
9
10namespace nix {
11
12class Store;
13
14struct Machine {
15
16 const std::string storeUri;
17 const std::set<std::string> systemTypes;
18 const std::string sshKey;
19 const unsigned int maxJobs;
20 const float speedFactor;
21 const std::set<std::string> supportedFeatures;
22 const std::set<std::string> mandatoryFeatures;
23 const std::string sshPublicHostKey;
24 bool enabled = true;
25
30 bool systemSupported(const std::string & system) const;
31
36 bool allSupported(const std::set<std::string> & features) const;
37
41 bool mandatoryMet(const std::set<std::string> & features) const;
42
43 Machine(decltype(storeUri) storeUri,
44 decltype(systemTypes) systemTypes,
45 decltype(sshKey) sshKey,
46 decltype(maxJobs) maxJobs,
47 decltype(speedFactor) speedFactor,
48 decltype(supportedFeatures) supportedFeatures,
49 decltype(mandatoryFeatures) mandatoryFeatures,
50 decltype(sshPublicHostKey) sshPublicHostKey);
51
52 kj::Promise<Result<ref<Store>>> openStore() const;
53};
54
55typedef std::vector<Machine> Machines;
56
57void parseMachines(const std::string & s, Machines & machines);
58
59Machines getMachines();
60
61}
Definition store-api.hh:195
bool mandatoryMet(const std::set< std::string > &features) const
Definition machines.cc:60
bool allSupported(const std::set< std::string > &features) const
Definition machines.cc:51
bool systemSupported(const std::string &system) const
Definition machines.cc:46