blob: 12409db0b481fcf623d95e4d557e78576e6cc1d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
{lib, config, ...}:
let
machines = {
pinto = {
maxJobs = 2;
protocol = "ssh-ng";
supportedFeatures = ["big-parallel" "kvm"];
};
};
enabled = config.this.buildMachines;
inherit (lib.attrsets) filterAttrs;
in
{
options = {
this.buildMachines = lib.mkOption {
type = with lib.types; listOf str;
default = [];
};
};
config = {
nix.buildMachines = builtins.map
(m: machines."${m}" // { hostName = m; })
enabled;
nix.distributedBuilds = (enabled == []);
nix.extraOptions = lib.mkIf (enabled != []) ''
builders-use-substitutes = true
'';
};
}
|