Add calendar configuration
Use vdirsyncer to sync with xandikos server. Add khal for calendar management.
This commit is contained in:
parent
69a0e81d5c
commit
1ec38f94c8
|
@ -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";
|
||||||
|
|
66
system/home/services/calendar/default.nix
Normal file
66
system/home/services/calendar/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
5
system/home/services/calendar/vdirsyncer-ensure-pass.sh
Normal file
5
system/home/services/calendar/vdirsyncer-ensure-pass.sh
Normal 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"
|
||||||
|
)
|
Loading…
Reference in a new issue