summaryrefslogtreecommitdiff
path: root/lib/calendars.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/calendars.nix')
-rw-r--r--lib/calendars.nix96
1 files changed, 96 insertions, 0 deletions
diff --git a/lib/calendars.nix b/lib/calendars.nix
new file mode 100644
index 0000000..9e96462
--- /dev/null
+++ b/lib/calendars.nix
@@ -0,0 +1,96 @@
+{...}:
+let
+ common = {
+ vdirsyncer = {
+ enable = true;
+ auth = "basic";
+ conflictResolution = "remote wins";
+ metadata = [
+ "displayname"
+ "description"
+ ];
+ timeRange = {
+ # sync 1 year before and after now
+ start = "datetime.now() - timedelta(days=365)";
+ end = "datetime.now() + timedelta(days=365)";
+ };
+ };
+ };
+in {
+ accounts.calendar.basePath = "Calendars";
+ accounts.calendar.accounts = {
+ "bensima_personal" = {
+ primaryCollection = "Unschedule";
+ remote = {
+ passwordCommand = ["pass" "cal.bensima.com"];
+ type = "caldav";
+ url = "https://cal.bensima.com";
+ userName = "ben";
+ };
+ vdirsyncer = {
+ inherit (common.vdirsyncer) metadata timeRange enable auth conflictResolution;
+ collections = [
+ "3e40534f-bfb9-b973-f615-f958a6361e95"
+ "066441A6-B48F-439B-9BD0-5D0FA8F4CB6F"
+ ];
+ };
+ khal = {
+ enable = true;
+ addresses = ["ben@bensima.com" "ben@bsima.me"];
+ color = "#800080";
+ type = "discover";
+ };
+ };
+
+ "bensima_shared" = {
+ remote = {
+ passwordCommand = ["pass" "cal.bensima.com"];
+ type = "caldav";
+ url = "https://cal.bensima.com/shared/ben";
+ userName = "ben";
+ };
+ vdirsyncer = common.vdirsyncer;
+ khal = {
+ enable = true;
+ color = "#097969";
+ type = "calendar";
+ };
+ };
+
+ "icloud" = {
+ remote = {
+ passwordCommand = ["pass" "icloud.com/vdirsyncer"];
+ type = "caldav";
+ url = "https://caldav.icloud.com";
+ userName = "bsima@icloud.com";
+ };
+ vdirsyncer = {
+ inherit (common.vdirsyncer) metadata timeRange enable auth conflictResolution;
+ collections = [
+ "0962a74ab76a97543b485d2a583caa271042baab9d64437ae6c3bc8a50df1f08"
+ ];
+ };
+ khal = {
+ enable = true;
+ color = "#FAA0A0";
+ type = "discover";
+ };
+ };
+ };
+
+ programs.khal = {
+ enable = true;
+ locale = {
+ # these need to match org-mode formats for khalel
+ weeknumbers = "left";
+ timeformat = "%H:%M";
+ dateformat = "%Y-%m-%d";
+ longdateformat = "%Y-%m-%d %a";
+ datetimeformat = "%Y-%m-%d %H:%M";
+ longdatetimeformat = "%Y-%m-%d %H:%M";
+ };
+ };
+
+ programs.vdirsyncer.enable = true;
+ services.vdirsyncer.enable = true;
+}