From 07216be2c3349f974248e67918fb608fce79f035 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 7 Nov 2020 17:13:15 +0100 Subject: [PATCH] home: Add vdirsyncer, khal and khard --- users/simon/base.nix | 1 + users/simon/modules/vdirsyncer.nix | 100 +++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 users/simon/modules/vdirsyncer.nix diff --git a/users/simon/base.nix b/users/simon/base.nix index c08de05..777a5db 100644 --- a/users/simon/base.nix +++ b/users/simon/base.nix @@ -39,6 +39,7 @@ in ./modules/mpd.nix ./modules/neovim.nix ./modules/sway.nix + ./modules/vdirsyncer.nix ./modules/xcompose.nix ./modules/xdg.nix ./modules/zathura.nix diff --git a/users/simon/modules/vdirsyncer.nix b/users/simon/modules/vdirsyncer.nix new file mode 100644 index 0000000..b6d2f98 --- /dev/null +++ b/users/simon/modules/vdirsyncer.nix @@ -0,0 +1,100 @@ +{ config, pkgs, ... }: +let + contactsUuid = "d6abd3ea-3abd-7550-9f24-f06293d36a82"; +in +{ + home.packages = with pkgs; [ + khal + khard + vdirsyncer + ]; + + xdg.configFile = { + "vdirsyncer/config".text = '' + [general] + status_path = "${config.xdg.configHome}/vdirsyncer/status/" + + [pair contacts] + a = "contacts_local" + b = "contacts_remote" + collections = ["from a", "from b"] + metadata = ["displayname"] + + [storage contacts_local] + type = "filesystem" + path = "~/.contacts/" + fileext = ".vcf" + + [storage contacts_remote] + type = "carddav" + url = "https://dav.sbruder.de/" + username = "simon" + password.fetch = ["command", "sh", "-c", "pass sbruder.de/account | head -n 1"] + + [pair calendar] + a = "calendar_local" + b = "calendar_remote" + collections = ["from a", "from b"] + metadata = ["displayname"] + + [storage calendar_local] + type = "filesystem" + path = "~/.calendar/" + fileext = ".ics" + + [storage calendar_remote] + type = "caldav" + url = "https://dav.sbruder.de/" + username = "simon" + password.fetch = ["command", "sh", "-c", "pass sbruder.de/account | head -n 1"] + ''; + + "khal/config".text = '' + [calendars] + + [[calendar_local]] + path = ~/.calendar/* + type = discover + + [[contacts_local]] + path = ~/.contacts/${contactsUuid}/ + type = birthdays + + [locale] + timeformat = %H:%M + dateformat = %Y-%m-%d + longdateformat = %Y-%m-%d + datetimeformat = %Y-%m-%d %H:%M + longdatetimeformat = %Y-%m-%d %H:%M + ''; + + "khard/khard.conf".text = '' + [addressbooks] + [[personal]] + path = ~/.contacts/${contactsUuid}/ + + [general] + debug = no + default_action = list + editor = nvim, -i, NONE + merge_editor = nvim, -d + + [contact table] + display = first_name + group_by_addressbook = no + reverse = no + show_nicknames = yes + show_uids = no + sort = last_name + localize_dates = yes + preferred_phone_number_type = pref, cell, home + preferred_email_address_type = pref, home, work + + [vcard] + private_objects = Jabber, + preferred_version = 3.0 + search_in_source_files = no + skip_unparsable = no + ''; + }; +}