Compare commits
No commits in common. "643e38cb1fef10def75a399a4f0181a254116a3b" and "eb182bb1e7308f79bedb8a5b000aa4e3ddec15ec" have entirely different histories.
643e38cb1f
...
eb182bb1e7
4 changed files with 1 additions and 52 deletions
|
@ -26,9 +26,6 @@
|
|||
# Enable Flatpak support
|
||||
services.flatpak.enable = true;
|
||||
|
||||
# KDE Wallet PAM integration for unlocking the default wallet on login
|
||||
security.pam.services."jahanson".kwallet.enable = true;
|
||||
|
||||
# System settings and services.
|
||||
mySystem = {
|
||||
purpose = "Development";
|
||||
|
@ -39,7 +36,6 @@
|
|||
# KDE
|
||||
de.kde.enable = true;
|
||||
|
||||
|
||||
# System config
|
||||
system = {
|
||||
motd.networkInterfaces = [ "wlp1s0" ];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [ ./resources/prune-backup.nix ];
|
||||
imports = [ ];
|
||||
|
||||
networking.hostId = "cdab8473";
|
||||
networking.hostName = "varda"; # Define your hostname.
|
||||
|
@ -22,7 +22,6 @@
|
|||
|
||||
swapDevices = [ ];
|
||||
|
||||
|
||||
# System settings and services.
|
||||
mySystem = {
|
||||
purpose = "Production";
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
{ 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";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Set the backup directory
|
||||
BACKUP_DIR="/var/lib/forgejo/dump"
|
||||
|
||||
# Keep the 3 most recent backups
|
||||
KEEP_NUM=3
|
||||
|
||||
echo "Starting backup cleanup process..."
|
||||
echo "Keeping the $KEEP_NUM most recent backups in $BACKUP_DIR"
|
||||
|
||||
# Find all backup files, sort by modification time (newest first),
|
||||
# skip the first 3, and delete the rest
|
||||
find "$BACKUP_DIR" -type f -name "forgejo-dump-*" -print0 |
|
||||
sort -z -t_ -k2 -r |
|
||||
tail -z -n +$((KEEP_NUM + 1)) |
|
||||
while IFS= read -r -d '' file; do
|
||||
echo "Deleting: $file"
|
||||
rm -f "$file"
|
||||
done
|
||||
|
||||
echo "Cleanup complete. Deleted all but the $KEEP_NUM most recent backups."
|
Loading…
Reference in a new issue