aboutsummaryrefslogtreecommitdiffstats
path: root/modules/programs/email/default.nix
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-09 20:34:00 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-09 20:34:00 +0530
commitee32d0d0813f9870d89fb7d821633fd8b4a9987a (patch)
tree97ea433469377daee6f9651f10a0a7a21be95d75 /modules/programs/email/default.nix
parente2ae84d1c8ab00021127d455e549a47af9bc3291 (diff)
downloadhome-manager-config-ee32d0d0813f9870d89fb7d821633fd8b4a9987a.tar.gz
home-manager-config-ee32d0d0813f9870d89fb7d821633fd8b4a9987a.zip
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
Diffstat (limited to 'modules/programs/email/default.nix')
-rw-r--r--modules/programs/email/default.nix53
1 files changed, 53 insertions, 0 deletions
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
+ '';
+ };
+ };
+}