diff --git a/home/modules/email.nix b/home/modules/email.nix new file mode 100644 index 00000000..e8a20a01 --- /dev/null +++ b/home/modules/email.nix @@ -0,0 +1,51 @@ +{ config, nixosConfig, lib, mylib, pkgs, ... }: + +with lib; +with mylib.modules; + +let + cfg = config.modules.email; +in { + + options.modules.email = { + enable = mkEnableOpt "Email"; + }; + + config = mkIf cfg.enable { + programs = { + mbsync.enable = true; + msmtp.enable = true; + notmuch = { + enable = true; + hooks = { + preNew = "mbsync --all"; + }; + }; + }; + + accounts.email.accounts = { + urpost = { + address = "tobi@urpost.de"; + userName = "tobi@urpost.de"; + realName = "Christoph Urlacher"; + signatur.showSignature = "none"; + + imap.host = "mail.zeus08.de"; + imap.port = 993; + smtp.host = "mail.zeus08.de"; + smtp.port = 465; + + passwordCommand = "kwallet-query -f email -r urpost kdewallet"; + + mbsync = { # Imap + enable = true; + create = "maildir"; + }; + msmtp.enable = true; # Smtp + notmuch.enable = true; + + primary = true; + }; + }; + }; +}