2022-08-27 22:37:52 +02:00
|
|
|
{ pkgs, secret, ... }:
|
|
|
|
{
|
|
|
|
systemd.services.ical-vu-sync = {
|
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
path = with pkgs; [ bash ical2orgpy curl ];
|
|
|
|
script = ''
|
|
|
|
rm "${secret.ical2org.orgPath}"
|
|
|
|
cat <<EOF > "${secret.ical2org.orgPath}"
|
|
|
|
:PROPERTIES:
|
|
|
|
:ID: 56ed0bf0-c6d0-4a86-980a-905ccab89345
|
|
|
|
:END:
|
|
|
|
#+title: VU Calendar
|
|
|
|
#+filetags: :project-forced:
|
|
|
|
EOF
|
2022-09-17 11:21:16 +02:00
|
|
|
curl '${secret.ical2org.icalUrlRooster}' -o - | ical2orgpy - - >> "${secret.ical2org.orgPath}"
|
|
|
|
curl '${secret.ical2org.icalUrlCanvas}' -o - | CANVAS_TODO=1 ical2orgpy - - >> "${secret.ical2org.orgPath}"
|
2022-08-27 22:37:52 +02:00
|
|
|
chown 404:404 "${secret.ical2org.orgPath}"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
systemd.timers.ical-vu-sync = {
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
partOf = [ "ical-vu-sync.service" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "*-*-* 3:00:00";
|
|
|
|
Unit = "ical-vu-sync.service";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|