feat(rpi4): add restic backup service

This commit is contained in:
Felix Schröter 2021-03-21 14:24:35 +01:00
parent b2629eccef
commit 74b696d20b
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58
2 changed files with 31 additions and 0 deletions

View file

@ -7,6 +7,7 @@ with builtins; {
# ./system
./system/nix.nix
./system/i18n.nix
./services/restic/rpi4.nix
./services/syncthing/rpi4.nix
./services/kodi.nix
./services/jellyfin.nix

30
services/restic/rpi4.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, pkgs, ... }:
{
services.restic.backups.rpi4 = {
initialize = true;
repository = "b2:felschr-rpi4-backup:/";
s3CredentialsFile = "/etc/nixos/secrets/restic/b2";
passwordFile = "/etc/nixos/secrets/restic/password";
paths = [
"/etc/nixos"
"/home/felschr/.config/syncthing"
"/home/felschr/sync/backups"
"/var/lib/etebase-server"
"/var/lib/hass"
"/var/lib/mosquitto"
"/var/lib/syncthing"
"/var/lib/jellyfin"
"/var/lib/owntracks"
"/var/lib/owntracks-recorder"
];
timerConfig = { OnCalendar = "hourly"; };
pruneOpts = [
"--keep-hourly 24"
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
"--keep-yearly 1"
];
};
}