add backups for NAS
This commit is contained in:
@ -35,6 +35,9 @@ in {
|
||||
sops.secrets."tailscale-auth-key" = {};
|
||||
sops.secrets."act-runner-token" = {};
|
||||
sops.secrets."photoprism-password-file" = {};
|
||||
sops.secrets."restic_ssh_key" = {};
|
||||
sops.secrets."restic_documents_repository_password" = {};
|
||||
sops.secrets."restic_images_repository_password" = {};
|
||||
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
@ -209,6 +212,28 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
restic = let
|
||||
mkBackup = repo: paths: exclude: {
|
||||
repository = "sftp:u169497-sub5@u169497.your-storagebox.de:${repo}";
|
||||
passwordFile = config.sops.secrets."restic_${repo}_repository_password".path;
|
||||
initialize = true;
|
||||
extraOptions = [
|
||||
"sftp.command='ssh -p23 u169497-sub5@u169497.your-storagebox.de -i ${config.sops.secrets."restic_ssh_key".path} -s sftp'"
|
||||
];
|
||||
paths = paths;
|
||||
exclude = exclude;
|
||||
timerConfig = {
|
||||
OnCalendar = "00:05";
|
||||
RandomizedDelaySec = "1h";
|
||||
};
|
||||
};
|
||||
in {
|
||||
backups = {
|
||||
documents = mkBackup "documents" ["/tank/documents"] [];
|
||||
images = mkBackup "images" ["/tank/images"] ["/tank/images/import"];
|
||||
};
|
||||
};
|
||||
|
||||
nginx = {
|
||||
enable = true;
|
||||
clientMaxBodySize = "500m";
|
||||
|
Reference in New Issue
Block a user