buildbot-nix/examples/default.nix

68 lines
2.4 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-12-24 07:12:42 +00:00
# All github projects with this topic will be added to buildbot.
# One can trigger a project scan by visiting the Builds -> Builders page and looking for the "reload-github-project" builder.
# This builder has a "Update Github Projects" button that everyone in the github organization can use.
topic = "buildbot-mic92";
2023-09-10 10:11:50 +00:00
};
2023-12-23 18:54:42 +00:00
# optional expose latest store path as text file
2023-11-05 05:44:28 +00:00
# outputsPath = "/var/www/buildbot/nix-outputs";
2023-11-12 06:07:30 +00:00
# optional nix-eval-jobs settings
# evalWorkerCount = 8; # limit number of concurrent evaluations
# evalMaxMemorySize = "2048"; # limit memory usage per evaluation
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
];
};
}