feat(backup): backup server to borgbase daily
This commit is contained in:
parent
4d4249f627
commit
7e714fe3e2
2 changed files with 31 additions and 0 deletions
30
borgbackup.nix
Normal file
30
borgbackup.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
services.borgbackup.jobs."borgbase" = {
|
||||||
|
paths = [
|
||||||
|
"/var/backup"
|
||||||
|
"/var/lib/sourcehut"
|
||||||
|
"/etc/nixos"
|
||||||
|
"/root"
|
||||||
|
"/home"
|
||||||
|
];
|
||||||
|
exclude = [
|
||||||
|
"**/*cache"
|
||||||
|
"**/*Cache"
|
||||||
|
"**/*trash"
|
||||||
|
"**/*Trash"
|
||||||
|
"/home/*/.local"
|
||||||
|
"**/target"
|
||||||
|
"**/result"
|
||||||
|
];
|
||||||
|
repo = "foy40rzb@foy40rzb.repo.borgbase.com:repo";
|
||||||
|
encryption = {
|
||||||
|
mode = "repokey-blake2";
|
||||||
|
passCommand = "cat /root/borgbackup/passphrase";
|
||||||
|
};
|
||||||
|
environment.BORG_RSH = "ssh -i /root/borgbackup/ssh_key";
|
||||||
|
compression = "auto,lzma";
|
||||||
|
startAt = "daily";
|
||||||
|
# also start if the starttime was missed
|
||||||
|
persistentTimer = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,7 @@ in
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./firewall.nix
|
./firewall.nix
|
||||||
|
./borgbackup.nix
|
||||||
|
|
||||||
(import ./acme.nix { inherit base-domain; })
|
(import ./acme.nix { inherit base-domain; })
|
||||||
(import ./nginx.nix { inherit base-domain; })
|
(import ./nginx.nix { inherit base-domain; })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue