Improve calendar config
This commit is contained in:
parent
bacd851a8c
commit
90a6d6cc1c
|
@ -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}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
2
private
2
private
|
@ -1 +1 @@
|
|||
Subproject commit d45fc1ea806de30e6e5870989ef6f852779a2433
|
||||
Subproject commit fbae56016453ea8cbc73a7f701aaa715b2fc7eda
|
Loading…
Reference in a new issue