mirror of
https://github.com/sstent/vmimages.git
synced 2026-01-25 06:31:35 +00:00
sync
This commit is contained in:
48
modules/nixos/restic/default.nix
Normal file
48
modules/nixos/restic/default.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
custom.restic.enable = lib.mkEnableOption "restic";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.custom.restic.enable {
|
||||
# Ensure the SOPS secret is defined
|
||||
sops.secrets.restic_odroid3 = {
|
||||
#sopsFile = ./secrets.yaml; # Adjust path to your secrets file
|
||||
mode = "0400";
|
||||
};
|
||||
|
||||
services.restic.backups.home_backup = {
|
||||
initialize = true;
|
||||
|
||||
paths = ["/home"];
|
||||
|
||||
exclude = [
|
||||
"/home/*/.cache"
|
||||
"/home/*/keybase"
|
||||
];
|
||||
|
||||
repository = "sftp:root@192.168.4.63:/mnt/Shares/_RESTIC_StuMiniWSLNIXOS";
|
||||
|
||||
passwordFile = config.sops.secrets.restic_odroid3.path;
|
||||
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 10"
|
||||
];
|
||||
|
||||
checkOpts = ["--with-cache"];
|
||||
|
||||
timerConfig = {
|
||||
OnBootSec = "3m";
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user