From 103daec5c28380665f1f75eeb6cb54a3474047b7 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 25 Sep 2023 14:22:51 +0100 Subject: [PATCH] Add initial (nextcloud) calendar and contact --- home/accounts/calendar.nix | 29 +++++++++++++++++++++++++++++ home/accounts/contact.nix | 27 +++++++++++++++++++++++++++ home/accounts/default.nix | 2 +- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 home/accounts/calendar.nix create mode 100644 home/accounts/contact.nix diff --git a/home/accounts/calendar.nix b/home/accounts/calendar.nix new file mode 100644 index 00000000..da37a13e --- /dev/null +++ b/home/accounts/calendar.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +{ + programs.vdirsyncer.enable = true; + accounts.calendar = { + basePath = ".calendar"; + accounts = { + nextcloud = { + primary = true; + local = { + type = "filesystem"; + fileExt = ".ics"; + }; + remote = { + type = "caldav"; + url = "https://cloud.xenia.me.uk/remote.php/dav"; + userName = "xenia"; + passwordCommand = + [ "${pkgs.pass}/bin/pass" "show" "Calendar/NextCloud/emacs" ]; + }; + vdirsyncer = { + enable = true; + collections = [ "from a" ]; + metadata = [ "color" "displayname" ]; + }; + }; + }; + }; +} diff --git a/home/accounts/contact.nix b/home/accounts/contact.nix new file mode 100644 index 00000000..f45bee2b --- /dev/null +++ b/home/accounts/contact.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +{ + accounts.contact = { + basePath = ".contact"; + accounts = { + nextcloud = { + local = { + type = "filesystem"; + fileExt = ".vcf"; + }; + remote = { + inherit (config.accounts.calendar.accounts.nextcloud.remote) + userName passwordCommand; + type = "carddav"; + url = + "https://cloud.xenia.me.uk/remote.php/dav/addressbooks/users/xenia/contacts-1/"; + }; + vdirsyncer = { + enable = true; + collections = [ "from a" ]; + metadata = [ "color" "displayname" ]; + }; + }; + }; + }; +} diff --git a/home/accounts/default.nix b/home/accounts/default.nix index eebf91d6..43dbc6ac 100644 --- a/home/accounts/default.nix +++ b/home/accounts/default.nix @@ -1,5 +1,5 @@ { ... }: { - imports = [ ./email.nix ]; + imports = [ ./email.nix ./calendar.nix ./contact.nix ]; }