parent
e9dc4601ad
commit
de3f8f8909
|
@ -35,6 +35,7 @@
|
||||||
"/data/misc"
|
"/data/misc"
|
||||||
"/data/torrent"
|
"/data/torrent"
|
||||||
];
|
];
|
||||||
|
prune = true;
|
||||||
};
|
};
|
||||||
unfree.allowSoftware = true;
|
unfree.allowSoftware = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -64,6 +64,7 @@ in
|
||||||
type = lib.types.nullOr lib.types.int;
|
type = lib.types.nullOr lib.types.int;
|
||||||
default = 1500;
|
default = 1500;
|
||||||
};
|
};
|
||||||
|
prune = lib.mkEnableOption "pruning";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -98,6 +99,25 @@ in
|
||||||
"IOSchedulingPriority" = 7;
|
"IOSchedulingPriority" = 7;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.restic.backups.system-prune = lib.mkIf cfg.prune {
|
||||||
|
inherit repository;
|
||||||
|
passwordFile = config.sops.secrets.restic-password.path;
|
||||||
|
s3CredentialsFile = config.sops.secrets.restic-s3.path;
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "*-1/2-07 03:00:00";
|
||||||
|
RandomizedDelaySec = "4h";
|
||||||
|
};
|
||||||
|
paths = [ ];
|
||||||
|
pruneOpts = [
|
||||||
|
"--keep-daily 7"
|
||||||
|
"--keep-monthly 12"
|
||||||
|
"--keep-weekly 5"
|
||||||
|
"--keep-yearly 10"
|
||||||
|
"--tag system"
|
||||||
|
"--verbose"
|
||||||
|
] ++ lib.optional (cfg.uploadLimit != null) "--limit-upload=${toString cfg.uploadLimit}";
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
authScript
|
authScript
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue