vdirsyncer: Add grocy

nazuna
Simon Bruder 2022-07-07 16:36:38 +02:00
parent 1baec2968b
commit caf9f5f764
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
1 changed files with 29 additions and 0 deletions

View File

@ -43,6 +43,28 @@ let
"password.fetch" = fetchCommand passwordCommand;
};
};
mkWebcalSection = { name, url ? null, urlCommand ? null }: assert url == null -> urlCommand != null; {
"pair calendar_${name}" = {
a = "calendar_${name}_local";
b = "calendar_${name}_remote";
collections = null;
};
"storage calendar_${name}_local" = {
type = "filesystem";
path = "${calendarBasePath}/${name}/";
fileext = ".ics";
};
"storage calendar_${name}_remote" = {
type = "http";
} // (if urlCommand != null then {
"url.fetch" = fetchCommand urlCommand;
} else {
inherit url;
});
};
in
{
home.packages = with pkgs; [
@ -75,6 +97,10 @@ in
username = "simon@sbruder.de";
passwordCommand = "pass sbruder.de/mail | head -n 1";
})
(mkWebcalSection {
name = "grocy";
urlCommand = [ "pass" "sbruder.de/grocy/calendar" ];
})
]);
"khal/config".text = /* toml */ ''
@ -88,6 +114,9 @@ in
path = ${contactsBasePath}/personal/${personalContactsUuid}/
type = birthdays
[[calendar_grocy]]
path = ${calendarBasePath}/grocy/
[locale]
timeformat = %H:%M
dateformat = %Y-%m-%d