2023-09-25 14:22:51 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2023-09-26 10:19:33 +01:00
|
|
|
home.packages = with pkgs; [ khard ];
|
2023-09-26 09:41:03 +01:00
|
|
|
programs.vdirsyncer.enable = true;
|
2023-09-25 14:22:51 +01:00
|
|
|
accounts.contact = {
|
|
|
|
basePath = ".contact";
|
2023-10-03 07:59:00 +01:00
|
|
|
accounts = let
|
|
|
|
calendarAccounts = config.accounts.calendar.accounts;
|
|
|
|
local = {
|
|
|
|
type = "filesystem";
|
|
|
|
fileExt = ".vcf";
|
|
|
|
};
|
|
|
|
in {
|
2023-09-25 14:22:51 +01:00
|
|
|
nextcloud = {
|
2023-10-03 07:59:00 +01:00
|
|
|
inherit local;
|
2023-09-25 14:22:51 +01:00
|
|
|
remote = {
|
2023-10-03 07:59:00 +01:00
|
|
|
inherit (calendarAccounts.nextcloud.remote) userName passwordCommand;
|
2023-09-25 14:22:51 +01:00
|
|
|
type = "carddav";
|
|
|
|
url =
|
|
|
|
"https://cloud.xenia.me.uk/remote.php/dav/addressbooks/users/xenia/contacts-1/";
|
|
|
|
};
|
|
|
|
vdirsyncer = {
|
2023-10-03 07:59:00 +01:00
|
|
|
inherit (calendarAccounts.nextcloud.vdirsyncer) enable;
|
2023-09-25 14:22:51 +01:00
|
|
|
collections = [ "from a" ];
|
|
|
|
};
|
|
|
|
};
|
2023-10-09 11:47:43 +01:00
|
|
|
# Remove for now as contact syncing doesn't seem to work with davmail
|
|
|
|
# TODO investigate LDAP based solution instead
|
|
|
|
# ukaea = {
|
|
|
|
# inherit local;
|
|
|
|
# remote = rec {
|
|
|
|
# inherit (calendarAccounts.ukaea.remote) userName passwordCommand;
|
|
|
|
# type = "carddav";
|
|
|
|
# url = "http://localhost:1080/users/${userName}/contacts/";
|
|
|
|
# };
|
|
|
|
# vdirsyncer = {
|
|
|
|
# inherit (calendarAccounts.ukaea.vdirsyncer) enable;
|
|
|
|
# collections = [ "contacts" ];
|
|
|
|
# };
|
|
|
|
# };
|
2023-09-25 14:22:51 +01:00
|
|
|
};
|
|
|
|
};
|
2023-09-26 10:19:33 +01:00
|
|
|
xdg.configFile."khard/khard.conf".text = ''
|
|
|
|
# example configuration file for khard version > 0.14.0
|
|
|
|
# place it under ~/.config/khard/khard.conf
|
|
|
|
# This file is parsed by the configobj library. The syntax is described at
|
|
|
|
# https://configobj.readthedocs.io/en/latest/configobj.html#the-config-file-format
|
|
|
|
|
|
|
|
[addressbooks]
|
|
|
|
[[nextcloud]]
|
|
|
|
path = ~/.contact/nextcloud/contacts-1/
|
2023-09-29 09:55:52 +01:00
|
|
|
# [[ukaea]]
|
|
|
|
# path = ~/.contact/ukaea/contacts/
|
2023-09-26 10:19:33 +01:00
|
|
|
|
|
|
|
[general]
|
|
|
|
debug = no
|
|
|
|
default_action = list
|
|
|
|
# These are either strings or comma seperated lists
|
|
|
|
# editor = vim, -i, NONE
|
|
|
|
# merge_editor = vimdiff
|
|
|
|
|
|
|
|
[contact table]
|
|
|
|
# display names by first or last name: first_name / last_name / formatted_name
|
|
|
|
display = first_name
|
|
|
|
# group by address book: yes / no
|
|
|
|
group_by_addressbook = no
|
|
|
|
# reverse table ordering: yes / no
|
|
|
|
reverse = no
|
|
|
|
# append nicknames to name column: yes / no
|
|
|
|
show_nicknames = yes
|
|
|
|
# show uid table column: yes / no
|
|
|
|
show_uids = yes
|
|
|
|
# show kind table column: yes / no
|
|
|
|
show_kinds = no
|
|
|
|
# sort by first or last name: first_name / last_name / formatted_name
|
|
|
|
sort = last_name
|
|
|
|
# localize dates: yes / no
|
|
|
|
localize_dates = yes
|
|
|
|
# set a comma separated list of preferred phone number types in descending priority
|
|
|
|
# or nothing for non-filtered alphabetical order
|
|
|
|
# preferred_phone_number_type = pref, cell, home
|
|
|
|
# set a comma separated list of preferred email address types in descending priority
|
|
|
|
# or nothing for non-filtered alphabetical order
|
|
|
|
# preferred_email_address_type = pref, work, home
|
|
|
|
|
|
|
|
[vcard]
|
|
|
|
# extend contacts with your own private objects
|
|
|
|
# these objects are stored with a leading "X-" before the object name in the vcard files
|
|
|
|
# every object label may only contain letters, digits and the - character
|
|
|
|
# example:
|
|
|
|
# private_objects = Jabber, Skype, Twitter
|
|
|
|
# default: , (the empty list)
|
|
|
|
# private_objects = Jabber, Skype, Twitter
|
|
|
|
# preferred vcard version: 3.0 / 4.0
|
|
|
|
preferred_version = 3.0
|
|
|
|
# Look into source vcf files to speed up search queries: yes / no
|
|
|
|
search_in_source_files = no
|
|
|
|
# skip unparsable vcard files: yes / no
|
|
|
|
skip_unparsable = no
|
|
|
|
'';
|
2023-09-25 14:22:51 +01:00
|
|
|
}
|