nixos/home/accounts/calendar.nix

65 lines
1.6 KiB
Nix

{ config, lib, pkgs, ... }:
{
programs = {
vdirsyncer.enable = true;
khal.enable = true;
};
services.vdirsyncer.enable = true;
accounts.calendar = {
basePath = ".calendar";
accounts = let
local = {
type = "filesystem";
fileExt = ".ics";
};
in {
nextcloud = rec {
inherit local;
primary = lib.mkDefault true;
primaryCollection = "Personal";
remote = {
type = "caldav";
url = "https://cloud.xenia.me.uk/remote.php/dav";
userName = "xenia";
passwordCommand = [
"${pkgs.libsecret}/bin/secret-tool"
"lookup"
"url"
"cloud.xenia.me.uk"
];
};
vdirsyncer = {
enable = lib.mkDefault true;
collections = [ "from a" ];
metadata = [ "color" "displayname" ];
};
khal = {
inherit (vdirsyncer) enable;
type = "discover";
};
};
ukaea = let emailConfig = config.accounts.email.accounts.ukaea;
in rec {
inherit local;
primaryCollection = "Calendar";
remote = rec {
inherit (emailConfig) userName passwordCommand;
type = "caldav";
url = "http://localhost:1080/users/${userName}/calendar/";
};
vdirsyncer = {
enable = lib.mkDefault emailConfig.mbsync.enable;
collections = [ "calendar" ];
metadata = [ "color" "displayname" ];
itemTypes = [ "VEVENT" ];
};
khal = {
inherit (vdirsyncer) enable;
type = "discover";
};
};
};
};
}