Add calendar configuration

Use vdirsyncer to sync with xandikos server. Add khal for calendar
management.
This commit is contained in:
Evie Litherland-Smith 2024-09-29 11:28:52 +01:00
parent 69a0e81d5c
commit 1ec38f94c8
3 changed files with 73 additions and 1 deletions

View file

@ -7,6 +7,7 @@
./browser/default.nix ./browser/default.nix
./zathura/default.nix ./zathura/default.nix
./services/email/default.nix ./services/email/default.nix
./services/calendar/default.nix
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [
webcord webcord
@ -18,7 +19,7 @@
programs.mpv.enable = true; programs.mpv.enable = true;
gtk = { gtk = {
enable = true; enable = true;
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/dummyrc"; # Stop clashing with KDE
iconTheme = { iconTheme = {
package = pkgs.papirus-icon-theme; package = pkgs.papirus-icon-theme;
name = "Papirus"; name = "Papirus";

View file

@ -0,0 +1,66 @@
{ config, pkgs, ... }:
{
home.packages = [
(pkgs.writeShellScriptBin "vdirsyncer-ensure-pass" (builtins.readFile ./vdirsyncer-ensure-pass.sh))
];
programs = {
vdirsyncer.enable = true;
khal = {
enable = true;
locale = {
timeformat = "%H:%M";
dateformat = "%Y-%m-%d";
longdateformat = "%Y-%m-%d %a";
datetimeformat = "%Y-%m-%d %H:%M";
longdatetimeformat = "%Y-%m-%d %H:%M";
};
};
};
services.vdirsyncer.enable = true;
accounts.calendar = {
basePath = "Calendar";
accounts = {
personal =
let
url = "dav.xenia.me.uk";
in
{
primary = true;
primaryCollection = "calendar";
local = {
type = "filesystem";
fileExt = ".ics";
};
remote = {
url = "https://${url}";
type = "caldav";
userName = "pixelifytica";
passwordCommand = [
"${pkgs.libsecret}/bin/secret-tool"
"lookup"
"url"
"${url}"
];
};
vdirsyncer = {
inherit (config.programs.vdirsyncer) enable;
auth = "basic";
collections = [ "from a" ];
metadata = [
"color"
"displayname"
];
timeRange = {
start = "datetime.now() - timedelta(days=365)";
end = "datetime.now() + timedelta(days=365)";
};
};
khal = {
inherit (config.programs.khal) enable;
type = "discover";
addresses = with config.accounts.email.accounts.proton; [ address ] ++ aliases;
};
};
};
};
}

View file

@ -0,0 +1,5 @@
URL="dav.xenia.me.uk"
secret-tool lookup url "$URL" >/dev/null || (
echo "Setup calendar password"
secret-tool store --label="Calendar vdirsyncer" url "$URL"
)