nixos-config/services/restic/rpi4.nix

30 lines
824 B
Nix
Raw Normal View History

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-01-27 15:01:24 +01:00
let common = import ./common.nix { inherit config lib pkgs; };
in {
2021-05-12 23:22:52 +02:00
environment.systemPackages = with pkgs; [ restic ];
2022-01-27 15:01:24 +01:00
services.restic.backups.full = common.resticConfig {
name = "rpi4";
ripgrep = true;
2021-10-23 00:37:30 +02:00
paths = [ "/etc/nixos" "/var/lib" "/home" ];
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
};
}