2021-03-21 15:55:57 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2021-08-04 22:27:47 +02:00
|
|
|
# using the restic cli:
|
|
|
|
# load credentials into shell via: export $(cat /path/to/credentials/file | xargs)
|
|
|
|
# useful commands for analysing restic stats [snapshot-id], restic diff [s1] [s2],
|
|
|
|
|
2021-03-21 15:55:57 +01:00
|
|
|
with lib;
|
|
|
|
with builtins;
|
2022-05-06 03:16:17 +02:00
|
|
|
let resticLib = import ./lib.nix { inherit config lib pkgs; };
|
2021-03-21 15:39:11 +01:00
|
|
|
in {
|
2022-05-06 03:16:17 +02:00
|
|
|
imports = [ ./common.nix ];
|
|
|
|
|
2021-05-12 23:22:52 +02:00
|
|
|
environment.systemPackages = with pkgs; [ restic ];
|
|
|
|
|
2022-05-06 03:16:17 +02:00
|
|
|
services.restic.backups.full = resticLib.resticConfig {
|
2022-01-27 15:01:24 +01:00
|
|
|
name = "rpi4";
|
2022-05-06 03:16:17 +02:00
|
|
|
# TODO migrate old repository
|
|
|
|
# repository = "b2:felschr-rpi4-backup:/full";
|
2022-05-01 16:44:29 +02:00
|
|
|
ripgrep = true;
|
2021-10-23 00:37:30 +02:00
|
|
|
paths = [ "/etc/nixos" "/var/lib" "/home" ];
|
2022-05-01 16:44:29 +02:00
|
|
|
ignorePatterns = [
|
|
|
|
"/var/lib/lxcfs"
|
|
|
|
"/var/lib/docker"
|
|
|
|
"/var/lib/flatpak"
|
|
|
|
"/var/lib/systemd"
|
|
|
|
"/home/*/.local/share/Trash"
|
|
|
|
"/home/*/.cache"
|
|
|
|
"/var/lib/jellyfin/transcodes"
|
|
|
|
];
|
2021-10-23 00:37:30 +02:00
|
|
|
timerConfig.OnCalendar = "0/4:00:00";
|
|
|
|
extraPruneOpts = [ "--keep-last 6" ];
|
2021-03-21 14:24:35 +01:00
|
|
|
};
|
|
|
|
}
|