fmt
This commit is contained in:
parent
51a7660478
commit
8cc05e8e40
6 changed files with 38 additions and 39 deletions
|
|
@ -20,4 +20,3 @@
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,25 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
calendarAggregate = pkgs.writers.writePython3 "calendar-aggregate.py" { libraries = [ pkgs.python3Packages.icalendar ]; } ''
|
||||
from pathlib import Path
|
||||
from icalendar import Calendar
|
||||
calendarAggregate =
|
||||
pkgs.writers.writePython3 "calendar-aggregate.py"
|
||||
{ libraries = [ pkgs.python3Packages.icalendar ]; }
|
||||
''
|
||||
from pathlib import Path
|
||||
from icalendar import Calendar
|
||||
|
||||
combined = Calendar()
|
||||
combined = Calendar()
|
||||
|
||||
for path in Path("/var/lib/radicale/collections").rglob("*.ics"):
|
||||
with open(path, "rb") as f:
|
||||
cal = Calendar.from_ical(f.read())
|
||||
for path in Path("/var/lib/radicale/collections").rglob("*.ics"):
|
||||
with open(path, "rb") as f:
|
||||
cal = Calendar.from_ical(f.read())
|
||||
|
||||
for component in cal.walk("VEVENT"):
|
||||
combined.add_component(component)
|
||||
for component in cal.walk("VEVENT"):
|
||||
combined.add_component(component)
|
||||
|
||||
with open("/srv/www/calendar/all.ics", "wb") as f:
|
||||
f.write(combined.to_ical())
|
||||
'';
|
||||
with open("/srv/www/calendar/all.ics", "wb") as f:
|
||||
f.write(combined.to_ical())
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
|
|
@ -93,4 +96,3 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue