forked from nix-community/buildbot-nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
61 lines (59 loc) · 1.88 KB
/
default.nix
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ nixpkgs, system, buildbot-nix, ... }:
let
# some example configuration to make it eval
dummy = { config, ... }: {
config = {
networking.hostName = "example-common";
system.stateVersion = config.system.nixos.version;
users.users.root.initialPassword = "fnord23";
boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ];
fileSystems."/".device = lib.mkDefault "/dev/sda";
};
};
inherit (nixpkgs) lib;
inherit (lib) nixosSystem;
in
{
# This runs both master and worker on the same machine.
# As the actual build is offloaded with remote builder,
# this also works well for production setups.
"example-master-worker-combined-${system}" = nixosSystem {
inherit system;
modules = [
dummy
buildbot-nix.nixosModules.buildbot-master
buildbot-nix.nixosModules.buildbot-worker
./master.nix
./worker.nix
];
};
"example-master-${system}" = nixosSystem {
inherit system;
modules = [
dummy
buildbot-nix.nixosModules.buildbot-master
./master.nix
# When master and worker run on different machines,
# we need to configure the master to listen on a public address.
# Also check out the buildbot upstream documentation on the master-worker protocol,
# including tls encryption
{
# exposes the master build protocol on port 9989
services.buildbot-master.extraConfig = ''
c["protocols"] = {"pb": {"port": "tcp:9989:interface=\\:\\:"}}
'';
networking.firewall.allowedTCPPorts = [ 9989 ];
}
];
};
"example-worker-${system}" = nixosSystem {
inherit system;
modules = [
dummy
buildbot-nix.nixosModules.buildbot-worker
./worker.nix
# Connects to a master on the ipv6 address 2a09:80c0:102::1
{ services.buildbot-nix.worker.masterUrl = ''tcp:host=2a09\:80c0\:102\:\:1:port=9989''; }
];
};
}