rpi4: configure backups (not automated yet)

This commit is contained in:
NullBite 2024-07-17 17:29:25 -04:00
parent 1d388e1317
commit 69db034caf
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
2 changed files with 41 additions and 0 deletions

39
hosts/rpi4/backup.nix Normal file
View File

@ -0,0 +1,39 @@
{ config, lib, pkgs, ... }:
let
secret = name: config.age.secrets."${name}".path;
in
{
config = {
age.secrets.restic-rclone.file = ../../secrets/restic-rclone.age;
age.secrets.restic-password.file = ../../secrets/restic-password.age;
services.restic.backups.system = {
rcloneConfigFile = secret "restic-rclone";
passwordFile = secret "restic-password";
repository = "rclone:restic:";
exclude = [
".snapshots"
"gdlmirror"
"gitea-dump-*"
];
paths = [
"/srv"
"/srv/media"
"/srv/syncthing"
"/srv/http"
"/opt"
"/var/lib/gitea"
"/var/lib/tailscale"
"/etc"
];
dynamicFilesFrom = ''
find /var/lib -mindepth 1 -maxdepth 1 -type d -name 'authelia-*'
'';
extraBackupArgs = [
"--tag=auto"
"--group-by=host,tag"
];
};
};
}

View File

@ -9,6 +9,8 @@
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./services.nix
./backup.nix
];
fileSystems = let