2023-06-12 23:25:40 +02:00
|
|
|
{
|
2024-03-02 22:05:30 +01:00
|
|
|
pkgs,
|
|
|
|
secret,
|
|
|
|
...
|
|
|
|
}: {
|
2023-06-12 23:25:40 +02:00
|
|
|
systemd.services.ical-vu-sync = {
|
|
|
|
serviceConfig.Type = "oneshot";
|
|
|
|
path = with pkgs; [
|
|
|
|
bash
|
|
|
|
ical2orgpy
|
|
|
|
curl
|
|
|
|
];
|
|
|
|
script = ''
|
|
|
|
rm "${secret.ical2org.orgPath or ""}"
|
|
|
|
cat <<EOF > "${secret.ical2org.orgPath or ""}"
|
|
|
|
:PROPERTIES:
|
|
|
|
:ID: 56ed0bf0-c6d0-4a86-980a-905ccab89345
|
|
|
|
:END:
|
|
|
|
#+title: VU Calendar
|
|
|
|
#+filetags: :project-forced:
|
|
|
|
EOF
|
|
|
|
curl '${secret.ical2org.icalUrlRooster or ""}' -o - | ical2orgpy - - >> "${secret.ical2org.orgPath or ""}"
|
|
|
|
curl '${secret.ical2org.icalUrlCanvas or ""}' -o - | CANVAS_TODO=1 ical2orgpy - - >> "${secret.ical2org.orgPath or ""}"
|
|
|
|
chown 404:404 "${secret.ical2org.orgPath or ""}"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
# systemd.timers.ical-vu-sync = {
|
|
|
|
# wantedBy = [ "timers.target" ];
|
|
|
|
# partOf = [ "ical-vu-sync.service" ];
|
|
|
|
# timerConfig = {
|
|
|
|
# OnCalendar = "*-*-* 3:00:00";
|
|
|
|
# Unit = "ical-vu-sync.service";
|
|
|
|
# };
|
|
|
|
# };
|
|
|
|
}
|