backup module fix, it now supports multiple folders

This commit is contained in:
boyreau 2026-08-19 11:26:13 +02:00
commit cf8a2f0b74
5 changed files with 145 additions and 122 deletions

View file

@ -0,0 +1,24 @@
{
path,
config,
script,
}:
{
timers."backup-${baseNameOf path}" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "5m";
OnCalendar = "* *-*-* 00:00:00";
Unit = "backup-${baseNameOf path}.service";
Persistent = true;
};
};
services."backup-${baseNameOf path}" = {
enable = config.enable;
description = "Saves a directory and its content.";
serviceConfig = {
Type = "simple";
ExecStart = "${script}/bin/backup-${baseNameOf path}.sh";
};
};
}