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

25 lines
550 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 = {
2024-10-01 06:47:28 -05:00
script = "${cleanupScript}/bin/cleanup-backups.sh";
2024-09-26 09:39:21 -05:00
serviceConfig = {
Type = "oneshot";
User = "forgejo";
StandardOutput = "journal+console";
StandardError = "journal+console";
};
};
}