clan-infra/modules/web01/clan-merge.nix
Jörg Thalheim 638ad6d498
All checks were successful
build / test (pull_request) Successful in 6s
switch to clan-core secrets
2023-08-23 15:06:46 +02:00

32 lines
917 B
Nix

{ config, self, pkgs, ... }: {
# 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;
};
script = ''
while sleep 10; do
${self.packages.${pkgs.system}.clan-merge}/bin/clan-merge \
--bot-name clan-bot \
--allowed-users \
clan-bot \
hsjobeki \
DavHau \
lassulus \
Mic92 \
Qubasa \
--repos\
clan-infra \
clan-core \
clan-homepage
done
'';
};
}