trying out stuff

This commit is contained in:
Lyn 2024-02-17 03:11:14 +01:00
parent f8e66a1684
commit f8f19d7d52
2 changed files with 28 additions and 25 deletions

View file

@ -28,3 +28,29 @@ let
# Prune old backups
${pkgs.borgbackup}/bin/borg prune --list $BORG_REPO --prefix 'forgejo-' --show-rc --keep-daily=7 --keep-weekly=4 --keep-monthly=6
'';
in
{
environment.systemPackages = [ pkgs.borgbackup ];
# Create folders
systemd.tmpfiles.rules = [
"d /borgbackupcache 700 root root"
];
# Backup timer
systemd.services.borg-backup = {
description = "Borg Backup for Forgejo and MySQL";
serviceConfig = {
ExecStart = "${forgejo-borgbackup}";
User = "root";
};
wantedBy = [ "multi-user.target" ];
};
systemd.timers.borg-backup = {
description = "Daily Borg Backup Timer";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
}

View file

@ -56,13 +56,9 @@
vim
wget
curl
borgbackup
];
# Create folders
systemd.tmpfiles.rules = [
"d /borgbackupcache 700 root root"
];
# Enable the OpenSSH daemon.
@ -111,25 +107,6 @@
AuthorizedKeysFile ${config.users.users.forgejo.home}/.ssh/authorized_keys
'';
# Backup timer
systemd.services.borg-backup = {
description = "Borg Backup for Forgejo and MySQL";
serviceConfig = {
ExecStart = "${forgejo-borgbackup}";
User = "root";
};
wantedBy = [ "multi-user.target" ];
};
systemd.timers.borg-backup = {
description = "Daily Borg Backup Timer";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
#enable qemu-guestagent
services.qemuGuest.enable = true;
# Disable password checking for wheel group users so we can solely rely on ssh keys