vdirsyncer: Add grocy

This commit is contained in:
Simon Bruder 2022-07-07 16:36:38 +02:00
parent 1baec2968b
commit caf9f5f764
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -43,6 +43,28 @@ let
"password.fetch" = fetchCommand passwordCommand; "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 in
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -75,6 +97,10 @@ in
username = "simon@sbruder.de"; username = "simon@sbruder.de";
passwordCommand = "pass sbruder.de/mail | head -n 1"; passwordCommand = "pass sbruder.de/mail | head -n 1";
}) })
(mkWebcalSection {
name = "grocy";
urlCommand = [ "pass" "sbruder.de/grocy/calendar" ];
})
]); ]);
"khal/config".text = /* toml */ '' "khal/config".text = /* toml */ ''
@ -88,6 +114,9 @@ in
path = ${contactsBasePath}/personal/${personalContactsUuid}/ path = ${contactsBasePath}/personal/${personalContactsUuid}/
type = birthdays type = birthdays
[[calendar_grocy]]
path = ${calendarBasePath}/grocy/
[locale] [locale]
timeformat = %H:%M timeformat = %H:%M
dateformat = %Y-%m-%d dateformat = %Y-%m-%d