added backup
This commit is contained in:
parent
e9c15d095f
commit
311c85642b
3 changed files with 62 additions and 0 deletions
41
services/borgbackup.nix
Normal file
41
services/borgbackup.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
# Outbound: back up homeserver to VPS
|
||||
services.borgbackup.jobs.homeserver = {
|
||||
paths = [
|
||||
"/var/lib"
|
||||
"/etc"
|
||||
"/home"
|
||||
];
|
||||
repo = "ssh://borg@10.10.0.1/./homeserver";
|
||||
environment.BORG_RSH = "ssh -i /etc/borg/ssh_key";
|
||||
encryption = {
|
||||
mode = "repokey";
|
||||
passCommand = "cat /etc/borg/passphrase";
|
||||
};
|
||||
compression = "zstd";
|
||||
startAt = "daily";
|
||||
prune.keep = {
|
||||
daily = 7;
|
||||
weekly = 4;
|
||||
monthly = 6;
|
||||
};
|
||||
exclude = [
|
||||
"/var/lib/docker"
|
||||
"/var/lib/containers"
|
||||
"/var/lib/systemd/coredump"
|
||||
"*.pyc"
|
||||
"__pycache__"
|
||||
".cache"
|
||||
];
|
||||
};
|
||||
|
||||
# Inbound: accept desktop backups
|
||||
services.borgbackup.repos.desktop = {
|
||||
path = "/var/lib/borg/desktop";
|
||||
authorizedKeys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvKMpaawaw5bp73/W4dm0YEZa2FT99pXHLOYqZS8NPL borg-desktop"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue