fix(backups): fix & improve ripgrep matching

This commit is contained in:
Felix Schröter 2022-05-01 16:44:29 +02:00
parent 68d499f5cf
commit d20b90ecb9
Signed by: felschr
GPG key ID: 671E39E6744C807D
3 changed files with 56 additions and 38 deletions

View file

@ -12,27 +12,25 @@ in {
services.restic.backups.full = common.resticConfig {
name = "home-pc";
dynamicFilesFrom = let
ignore = builtins.toFile "excludes" ''
/var/lib/lxcfs
/var/lib/docker
/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
'';
in ''
${pkgs.ripgrep}/bin/rg \
--files /etc/nixos /var/lib /home \
--ignore-file ${ignore}
'';
ripgrep = true;
paths = [ "/etc/nixos" "/var/lib" "/home" ];
ignorePatterns = [
"/var/lib/systemd"
"/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"
];
timerConfig.OnCalendar = "0/4:00:00";
extraPruneOpts = [ "--keep-last 6" ];
};