WIP: Start module for buildbot-nix

This commit is contained in:
Samuel Shuert 2024-07-02 18:41:49 -04:00
parent 5104c5e8ca
commit 432498a597
2 changed files with 71 additions and 0 deletions

View file

@ -23,6 +23,8 @@
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
buildbot-nix.url = "github:Mic92/buildbot-nix";
};
outputs = inputs: let
@ -49,6 +51,10 @@
};
};
systems.modules.nixos = [
inputs.buildbot-nix.nixosModules.buildbot-master
];
checks =
builtins.mapAttrs
(system: deploy-lib: deploy-lib.deployChecks inputs.self.deploy)

View file

@ -0,0 +1,65 @@
# SPDX-FileCopyrightText: 2024 Auxolotl Infrastructure Contributors
#
# SPDX-License-Identifier: GPL-3.0-only
{
lib,
pkgs,
config,
...
}: let
cfg = config.auxolotl.services.buildbot;
in {
options.auxolotl.services.buildbot = {
enable = lib.mkEnableOption "Matrix chat";
domain = lib.mkOption {
type = lib.types.str;
description = "Buildbot domain";
};
admins = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "List of usernames to give admin permissions to. This allows them to reload the project list.";
default = [ ];
};
gitea = {
url = lib.mkOption {
type = lib.types.str;
description = "URL of the gitea instance to connect to.";
};
oauthId = lib.mkOption {
type = lib.types.str;
description = "Oauth ID for the login buttons.";
};
};
};
config = lib.mkIf cfg.enable {
services.buildbot-nix.master = {
enable = true;
domain = cfg.domain;
admins = cfg.admins;
authBackend = "gitea";
gitea = {
tokenFile = /.;
webhookSecretFile = /.;
instanceUrl = cfg.giteaUrl;
};
};
services.nginx = {
enable = true;
virtualHosts."${cfg.domain}" = {
forceSSL = true;
enableACME = true;
};
};
};
}