trying out stuff
This commit is contained in:
parent
3fb6134d23
commit
93307a7026
2 changed files with 28 additions and 25 deletions
26
backup.nix
26
backup.nix
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue