btw i use nix
1{
2 pkgs,
3 config,
4 lib,
5 ...
6}:
7
8let
9 cfg = config.custom.calendar;
10in
11{
12 options.custom.calendar.enable = lib.mkEnableOption "calendar";
13
14 config = lib.mkIf cfg.enable {
15 programs = {
16 password-store.enable = true;
17 gpg.enable = true;
18 vdirsyncer.enable = true;
19 khal = {
20 enable = true;
21 locale = {
22 timeformat = "%I:%M%p";
23 dateformat = "%y-%m-%d";
24 longdateformat = "%Y-%m-%d";
25 datetimeformat = "%y-%m-%d %I:%M%p";
26 longdatetimeformat = "%Y-%m-%d %I:%M%p";
27 };
28 settings = {
29 default.default_calendar = "ryan_freumh_org";
30 keybindings.external_edit = "ctrl e";
31 keybindings.save = "ctrl s";
32 };
33 };
34 };
35
36 services = {
37 gpg-agent.enable = true;
38 };
39
40 accounts.calendar = {
41 basePath = "calendar";
42 accounts = {
43 "ryan_freumh_org" = {
44 khal = {
45 enable = true;
46 color = "white";
47 };
48 vdirsyncer = {
49 enable = true;
50 };
51 remote = {
52 type = "caldav";
53 url = "https://cal.freumh.org/ryan/f497c073-d027-2aa5-1e58-cbec1bf5a8c7/";
54 passwordCommand = [
55 "${pkgs.pass}/bin/pass"
56 "show"
57 "calendar/ryan@freumh.org"
58 ];
59 userName = "ryan";
60 };
61 local = {
62 type = "filesystem";
63 fileExt = ".ics";
64 };
65 };
66 "srg" = {
67 khal = {
68 enable = true;
69 color = "#CC3333";
70 };
71 vdirsyncer = {
72 enable = true;
73 };
74 remote = {
75 type = "http";
76 url = "https://talks.cam.ac.uk/show/ics/8316.ics";
77 };
78 local = {
79 type = "filesystem";
80 fileExt = ".ics";
81 };
82 };
83 };
84 };
85 };
86}