nixos-config/services/restic/home-pc.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

2022-01-27 15:01:24 +01:00
{ config, lib, pkgs, ... }:
# using the restic cli:
2022-05-09 12:26:12 +02:00
# load credentials into shell by adding B2 secrets to .env (see .env.example).
2022-01-27 15:01:24 +01:00
# useful commands for analysing restic stats [snapshot-id], restic diff [s1] [s2],
with lib;
with builtins;
let resticLib = import ./lib.nix { inherit config lib pkgs; };
2022-01-27 15:01:24 +01:00
in {
imports = [ ./common.nix ];
2022-01-27 15:01:24 +01:00
environment.systemPackages = with pkgs; [ restic ];
services.restic.backups.full = resticLib.resticConfig {
2022-01-27 15:01:24 +01:00
name = "home-pc";
ripgrep = true;
paths = [ "/etc/nixos" "/var/lib" "/home" ];
ignorePatterns = [
"/var/lib/systemd"
"/var/lib/containers"
"/var/lib/lxcfs"
"/var/lib/docker"
"/var/lib/flatpak"
"/home/*/.local/share/Trash"
"/home/*/.cache"
"/home/*/Downloads"
"/home/*/.npm"
"/home/*/Games"
"/home/*/.steam"
"/home/*/.local/share/Steam"
"/home/*/.local/share/lutris"
"/home/felschr/media"
"/home/felschr/sync"
"/home/felschr/keybase"
];
2022-01-27 15:01:24 +01:00
timerConfig.OnCalendar = "0/4:00:00";
extraPruneOpts = [ "--keep-last 6" ];
};
}