nixos-config/common/nixos/restic.nix
2025-03-22 17:00:50 -04:00

34 lines
694 B
Nix

{
config,
lib,
user,
...
}:
{
options = {
restic.enable = lib.mkEnableOption "Enables Restic";
};
config = lib.mkIf config.nfs.enable {
sops.secrets.restic_key = {
owner = config.users.users.${user}.name;
};
services.restic.backups = {
backups = {
user = "${user}";
repository = "/backups/grymforge";
initialize = true;
passwordFile = "${config.sops.secrets.restic_key.path}";
paths = [
"/home/${user}/repos"
"/home/${user}/Documents"
"/home/${user}/.local/share/password-store"
];
timerConfig = {
OnCalendar = "23:00";
};
};
};
};
}