mirror of
https://github.com/RGBCube/ncc
synced 2025-05-31 22:18:12 +00:00
20 lines
622 B
Nix
20 lines
622 B
Nix
{ config, lib, ... }: let
|
|
inherit (lib) genAttrs mkConst mkIf remove;
|
|
in{
|
|
options.services.restic.hosts = mkConst remove config.networking.hostName [ "nine" "best" ];
|
|
|
|
config.secrets.resticPassword.file = mkIf config.isServer ./password.age;
|
|
|
|
config.services.restic.backups = mkIf config.isServer <| genAttrs config.services.restic.hosts (host: {
|
|
repository = "sftp:backup@${host}:${config.networking.hostName}-backup";
|
|
passwordFile = config.secrets.resticPassword.path;
|
|
initialize = true;
|
|
|
|
pruneOpts = [
|
|
"--keep-daily 7"
|
|
"--keep-weekly 4"
|
|
"--keep-monthly 3"
|
|
];
|
|
});
|
|
}
|
|
|