1
0
Fork 0

Improve calendar config

This commit is contained in:
Malte Brandy 2021-04-12 15:41:05 +02:00
parent bacd851a8c
commit 90a6d6cc1c
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
3 changed files with 17 additions and 21 deletions

View file

@ -1,25 +1,18 @@
{ pkgs, ... }: {
{ pkgs, ... }: let
calendars = pkgs.privateValue [] "calendars";
in
{
home = {
packages = [ pkgs.khal ];
#[view]
# removed the description from the agend overview. I get a lot of stupid
# Google ICSs files hat contain massive overhead.
#agenda_event_format = "{calendar-color}{cancelled}{start-end-time-style} {title}{repeat-symbol}"
#event_format = "{calendar-color}{cancelled}{start-end-time-style} {title}{repeat-symbol}"
file.".config/khal/config".text = ''
[default]
default_calendar = Standard
[calendars]
[[clouds]]
type = discover
path = ~/.calendars/*cloud/*
[[cda]]
type = discover
path = ~/.calendars/cccda/*
[[readonly]]
type = discover
readonly = True
path = ~/.calendars/*readonly/*
${pkgs.lib.concatMapStringsSep "\n" ({name, readOnly ? false, ...}:''
[[${name}]]
type = discover
path = ~/.calendars/${name}/*
readonly = ${if readOnly then "True" else "False"}'') calendars}
'';
};
}

View file

@ -10,7 +10,7 @@ let
(lib.mapAttrs (name: option: builtins.toJSON option) section)
) config
);
mkCalendar = { name, url, username, passwordPath, collections ? [ "from a" "from b" ], readOnly ? false }:
mkCalendar = { name, url, username, passwordPath, collections ? [ "from a" "from b" ], readOnly ? false, type ? "caldav" }:
let
pairName = "${name}_calendar";
remoteName = "${pairName}_remote";
@ -30,10 +30,13 @@ let
fileext = ".ics";
};
"storage ${remoteName}" = {
type = "caldav";
inherit url username;
inherit type;
inherit url;
} // (if (type == "caldav") then {
inherit username;
"password.fetch" = [ "command" "${pkgs.pass}/bin/pass" passwordPath ];
};
read_only = readOnly;
} else {});
};
mkAddressbook = { name, url, username, passwordPath, collections ? [ "from a" "from b" ], readOnly ? false }:
let

@ -1 +1 @@
Subproject commit d45fc1ea806de30e6e5870989ef6f852779a2433
Subproject commit fbae56016453ea8cbc73a7f701aaa715b2fc7eda