From 766874a2266e07354640f18ee5038449129d0e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 7 Apr 2021 22:39:01 +0200 Subject: [PATCH] feat: khard, vdirsyncer service --- configs/khal.nix | 65 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 13 deletions(-) diff --git a/configs/khal.nix b/configs/khal.nix index 69288b6..8c6528d 100644 --- a/configs/khal.nix +++ b/configs/khal.nix @@ -6,21 +6,58 @@ let password = lib.fileContents ; in { - environment.systemPackages = [ pkgs.khal pkgs.vdirsyncer ]; + environment.systemPackages = [ pkgs.khal pkgs.vdirsyncer pkgs.khard ]; + + systemd.user.services.vdirsyncer = { + enable = true; + wants = [ "network-online.target" ]; + wantedBy = [ "default.target" ]; + startAt = "*:00/10"; + script = '' + ${pkgs.vdirsyncer}/bin/vdirsyncer sync + ${pkgs.khal}/bin/khal printcalendars # https://lostpackets.de/khal/configure.html#syncing + ''; + }; home-manager.users.me = { xdg.configFile = { + "khard/khard.conf".text = '' + [addressbooks] + [[contacts]] + path = ${davHome}/contacts/contacts/ + + [general] + debug = no + default_action = list + editor = ${config.environment.variables.EDITOR} + merge_editor = ${pkgs.vim}/bin/vimdiff + + [contact table] + display = first_name + group_by_addressbook = no + reverse = no + show_nicknames = no + show_uids = no + sort = last_name + localize_dates = yes + preferred_phone_number_type = pref, cell, home + preferred_email_address_type = pref, work, home + + [vcard] + search_in_source_files = no + skip_unparsable = no + ''; + "khal/config".text = '' [calendars] [[kalender_local]] path = ${davHome}/calendar/* - color = 27 + color = 32 type = discover [[kontakte_local]] path = ${davHome}/contacts/contacts/ - color = 11 type = birthdays [default] @@ -46,28 +83,30 @@ in a = "kontakte_local" b = "kontakte_cloud" collections = ["from a", "from b"] + conflict_resolution = "b wins" + + [pair kalender] + a = "kalender_local" + b = "kalender_cloud" + collections = ["from a", "from b"] + conflict_resolution = "b wins" [storage kontakte_local] type = "filesystem" path = "${davHome}/contacts/" fileext = ".vcf" + [storage kalender_local] + type = "filesystem" + path = "${davHome}/calendar/" + fileext = ".ics" + [storage kontakte_cloud] type = "carddav" url = "${davEndpoint}/addressbooks/users/${username}/contacts/" username = "${username}" password = "${password}" - [pair kalender] - a = "kalender_local" - b = "kalender_cloud" - collections = ["from a", "from b"] - - [storage kalender_local] - type = "filesystem" - path = "${davHome}/calendar/" - fileext = ".ics" - [storage kalender_cloud] type = "caldav" url = "${davEndpoint}/calendars/${username}/personal/"