feat: add calendar and contacts modules

This commit is contained in:
Moritz Böhme 2024-12-24 13:24:41 +01:00
parent 93f8b84d73
commit 9f1cf602e5
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
6 changed files with 117 additions and 0 deletions

View file

@ -0,0 +1,52 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
let
cfg = config.my.profiles.personal;
in
{
options.my.profiles.personal.calendar = mkEnableOption "calendar";
config = mkIf cfg.contacts {
home-manager.users.moritz = {
programs.khal.enable = true;
programs.vdirsyncer.enable = true;
services.vdirsyncer.enable = true;
accounts.calendar = {
basePath = "Documents/Calendar";
accounts.personal = {
local = {
type = "filesystem";
fileExt = ".ics";
};
remote = {
passwordCommand = [ "cat" "/run/agenix/nextcloud" ];
url = "https://nextcloud.moritzboeh.me/remote.php/dav";
type = "caldav";
userName = "moritz";
};
primaryCollection = "personal";
khal.enable = true;
khal.type = "discover";
vdirsyncer.enable = true;
vdirsyncer.collections = [
"personal" # Personal
"einkaufsliste" # Einkaufsliste
"9b8be6f3-d85c-4c1e-b006-00910f56bf5d" # Tasks
"contact_birthdays" # Contact birthdays
"f71a1a0f-08c5-45de-84e8-e7f16b748ba5" # Uni
"32c96d6f-a575-48b1-949a-6ae548f7a779" # Work
];
};
};
};
age.secrets.nextcloud = {
file = ../../secrets/nextcloud.age;
owner = "1000";
};
};
}

View file

@ -0,0 +1,50 @@
{ lib
, config
, pkgs
, ...
}:
with lib;
let
cfg = config.my.profiles.personal;
in
{
options.my.profiles.personal.contacts = mkEnableOption "contacts";
config = mkIf cfg.contacts {
home-manager.users.moritz = {
programs.khard.enable = true;
programs.vdirsyncer.enable = true;
services.vdirsyncer.enable = true;
programs.aerc.extraConfig.compose.address-book-cmd = "khard email --remove-first-line --parsable %s";
accounts.contact = {
basePath = "Documents/Contacts";
accounts.personal = {
local = {
type = "filesystem";
fileExt = ".vcf";
};
remote = {
passwordCommand = [ "cat" "/run/agenix/nextcloud" ];
url = "https://nextcloud.moritzboeh.me/remote.php/dav";
type = "carddav";
userName = "moritz";
};
khard.enable = true;
khard.defaultCollection = "contacts";
vdirsyncer.enable = true;
vdirsyncer.collections = [
# "z-app-generated--contactsinteraction--recent" # Recently contacted
# "z-server-generated--system" # Accounts
"contacts" # Contacts
];
vdirsyncer.conflictResolution = [ "vimdiff" ];
};
};
};
age.secrets.nextcloud = {
file = ../../secrets/nextcloud.age;
owner = "1000";
};
};
}

View file

@ -60,6 +60,8 @@ in
realName = "Moritz Böhme";
mbsync.enable = true;
mbsync.create = "both";
mbsync.remove = "both";
mbsync.expunge = "both";
passwordCommand = "${lib.getExe' pkgs.coreutils "cat"} /run/agenix/email";
};
accounts.email.maildirBasePath = "Documents/Mail";