nixos-config/common/nixos/restic.nix
gwg313 bb2fe56082
Some checks failed
Basic Code Checks / formatting-check (push) Has been cancelled
style
Signed-off-by: gwg313 <gwg313@pm.me>
2025-07-03 10:34:00 -04:00

35 lines
774 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"
];
# extraBackupArgs = [ "--exclude-file=/home/gwg313/Documents/Celsus" ];
timerConfig = {
OnCalendar = "06:40";
};
};
};
};
}