nixos: services: woodpecker: configurable forge

This commit is contained in:
Bruno BELANYI 2024-03-09 13:34:38 +01:00
parent b41fd9e48e
commit f3207468f9
2 changed files with 7 additions and 1 deletions

View file

@ -8,6 +8,12 @@
options.my.services.woodpecker = with lib; { options.my.services.woodpecker = with lib; {
enable = mkEnableOption "Woodpecker CI"; enable = mkEnableOption "Woodpecker CI";
forge = mkOption {
type = types.enum [ "gitea" "forgejo" ];
default = "gitea";
example = "forgejo";
description = "Which Forge to connect to";
};
runners = mkOption { runners = mkOption {
type = with types; listOf (enum [ "exec" "docker" ]); type = with types; listOf (enum [ "exec" "docker" ]);
default = [ ]; default = [ ];

View file

@ -17,7 +17,7 @@ in
WOODPECKER_GRPC_ADDR = ":${toString cfg.rpcPort}"; WOODPECKER_GRPC_ADDR = ":${toString cfg.rpcPort}";
WOODPECKER_GITEA = "true"; WOODPECKER_GITEA = "true";
WOODPECKER_GITEA_URL = config.services.gitea.settings.server.ROOT_URL; WOODPECKER_GITEA_URL = config.services.${cfg.forge}.settings.server.ROOT_URL;
WOODPECKER_LOG_LEVEL = "debug"; WOODPECKER_LOG_LEVEL = "debug";
}; };