From ee32d0d0813f9870d89fb7d821633fd8b4a9987a Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Thu, 9 Jul 2026 20:34:00 +0530 Subject: feat: added email configuration with mbsync + notmuch added a private module which will be gitignored and serves to include options that are not meant to be shared --- modules/programs/email/default.nix | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 modules/programs/email/default.nix (limited to 'modules/programs/email/default.nix') diff --git a/modules/programs/email/default.nix b/modules/programs/email/default.nix new file mode 100644 index 0000000..36dfc95 --- /dev/null +++ b/modules/programs/email/default.nix @@ -0,0 +1,53 @@ +# email - Mbsync and notmuch mail synchronization +{ + config, + lib, + pkgs, + ... +}: + +let + mailDir = "${config.home.homeDirectory}/.local/mail"; +in +{ + options.programs.email = { + enable = lib.mkEnableOption "Email suite (mbsync + notmuch)"; + }; + + config = lib.mkIf config.programs.email.enable { + home.packages = [ + pkgs.mbsync + pkgs.notmuch + ]; + + home.sessionVariables = { + MAILDIR = mailDir; + NOTMUCH_CONFIG = "${config.xdg.configHome}/notmuch/notmuchrc"; + }; + + xdg.configFile."notmuch/notmuch.config" = { + text = '' + [database] + path=${mailDir}/.notmuch + + [user] + name= + address= + primary_key= + + [new] + tags=unclassified;new; + ignore= + + [search] + exclude_tags=deleted;spam; + + [maildir] + synchronize_flags=true + + [crypto] + gpg_path=${pkgs.gnupg}/bin/gpg + ''; + }; + }; +} -- cgit v1.2.3