mochi/nixos/hosts/varda/resources/prune-backup.nix

25 lines
519 B
Nix
Raw Normal View History

2024-09-26 09:39:21 -05:00
{ pkgs, ... }:
let
cleanupScript = pkgs.writeScript "cleanup-backups.sh" (builtins.readFile ./prune-backups.sh);
in
{
systemd.timers.cleanup-backups = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
systemd.services.cleanup-backups = {
script = "${cleanupScript}";
serviceConfig = {
Type = "oneshot";
User = "forgejo";
StandardOutput = "journal+console";
StandardError = "journal+console";
};
};
}