refactor backup
This commit is contained in:
@@ -4,6 +4,13 @@ let
|
||||
gitolite = "/var/lib/gitolite";
|
||||
syncthing = [ "/synced/default/" "/synced/work_drive/" ];
|
||||
syncthingFull = syncthing ++ [ "/synced/fh/" "/synced/books/" ];
|
||||
excludePaths = [ "/home/**/Cache" "/home/**/.cache" "/home/**/__pycache__" "/home/**/node_modules" "/home/**/venv" ];
|
||||
excludePathsRemote = excludePaths ++ "/home/**/dont_remotebackup";
|
||||
backupPathsSmall = [ "/home" "/var/backup/postgresql" gitolite ] ++ syncthing;
|
||||
backupPathsMedium = [ "/home" "/var/backup/postgresql" "/mnt/250ssd/matrix-synapse/media_store/" "/mnt/250ssd/paperless" gitolite ] ++ syncthing;
|
||||
backupPathsFull = [ "/home" "/var/backup/postgresql" "/mnt/250ssd/matrix-synapse/media_store/" "/mnt/250ssd/paperless"
|
||||
kavita gitolite ] ++ syncthingFull;
|
||||
|
||||
in
|
||||
{
|
||||
age.secrets.restic-pw = {
|
||||
@@ -18,68 +25,26 @@ in
|
||||
services.restic = {
|
||||
backups = {
|
||||
localbackup = {
|
||||
exclude = [
|
||||
"/home/**/Cache"
|
||||
"/home/**/.cache"
|
||||
"/home/**/__pycache__"
|
||||
"/home/**/node_modules"
|
||||
"/home/**/venv"
|
||||
];
|
||||
initialize = true;
|
||||
passwordFile = config.age.secrets.restic-pw.path;
|
||||
paths = [
|
||||
"/home"
|
||||
"/var/backup/postgresql"
|
||||
"/mnt/250ssd/matrix-synapse/media_store/"
|
||||
"/mnt/250ssd/nextcloud"
|
||||
"/mnt/250ssd/paperless"
|
||||
kavita
|
||||
gitolite
|
||||
] ++ syncthingFull;
|
||||
exclude = excludePaths;
|
||||
paths = backupPathsFull;
|
||||
pruneOpts = [ "--keep-daily 7" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
|
||||
repository = "/mnt/2tb/restic";
|
||||
};
|
||||
localbackup-1tb-ssd = {
|
||||
exclude = [
|
||||
"/home/**/Cache"
|
||||
"/home/**/.cache"
|
||||
"/home/**/__pycache__"
|
||||
"/home/**/node_modules"
|
||||
"/home/**/venv"
|
||||
];
|
||||
initialize = true;
|
||||
passwordFile = config.age.secrets.restic-pw.path;
|
||||
paths = [
|
||||
"/home"
|
||||
"/var/backup/postgresql"
|
||||
"/mnt/250ssd/matrix-synapse/media_store/"
|
||||
"/mnt/250ssd/nextcloud"
|
||||
"/mnt/250ssd/paperless"
|
||||
kavita
|
||||
gitolite
|
||||
] ++ syncthingFull;
|
||||
exclude = excludePaths;
|
||||
paths = backupPathsFull;
|
||||
pruneOpts = [ "--keep-daily 7" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
|
||||
repository = "/mnt/1tbssd/restic";
|
||||
};
|
||||
localbackup-1tb = {
|
||||
initialize = true;
|
||||
passwordFile = config.age.secrets.restic-pw.path;
|
||||
paths = [
|
||||
"/home"
|
||||
"/var/backup/postgresql"
|
||||
"/mnt/250ssd/matrix-synapse/media_store/"
|
||||
"/mnt/250ssd/nextcloud"
|
||||
"/mnt/250ssd/paperless"
|
||||
kavita
|
||||
gitolite
|
||||
] ++ syncthingFull;
|
||||
exclude = [
|
||||
"/home/**/Cache"
|
||||
"/home/**/.cache"
|
||||
"/home/**/__pycache__"
|
||||
"/home/**/node_modules"
|
||||
"/home/**/venv"
|
||||
];
|
||||
exclude = excludePaths;
|
||||
paths = backupPathsFull;
|
||||
repository = "/mnt/1tb/restic";
|
||||
pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
|
||||
timerConfig = {
|
||||
@@ -90,22 +55,8 @@ in
|
||||
remotebackup-gdrive = {
|
||||
initialize = true;
|
||||
passwordFile = config.age.secrets.restic-pw.path;
|
||||
paths = [
|
||||
"/home"
|
||||
"/var/backup/postgresql"
|
||||
"/mnt/250ssd/matrix-synapse/media_store/"
|
||||
"/mnt/250ssd/paperless"
|
||||
gitolite
|
||||
] ++ syncthing;
|
||||
exclude = [
|
||||
"/home/**/Cache"
|
||||
"/home/**/.cache"
|
||||
"/home/**/__pycache__"
|
||||
"/home/**/node_modules"
|
||||
"/home/**/dont_remotebackup"
|
||||
"/home/**/venv"
|
||||
"**/emu"
|
||||
];
|
||||
exclude = excludePathsRemote;
|
||||
paths = backupPathsMedium;
|
||||
rcloneConfigFile = config.age.secrets.restic-gdrive.path;
|
||||
repository = "rclone:it-experts:backup";
|
||||
pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
|
||||
@@ -115,22 +66,11 @@ in
|
||||
};
|
||||
};
|
||||
remotebackup = {
|
||||
exclude = [
|
||||
"/home/**/Cache"
|
||||
"/home/**/.cache"
|
||||
"/home/**/__pycache__"
|
||||
"/home/**/node_modules"
|
||||
"/home/**/venv"
|
||||
"/home/**/dont_remotebackup"
|
||||
];
|
||||
initialize = true;
|
||||
passwordFile = config.age.secrets.restic-pw.path;
|
||||
environmentFile = config.age.secrets.restic-s3.path;
|
||||
paths = [
|
||||
"/home"
|
||||
"/var/backup/postgresql"
|
||||
gitolite
|
||||
] ++ syncthing;
|
||||
exclude = excludePathsRemote;
|
||||
paths = backupPathsSmall;
|
||||
pruneOpts = [ "--keep-daily 5" "--keep-weekly 3" "--keep-monthly 3" "--keep-yearly 3" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-03,06,09,12,15,18,21,24,27,30 00:00:00";
|
||||
|
||||
@@ -9,9 +9,12 @@ in
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
documentation.dev.enable = true;
|
||||
environment.systemPackages = with pkgs; [
|
||||
man-pages
|
||||
kate
|
||||
jetbrains.idea-ultimate
|
||||
jetbrains.clion
|
||||
insomnia
|
||||
nodejs_21 # needed for tabby extension
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user