1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat: khard, vdirsyncer service

This commit is contained in:
2021-04-07 22:39:01 +02:00
parent 2e9386a6c2
commit 766874a226

View File

@@ -6,21 +6,58 @@ let
password = lib.fileContents <secrets/nextcloud/password>;
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/"