clan-infra/modules/web01/clan-merge.nix
DavHau 5ce983c8ff
Some checks failed
build / test (push) Failing after 9s
clan-merge: deploy on web01
2023-07-26 12:25:04 +02:00

25 lines
737 B
Nix

{ config, self, pkgs, ... }: {
sops.secrets.merge-bot-gitea-token = {};
# 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 \
--allowed-users DavHau lassulus mic92 \
--repos clan-core
done
'';
};
}