nixos-config/users/simon/modules/vdirsyncer.nix

101 lines
2.3 KiB
Nix

{ 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@sbruder.de"
password.fetch = ["command", "sh", "-c", "pass sbruder.de/mail | 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@sbruder.de"
password.fetch = ["command", "sh", "-c", "pass sbruder.de/mail | 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
'';
};
}