This commit is contained in:
Henri Dohmen 2025-07-14 22:57:12 +02:00
parent a018670eae
commit 4183ccb893
Signed by: hd
GPG key ID: AB79213B044674AE
14 changed files with 169 additions and 38 deletions

41
host/roam/backup.nix Normal file
View file

@ -0,0 +1,41 @@
{
config,
pkgs,
secrets,
var,
...
}:
{
age.secrets.roam-rclone-conf = {
file = secrets.roam."rclone-conf.age";
mode = "440";
owner = "root";
group = "root";
};
systemd = {
timers."backup-rclone" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
Unit = "backup-rclone.service";
};
};
services."backup-rclone" =
let
conf = config.age.secrets.roam-rclone-conf.path;
in
{
script = ''
${pkgs.rclone}/bin/rclone --config ${conf} copy /home/hd/Documents odc:Documents
${pkgs.rclone}/bin/rclone --config ${conf} copy /git odc:git
'';
path = [ pkgs.rclone ];
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
};
}