summaryrefslogtreecommitdiff
path: root/profiles/station/caldav.nix
blob: 98674e42e40feafca089d25806b1b8c2e24ef31f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ config, lib, pkgs, ... }: with lib; {
  environment.systemPackages = with pkgs; [khard];
  hm = {
    xdg.configFile."khard/khard.conf".text = ''
      [addressbooks]
      [[mike]]
      path = ${config.hm.accounts.contact.accounts.mike.local.path}/contacts

      [general]
      default_action=list
    '';
    services.vdirsyncer.enable = true;
    programs = {
      vdirsyncer.enable = true;
      khal.enable = true;
    };
    accounts.calendar.basePath = "Cal";
    accounts.calendar.accounts = {
      mike = {
        primary = true;
        primaryCollection = "tasks";
        local = {
          type = "filesystem";
          fileExt = ".ics";
        };
        remote = {
          type = "caldav";
          url = "https://cal.${my.domain}";
          userName = "mike";
          passwordCommand = ["echo" "''"];
        };
        vdirsyncer = {
          enable = true;
          collections = ["tasks" "pomp"];
          conflictResolution = "remote wins";
        };
        khal = {
          enable = true;
          type = "discover";
          color = "light green";
        };
      };
    };
    accounts.contact.basePath = "Cal";
    accounts.contact.accounts = {
      mike = {
        local = {
          type = "filesystem";
          fileExt = ".vcf";
        };
        remote = {
          type = "carddav";
          url = "https://cal.${my.domain}";
          userName = "mike";
          passwordCommand = ["echo" "''"];
        };
        vdirsyncer = {
          enable = true;
          collections = ["contacts"];
          conflictResolution = "remote wins";
        };
      };
    };
  };
}