From 8d306915d9d3ff754772b6ee413e02ba9701bb31 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Sat, 28 Jun 2025 09:30:37 +0800 Subject: [PATCH] feat(home): add email module for personal email setup --- homes/x86_64-linux/rafiq/cli/email.nix | 46 ++++++++++++++++++++++++++ homes/x86_64-linux/rafiq/default.nix | 27 --------------- 2 files changed, 46 insertions(+), 27 deletions(-) create mode 100644 homes/x86_64-linux/rafiq/cli/email.nix diff --git a/homes/x86_64-linux/rafiq/cli/email.nix b/homes/x86_64-linux/rafiq/cli/email.nix new file mode 100644 index 0000000..27e87e1 --- /dev/null +++ b/homes/x86_64-linux/rafiq/cli/email.nix @@ -0,0 +1,46 @@ +{ osConfig, lib, ... }: +let + mkEmailAccount = address: { + inherit address; + maildir.path = address; + userName = address; + realName = "Mohammad Rafiq"; + passwordCommand = "sudo cat ${osConfig.sops.secrets."rafiq/personalEmailPassword".path}"; + mbsync = { + enable = true; + create = "both"; + }; + imap = { + host = "imap.forwardemail.net"; + port = 993; + }; + smtp = { + host = "smtp.forwardemail.net"; + port = 465; + }; + thunderbird.enable = osConfig.desktop.enable; + neomutt.enable = true; + neomutt.mailboxType = "imap"; + himalaya.enable = true; + }; +in +{ + programs.himalaya.enable = true; + programs.neomutt = { + enable = true; + vimKeys = true; + }; + persistDirs = [ + "mail/rafiq@rrv.sh" + "mail/mohammadrafiq@rrv.sh" + ]; + accounts.email = { + maildirBasePath = "mail"; + accounts = { + "rafiq@rrv.sh" = mkEmailAccount "rafiq@rrv.sh" // { + primary = true; + }; + "mohammadrafiq@rrv.sh" = mkEmailAccount "mohammadrafiq@rrv.sh"; + }; + }; +} diff --git a/homes/x86_64-linux/rafiq/default.nix b/homes/x86_64-linux/rafiq/default.nix index 4ab7104..1045dc2 100644 --- a/homes/x86_64-linux/rafiq/default.nix +++ b/homes/x86_64-linux/rafiq/default.nix @@ -7,22 +7,6 @@ let inherit (lib) singleton optional; inherit (inputs) import-tree; - mkEmailAccount = address: { - inherit address; - maildir.path = address; - userName = address; - realName = "Mohammad Rafiq"; - passwordCommand = "sudo cat ${osConfig.sops.secrets."rafiq/personalEmailPassword".path}"; - imap = { - host = "imap.forwardemail.net"; - port = 993; - }; - smtp = { - host = "smtp.forwardemail.net"; - port = 465; - }; - thunderbird.enable = osConfig.desktop.enable; - }; in { imports = @@ -31,16 +15,5 @@ in config = { stylix.image = ./desktop/wallpaper.png; - accounts = { - email = { - maildirBasePath = "mail"; - accounts = { - "rafiq@rrv.sh" = { - primary = true; - } // mkEmailAccount "rafiq@rrv.sh"; - "mohammadrafiq@rrv.sh" = mkEmailAccount "mohammadrafiq@rrv.sh"; - }; - }; - }; }; }