complete-computing-environment/khard.org

2.6 KiB

Contact Management in Emacs

For quite a while I used ASynK to sync BBDB and Nextcloud, but that was a python 2 thing which hasn't been ported to py3, and that's not gonna be my problem, i think… It can't even be installed now since the requirements.txt doesn't pin the versions a bunch of dependencies are py3-only now…

So here's a new rube-goldberg machine.

vdirsyncer

vdirsyncer puts a bunch of vcf files on your computer and syncs them to a vcard server or vcal server. I use it only for vcard, calendar stuff is done with org-caldav.

Configuration is simple enough:

[general]
status_path = "~/.cache/vdirsyncer/status/"

[pair nextcloud_filesytem]
a = "nextcloud_remote"
b = "nextcloud_local"
collections = ["Contacts"]

[storage nextcloud_remote]
type = "carddav"
url = "https://files.fontkeming.fail/remote.php/carddav/"
username.fetch = ["command", "pass", "fk_carddav_username"]
password.fetch = ["command", "pass", "fk_carddav_password"]

[storage nextcloud_local]
type = "filesystem"
path = "~/contacts"
fileext = ".vcf"

That's put in to my home-manager below.

home.file.".config/vdirsyncer/config".source = ../files/vdirsyncer-config.txt;

With this I can run on occasion shell:vdirsyncer sync to get the latest changes propagated.

Viewing/Searching/etc contacts with khard and khard.el

(use-package khardel)
[addressbooks]
[[contacts]]
path = ~/contacts/Contacts

[general]
debug = no
default_action = list
editor = emacsclient, -c, -f
home.file.".config/khard/khard.conf".source = ../files/khard.conf;

installing modules in home-manager

{ pkgs, ... }:

{
  home.packages = with pkgs; [ khard vdirsyncer ];
  <<extras>>
}