buildbot-nix/examples/default.nix

58 lines
1.7 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-10-27 07:58:10 +00:00
({ pkgs, ... }: {
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-10-27 07:58:10 +00:00
workersFile = pkgs.writeText "workers.json" ''
[
{ "name": "eve", "pass": "XXXXXXXXXXXXXXXXXXXX", "cores": 16 }
]
'';
2023-09-10 10:11:50 +00:00
github = {
2023-10-27 07:58:10 +00:00
tokenFile = pkgs.writeText "github-token" "ghp_000000000000000000000000000000000000";
webhookSecretFile = pkgs.writeText "webhookSecret" "00000000000000000000";
oauthSecretFile = pkgs.writeText "oauthSecret" "ffffffffffffffffffffffffffffffffffffffff";
oauthId = "aaaaaaaaaaaaaaaaaaaa";
2023-10-12 13:20:50 +00:00
user = "mic92-buildbot";
admins = [ "Mic92" ];
2023-09-10 10:11:50 +00:00
};
};
2023-10-27 07:58:10 +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-10-27 07:58:10 +00:00
({ pkgs, ... }: {
2023-09-10 10:11:50 +00:00
services.buildbot-nix.worker = {
enable = true;
2023-10-27 07:58:10 +00:00
workerPasswordFile = pkgs.writeText "worker-password-file" "";
2023-09-10 10:11:50 +00:00
};
2023-10-27 07:58:10 +00:00
})
2023-09-10 09:16:51 +00:00
buildbot-nix.nixosModules.buildbot-worker
];
};
}