36 lines
910 B
Nix
36 lines
910 B
Nix
|
{
|
||
|
self,
|
||
|
pkgs,
|
||
|
config,
|
||
|
...
|
||
|
}: let
|
||
|
backupSchedules = import "${self}/data/backupSchedules.nix";
|
||
|
inherit (config.services.secrets) secrets;
|
||
|
in {
|
||
|
environment.systemPackages = with pkgs; [
|
||
|
restic
|
||
|
(pkgs.writeShellScriptBin "restic-rss" ''
|
||
|
env \
|
||
|
RESTIC_PASSWORD_FILE=${secrets.restic_password.path} \
|
||
|
$(cat ${secrets.restic_env.path}) \
|
||
|
${pkgs.restic}/bin/restic $@
|
||
|
'')
|
||
|
];
|
||
|
|
||
|
services.restic.backups.rss = {
|
||
|
user = "root";
|
||
|
paths = [
|
||
|
"/var/lib/freshrss"
|
||
|
];
|
||
|
|
||
|
# repository is overrided in environmentFile to contain auth
|
||
|
# make sure to keep up to date when changing repository
|
||
|
repository = "rest:https://storage-restic.owo.monster/RSS";
|
||
|
passwordFile = "${secrets.restic_password.path}";
|
||
|
environmentFile = "${secrets.restic_env.path}";
|
||
|
|
||
|
pruneOpts = ["--keep-last 50"];
|
||
|
timerConfig = backupSchedules.restic.high;
|
||
|
};
|
||
|
}
|