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

25 lines
527 B
Nix
Raw Normal View History

2024-09-26 09:39:21 -05:00
{ pkgs, ... }:
let
2024-09-30 23:44:33 -05:00
cleanupScript = pkgs.writeShellScriptBin "cleanup-backups.sh" (builtins.readFile ./prune-backups.sh);
2024-09-26 09:39:21 -05:00
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";
};
};
}