2024-03-04 00:34:39 +03:00
|
|
|
{ pkgs, ... }: {
|
|
|
|
systemd.services.backup = {
|
|
|
|
enable = true;
|
|
|
|
description = "Home system backup.";
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
2024-03-23 14:50:41 +03:00
|
|
|
ExecStart = ./bin/Backup;
|
2024-03-04 00:34:39 +03:00
|
|
|
};
|
|
|
|
path = with pkgs; [
|
|
|
|
bashInteractive
|
|
|
|
curl
|
|
|
|
gnutar
|
|
|
|
gzip
|
|
|
|
gawk
|
|
|
|
pv
|
|
|
|
];
|
2024-03-24 16:04:07 +03:00
|
|
|
environment = {
|
|
|
|
BASH_PATH = ../../module/common/bash;
|
|
|
|
};
|
2024-03-04 00:34:39 +03:00
|
|
|
# wantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.timers.backup = {
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "*-*-* 06:00:00";
|
|
|
|
Persistent = true;
|
|
|
|
Unit = "backup.service";
|
|
|
|
};
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
};
|
|
|
|
}
|