From 282b7ac83d1d4148af516d7036c260b57c398ef9 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Wed, 11 Mar 2020 21:58:26 +0800 Subject: [PATCH] setup khal and vdirsyncer --- modules/programs/taskwarrior.nix | 6 +++++ system/desktop/home-manager.nix | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/modules/programs/taskwarrior.nix b/modules/programs/taskwarrior.nix index 47bf986..6861c9b 100644 --- a/modules/programs/taskwarrior.nix +++ b/modules/programs/taskwarrior.nix @@ -48,6 +48,12 @@ in { python # needed for hooks taskwarrior-hooks + vdirsyncer + khal + (pkgs.writers.writeBashBin "kalendar" '' + ${pkgs.vdirsyncer}/bin/vdirsyncer sync + ${pkgs.khal}/bin/ikhal + '') # bugwarrior (let diff --git a/system/desktop/home-manager.nix b/system/desktop/home-manager.nix index 0244204..e5fbfea 100644 --- a/system/desktop/home-manager.nix +++ b/system/desktop/home-manager.nix @@ -188,6 +188,45 @@ in { rm -f ~/.xmonad/xmonad.state ''; + xdg.configFile."khal/config".text = '' + [calendars] + + [[local_calendar]] + path = ~/.calendars/* + type = discover + + [locale] + timeformat = %H:%M + dateformat = %Y-%m-%d + longdateformat = %Y-%m-%d + datetimeformat = %Y-%m-%d %H:%M + longdatetimeformat = %Y-%m-%d %H:%M + ''; + + xdg.configFile."vdirsyncer/config".text = '' + [general] + # A folder where vdirsyncer can store some metadata about each pair. + status_path = "~/.vdirsyncer/status/" + + # CALDAV + [pair my_calendar] + a = "nextcloud_calendar" + b = "local_calendar" + collections = ["from a", "from b"] + + [storage nextcloud_calendar] + type = "caldav" + url = "https://nextcloud.ingolf-wagner.de/" + username = "palo" + password.fetch = ["command", "${pkgs.pass}/bin/pass", "home/nextcloud/vdirsyncer/password"] + + [storage local_calendar] + type = "filesystem" + path = "~/.calendars/" + fileext = ".ics" + ''; + + }; environment.systemPackages = let