1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2026-01-14 01:01:04 +00:00
ncc/modules/linux/restic/default.nix
2025-02-23 21:05:40 +03:00

20 lines
633 B
Nix

{ config, lib, ... }: let
inherit (lib) genAttrs mkConst mkIf remove;
in{
options.services.restic.hosts = mkConst <| remove config.networking.hostName [ "cube" "disk" "nine" ];
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 12"
];
});
}