45 lines
1 KiB
Nix
45 lines
1 KiB
Nix
|
{ config, lib, ... }:
|
||
|
let secrets = config.services.secrets.secrets;
|
||
|
in {
|
||
|
services.rclone-sync = let
|
||
|
sync_defaults = {
|
||
|
serviceConfig = { after = [ "secrets-init.service" ]; };
|
||
|
timerConfig = {
|
||
|
OnStartupSec = "60";
|
||
|
OnCalendar = "4h";
|
||
|
};
|
||
|
};
|
||
|
in {
|
||
|
enable = true;
|
||
|
user = "storage";
|
||
|
sync_jobs = map (x: lib.mkMerge [ x sync_defaults ]) [
|
||
|
# My B2
|
||
|
{
|
||
|
source = "StorageBox:Backups";
|
||
|
dest = "B2-Chaos-Backups:";
|
||
|
}
|
||
|
{
|
||
|
source = "StorageBox:Photos";
|
||
|
dest = "B2-Chaos-Photos:";
|
||
|
}
|
||
|
{
|
||
|
source = "StorageBox:Music";
|
||
|
dest = "B2-Chaos-Music:";
|
||
|
}
|
||
|
# Pheonix System's B2
|
||
|
{
|
||
|
source = "StorageBox:Backups";
|
||
|
dest = "B2-Phoenix-Cryptidz-Storage:Backups";
|
||
|
}
|
||
|
{
|
||
|
source = "StorageBox:Photos";
|
||
|
dest = "B2-Phoenix-Cryptidz-Storage:Photos";
|
||
|
}
|
||
|
{
|
||
|
source = "StorageBox:Music";
|
||
|
dest = "B2-Phoenix-Cryptidz-Storage:Music";
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
}
|