webdav to ical export

This commit is contained in:
XenGi 2026-07-13 19:42:47 +02:00
commit 289e502d6a
Signed by: xengi
SSH key fingerprint: SHA256:jxWM2RTHvxxcncXycwwWkP7HCWb4VREN05UGJTbIPZg
6 changed files with 155 additions and 0 deletions

37
hosts/www/dav2ical.nix Normal file
View file

@ -0,0 +1,37 @@
{ config, pkgs, ... }:
let
outputDir = "/srv/http/ical";
script = pkgs.writeScript "caldav-export.py" ''
#!${pkgs.python3}/bin/python3
${builtins.readFile ./caldav-export.py}
'';
pythonEnv = pkgs.python3.withPackages (ps: with ps; [
caldav
icalendar
pyyaml
]);
in
{
systemd = {
services.caldav-export = {
description = "Export CalDAV calendars to ICS";
serviceConfig = {
Type = "oneshot";
ExecStart = "${pythonEnv}/bin/python ${script} ${config.age.secrets.caldav-export-config.path} -o ${outputDir}";
};
};
timers.caldav-export = {
description = "Daily CalDAV export";
wantedBy = [
"timers.target"
];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
};
};
}

View file

@ -7,6 +7,7 @@
./openssh.nix
../../services/prometheus-node.nix
./nginx.nix
./dav2ical.nix
];
networking = {