2023-07-26 10:25:04 +00:00
|
|
|
{ config, self, pkgs, ... }: {
|
|
|
|
|
2023-07-26 10:36:53 +00:00
|
|
|
sops.secrets.merge-bot-gitea-token = { };
|
2023-07-26 10:25:04 +00:00
|
|
|
|
|
|
|
# service to for automatic merge bot
|
|
|
|
systemd.services.clan-merge = {
|
|
|
|
description = "Merge clan.lol PRs automatically";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
after = [ "network.target" ];
|
|
|
|
environment = { GITEA_TOKEN_FILE = "%d/GITEA_TOKEN_FILE"; };
|
|
|
|
serviceConfig = {
|
|
|
|
LoadCredential = [ "GITEA_TOKEN_FILE:${config.sops.secrets.merge-bot-gitea-token.path}" ];
|
|
|
|
Restart = "on-failure";
|
|
|
|
DynamicUser = true;
|
|
|
|
};
|
2023-07-28 14:56:21 +00:00
|
|
|
script = ''
|
2023-07-26 10:25:04 +00:00
|
|
|
while sleep 10; do
|
|
|
|
${self.packages.${pkgs.system}.clan-merge}/bin/clan-merge \
|
2023-07-28 11:26:12 +00:00
|
|
|
--allowed-users clan-bot DavHau lassulus Mic92 \
|
2023-07-26 12:34:13 +00:00
|
|
|
--repos clan-infra clan-core clan-homepage \
|
2023-07-26 12:33:36 +00:00
|
|
|
--bot-name clan-bot
|
2023-07-26 10:25:04 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|