added syncthing backups.
This commit is contained in:
parent
97238bddbd
commit
811dfa165e
3 changed files with 26 additions and 2 deletions
|
@ -8,6 +8,7 @@
|
|||
imports = [
|
||||
../../configs/nixos/nginx.nix
|
||||
];
|
||||
services.nginx.clientMaxBodySize="100m";
|
||||
services.nginx.virtualHosts = {
|
||||
"gabevenberg.com" = {
|
||||
enableACME = true;
|
||||
|
|
|
@ -27,8 +27,33 @@ in {
|
|||
path = "/backup/restic/.htpasswd";
|
||||
owner="restic";
|
||||
};
|
||||
secrets.restic-url = {
|
||||
sopsFile = "${inputs.nix-secrets}/restic-client.yaml";
|
||||
owner = config.host.user;
|
||||
};
|
||||
secrets.restic-password = {
|
||||
sopsFile = "${inputs.nix-secrets}/restic-client.yaml";
|
||||
owner = config.host.user;
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
restic
|
||||
];
|
||||
|
||||
services.restic.backups = lib.mkIf (inputs ? nix-secrets) {
|
||||
remote = {
|
||||
repositoryFile = config.sops.secrets.restic-url.path;
|
||||
passwordFile = config.sops.secrets.restic-password.path;
|
||||
initialize = true;
|
||||
paths = [
|
||||
"/storage/syncthing"
|
||||
];
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
RandomizedDelaySec = "4h";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue