diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/calendar/default.nix | 7 | ||||
| -rw-r--r-- | modules/calendar/ical-sync.nix | 14 | ||||
| -rw-r--r-- | modules/calendar/radicale.nix | 31 | ||||
| -rw-r--r-- | modules/config.nix | 1 | ||||
| -rw-r--r-- | modules/network/default.nix | 2 |
5 files changed, 55 insertions, 0 deletions
diff --git a/modules/calendar/default.nix b/modules/calendar/default.nix new file mode 100644 index 0000000..5728da5 --- /dev/null +++ b/modules/calendar/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./radicale.nix + ./ical-sync.nix + ]; +} diff --git a/modules/calendar/ical-sync.nix b/modules/calendar/ical-sync.nix new file mode 100644 index 0000000..a318334 --- /dev/null +++ b/modules/calendar/ical-sync.nix @@ -0,0 +1,14 @@ +{ settings, ... }: +{ + imports = [ ../../services/icaldav.service.nix ]; + + services.icaldavsync = { + enable = true; + syncFrequency = "*:0/30"; + icalLink = settings.calendar.icalLink; + caldavServerUrl = "http://127.0.0.1:${toString settings.network.ports.caldav}"; + password = "pass"; + user = "joe"; + calendar = "Work"; + }; +} diff --git a/modules/calendar/radicale.nix b/modules/calendar/radicale.nix new file mode 100644 index 0000000..cb2aa1f --- /dev/null +++ b/modules/calendar/radicale.nix @@ -0,0 +1,31 @@ +{ settings, ... }: +let + radicaleDir = "/var/lib/radicale/collections"; + radicalePort = settings.network.ports.caldav; +in +{ + systemd.tmpfiles.rules = [ + "d ${radicaleDir} 0755 - radicale - -" + ]; + + services.radicale = { + enable = true; + settings = { + server = { + hosts = [ + "0.0.0.0:${toString radicalePort}" + "[::]:${toString radicalePort}" + ]; + }; + auth = { + type = "none"; + }; + web = { + type = "internal"; + }; + storage = { + filesystem_folder = radicaleDir; + }; + }; + }; +} diff --git a/modules/config.nix b/modules/config.nix index 54108fe..5ca3cdc 100644 --- a/modules/config.nix +++ b/modules/config.nix @@ -10,6 +10,7 @@ ./notifications # ./monitoring ./rss + ./calendar ./packages.nix ]; diff --git a/modules/network/default.nix b/modules/network/default.nix index 78aea9d..25cd5aa 100644 --- a/modules/network/default.nix +++ b/modules/network/default.nix @@ -16,6 +16,7 @@ in firewall.enable = true; }; + # Service mappings (dns + nginx) services.service-router = { enable = true; routes = { @@ -34,6 +35,7 @@ in "news.local" = { inherit host; port = ports.yarr; }; # "librarian.local" = { inherit host; port = ports.lazylibrarian; }; "paperless.local" = { inherit host; port = ports.paperless; configureNginx = true; }; + "calendar.local" = { inherit host; port = ports.caldav; }; }; }; |
