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

24 lines
553 B
Nix
Raw Normal View History

2025-03-06 09:51:33 -06:00
{pkgs, ...}: let
2024-12-27 21:30:25 -06:00
cleanupScript = pkgs.writeShellScriptBin "cleanup-backups.sh" (
builtins.readFile ./prune-backups.sh
);
2025-03-06 09:51:33 -06:00
in {
2024-09-26 09:39:21 -05:00
systemd.timers.cleanup-backups = {
2025-03-06 09:51:33 -06:00
wantedBy = ["timers.target"];
2024-09-26 09:39:21 -05:00
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";
};
};
}