feat(backup): first borgbackup module test

https://xeiaso.net/blog/borg-backup-2021-01-09/
This commit is contained in:
Khaïs COLIN 2024-08-12 16:58:39 +02:00
parent 1c362fbf82
commit e64cf18222
2 changed files with 38 additions and 0 deletions

37
nixos/borgbackup.nix Normal file
View file

@ -0,0 +1,37 @@
{
services.borgbackup.jobs."borgbase" = {
paths = [
# server storage
"/var/lib/postgresql"
"/var/lib/sourcehut"
# user storage
"/home"
];
exclude = [
# remote mounted folders
"/home/khais/Music"
"/home/khais/Books"
# scratch directories
"/home/*/Downloads"
"/home/*/.local"
# cache & trash directories
"**/*cache"
"**/*Cache"
"**/*trash"
"**/*Trash"
# already cloud apps
"**/.mozilla/firefox"
# build-output directories
"**/target"
"**/result"
];
repo = "lni0x30f@lni0x30f.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";
};
}

View file

@ -8,6 +8,7 @@
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./sourcehut.nix
./borgbackup.nix
];
# Bootloader.