buildbot-nix/examples/default.nix

61 lines
1.8 KiB
Nix
Raw Normal View History

2023-09-15 07:10:02 +00:00
{ nixpkgs, system, buildbot-nix, ... }:
2023-09-10 09:16:51 +00:00
let
# some example configuration to make it eval
dummy = { config, ... }: {
2023-09-10 11:16:33 +00:00
config = {
networking.hostName = "example-common";
system.stateVersion = config.system.nixos.version;
users.users.root.initialPassword = "fnord23";
2023-09-13 21:31:20 +00:00
boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ];
fileSystems."/".device = lib.mkDefault "/dev/sda";
2023-09-10 11:16:33 +00:00
};
2023-09-10 09:16:51 +00:00
};
inherit (nixpkgs) lib;
inherit (lib) nixosSystem;
in
{
2023-09-15 07:10:02 +00:00
"example-master-${system}" = nixosSystem {
2023-09-10 09:16:51 +00:00
inherit system;
modules = [
dummy
2023-09-10 11:16:33 +00:00
{
2023-09-10 10:11:50 +00:00
services.buildbot-nix.master = {
2023-09-10 11:16:33 +00:00
enable = true;
2023-09-10 11:29:56 +00:00
domain = "buildbot2.thalheim.io";
2023-09-10 11:16:33 +00:00
workersFile = "/var/lib/secrets/buildbot-nix/workers.json";
2023-09-10 10:11:50 +00:00
github = {
2023-09-10 11:16:33 +00:00
tokenFile = "/var/lib/secrets/buildbot-nix/github-token";
webhookSecretFile = "/var/lib/secrets/buildbot-nix/github-webhook-secret";
oauthSecretFile = "/var/lib/secrets/buildbot-nix/github-oauth-secret";
oauthId = "aaaaaaaaaaaaaaaaaaaa";
2023-09-10 10:11:50 +00:00
githubUser = "mic92-buildbot";
githubAdmins = [ "Mic92" ];
};
};
2023-09-10 11:29:56 +00:00
services.nginx.virtualHosts."buildbot2.thalheim.io" = {
enableACME = true;
forceSSL = true;
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
security.acme.acceptTerms = true;
security.acme.defaults.email = "joerg.acme@thalheim.io";
2023-09-10 10:11:50 +00:00
}
2023-09-10 09:16:51 +00:00
buildbot-nix.nixosModules.buildbot-master
];
};
2023-09-15 07:10:02 +00:00
"example-worker-${system}" = nixosSystem {
2023-09-10 09:16:51 +00:00
inherit system;
modules = [
dummy
2023-09-10 11:16:33 +00:00
{
2023-09-10 10:11:50 +00:00
services.buildbot-nix.worker = {
enable = true;
2023-09-10 11:16:33 +00:00
workerPasswordFile = "/var/lib/secrets/buildbot-nix/worker-password";
2023-09-10 10:11:50 +00:00
};
}
2023-09-10 09:16:51 +00:00
buildbot-nix.nixosModules.buildbot-worker
];
};
}