aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2025-12-01 11:42:11 +0200
committerPetri Hienonen <petri.hienonen@gmail.com>2025-12-01 12:16:23 +0200
commite736ed88f4b94047c2f5f9db2412aa227562287d (patch)
treec1d1ddc3354f571f01845e219a0eb926e627bfc8
parent8ebcf6abcf38a73f015c4b461ebf45612eb78f14 (diff)
downloadnixos-e736ed88f4b94047c2f5f9db2412aa227562287d.tar.zst
Caldav/Carddav with radicale
-rw-r--r--home/dav/default.nix65
-rw-r--r--home/default.nix2
-rw-r--r--home/mail/default.nix3
-rw-r--r--roles/shared.nix3
-rw-r--r--secrets/radicale.age9
-rw-r--r--secrets/secrets.nix1
6 files changed, 83 insertions, 0 deletions
diff --git a/home/dav/default.nix b/home/dav/default.nix
new file mode 100644
index 0000000..1706963
--- /dev/null
+++ b/home/dav/default.nix
@@ -0,0 +1,65 @@
+{ pkgs, config, ... }:
+{
+ accounts.calendar = {
+ basePath = "Calendar"; # Relative to home directory; automatically becomes ~/Calendar
+ accounts.radicale = {
+ primary = true;
+ primaryCollection = null; # Set to a specific collection name if needed (e.g., "calendar") when multiple exist
+ remote = {
+ type = "caldav";
+ url = "https://dav.tammi.cc/petri.hienonen@protonmail.com";
+ userName = "petri.hienonen@protonmail.com";
+ passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.radicale.path}";
+ };
+ local = {
+ type = "filesystem";
+ fileExt = ".ics";
+ };
+ vdirsyncer = {
+ enable = true;
+ collections = null; # null syncs all discovered collections; alternatively, specify ["calendar", "tasks", "journal"]
+ metadata = [
+ "color"
+ "displayname"
+ ];
+ };
+ khal = {
+ enable = true;
+ type = "discover"; # "discover" for multiple collections (treats local path as directory of calendars); use "calendar" for single
+ };
+ };
+ };
+ accounts.contact = {
+ basePath = "Contacts"; # Relative to home directory; automatically becomes ~/Contacts
+ accounts.radicale = {
+ remote = {
+ type = "carddav";
+ url = "https://dav.tammi.cc/petri.hienonen@protonmail.com";
+ userName = "petri.hienonen@protonmail.com";
+ passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.radicale.path}";
+ };
+ local = {
+ type = "filesystem";
+ fileExt = ".vcf";
+ };
+ vdirsyncer = {
+ enable = true;
+ collections = null;
+ metadata = [
+ "color"
+ "displayname"
+ ];
+ };
+ khard = {
+ enable = true;
+ };
+ };
+ };
+ programs.khal.enable = true;
+ programs.khard.enable = true;
+ programs.todoman.enable = true; # For tasks (VTODO); uses the calendar basePath to discover task lists
+ services.vdirsyncer = {
+ enable = true;
+ frequency = "*:0/5"; # Sync every 5 minutes
+ };
+}
diff --git a/home/default.nix b/home/default.nix
index 1509591..48d0e8b 100644
--- a/home/default.nix
+++ b/home/default.nix
@@ -27,6 +27,7 @@ in
./hyprland
./hyprlock
./mail
+ ./dav
./mpv
./newsboat
(import ./nvim { inherit unstable; })
@@ -48,6 +49,7 @@ in
openai_auth_token.file = ../secrets/openai_auth_token.age;
relesoft_cargo_token.file = ../secrets/relesoft_cargo_token.age;
shiori_password.file = ../secrets/shiori_password.age;
+ radicale.file = ../secrets/radicale.age;
unsplash_access_key.file = ../secrets/unsplash_access_key.age;
gmail = {
file = ../secrets/gmail.age;
diff --git a/home/mail/default.nix b/home/mail/default.nix
index 775f0b0..a84f307 100644
--- a/home/mail/default.nix
+++ b/home/mail/default.nix
@@ -214,6 +214,9 @@ in
# aerc will automatically pick up accounts from accounts.email
# Additional aerc-wide configuration can go here
extraConfig = {
+ compose = {
+ address-book-cmd = "khard email --parse --remove-first-line %q";
+ };
general = {
unsafe-accounts-conf = true;
# Example aerc configuration
diff --git a/roles/shared.nix b/roles/shared.nix
index f3b5cab..84988d1 100644
--- a/roles/shared.nix
+++ b/roles/shared.nix
@@ -60,6 +60,9 @@
'';
};
system = {
+ #nixos-init = {
+ # enable = true;
+ #};
activationScripts.diff = {
supportsDryActivation = true;
text = ''
diff --git a/secrets/radicale.age b/secrets/radicale.age
new file mode 100644
index 0000000..d7afaef
--- /dev/null
+++ b/secrets/radicale.age
@@ -0,0 +1,9 @@
+age-encryption.org/v1
+-> ssh-ed25519 egf4NA t8xybeKMCRerg7jl8qtnO56gHokOKkp49r90AC5u0yQ
+aDh4inNR0BmhgaJ0IKQklIyfSAPXiwCqzFbqiY3JCcs
+-> ssh-ed25519 nivnYg Jn3xfhyeClezWLJT6JCRFQOY3yWGjz2sw16OQ0zQUSM
+HbaxFg7AYjb24+pd3Qh1zUD6JVZoVdbZZWSNQYe5pg0
+-> ssh-ed25519 SIk9MQ HXpzdz/crBh/9ZfKKf/ENJdnPh8Gjh9A6xKv7Eg/L0k
+Wjce2VTyDRw68uILHcUFkhIPhKoSyHZSh/D+pblGWC4
+--- ZvNeXC8WWrupOsb6l/dJpFdCyXTDFXokleoaVOfgJu4
+݄R@䨩6B1̀$J$2Z}</V) \ No newline at end of file
diff --git a/secrets/secrets.nix b/secrets/secrets.nix
index 59159ec..908885f 100644
--- a/secrets/secrets.nix
+++ b/secrets/secrets.nix
@@ -13,6 +13,7 @@ in
"gmail.age".publicKeys = systems;
"miniflux_api_key.age".publicKeys = systems;
"openai_auth_token.age".publicKeys = systems;
+ "radicale.age".publicKeys = systems;
"relesoft.age".publicKeys = systems;
"relesoft_cargo_token.age".publicKeys = systems;
"s3fs.age".publicKeys = systems;