webdav to ical export
This commit is contained in:
parent
d545f5985f
commit
289e502d6a
6 changed files with 155 additions and 0 deletions
37
hosts/www/dav2ical.nix
Normal file
37
hosts/www/dav2ical.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
./openssh.nix
|
||||
../../services/prometheus-node.nix
|
||||
./nginx.nix
|
||||
./dav2ical.nix
|
||||
];
|
||||
|
||||
networking = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue