diff --git a/home/christoph/default.nix b/home/christoph/default.nix index 6820047e..0ae10e62 100644 --- a/home/christoph/default.nix +++ b/home/christoph/default.nix @@ -40,6 +40,12 @@ in rec { email = { enable = true; + + # Use kmail as viewer for stuff synced by mbsync + kmail = { + enable = true; + autostart = true; + }; }; firefox = { diff --git a/home/modules/email.nix b/home/modules/email.nix index 9992639c..68da6436 100644 --- a/home/modules/email.nix +++ b/home/modules/email.nix @@ -2,6 +2,8 @@ # Example: https://sbr.pm/configurations/mails.html # NOTE: The passwords must exist in kwallet +# TODO: Emacs mail config + { config, nixosConfig, lib, mylib, pkgs, ... }: with lib; @@ -13,6 +15,10 @@ in { options.modules.email = { enable = mkEnableOpt "Email"; + kmail = { + enable = mkEnableOpt "Kmail"; + autostart = mkEnableOpt "Autostart Kmail"; + }; }; # TODO: Add Maildir to nextcloud sync @@ -28,8 +34,18 @@ in { preNew = "mbsync --all"; }; }; + + home.packages = with pkgs; builtins.concatLists [ + (optionals cfg.kmail.enable [ kmail ]) + ]; }; + home.file = mkMerge [ + (optionalAttrs cfg.kmail.autostart { + ".config/autostart/org.kde.kmail2.desktop".source = mkIf cfg.kmail.autostart ../../config/autostart/org.kde.kmail2.desktop; + }) + ]; + # TODO: imapnotify can't parse the configuration, HM bug? services.imapnotify.enable = true;