WIP: Start module for buildbot-nix #10

Closed
coded wants to merge 1 commit from push-osoxopmtxvnq into main
2 changed files with 71 additions and 0 deletions

View file

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