From c51bf01f778d5df19b8bc8475a01a3f314dde2d4 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Thu, 5 Jun 2025 19:14:39 +0800 Subject: [PATCH] feat(homes/rafiq): add thunderbird --- homes/x86_64-linux/rafiq/default.nix | 58 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/homes/x86_64-linux/rafiq/default.nix b/homes/x86_64-linux/rafiq/default.nix index 46e45aa..5599a79 100644 --- a/homes/x86_64-linux/rafiq/default.nix +++ b/homes/x86_64-linux/rafiq/default.nix @@ -4,6 +4,24 @@ osConfig, ... }: +let + 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 = true; + }; +in { accounts = { email = { @@ -11,35 +29,8 @@ accounts = { "rafiq@rrv.sh" = { primary = true; - address = "rafiq@rrv.sh"; - maildir.path = "rafiq@rrv.sh"; - userName = "rafiq@rrv.sh"; - 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; - }; - }; - "mohammadrafiq@rrv.sh" = { - address = "mohammadrafiq@rrv.sh"; - maildir.path = "mohammadrafiq@rrv.sh"; - userName = "mohammadrafiq@rrv.sh"; - realName = "Mohammad Rafiq"; - passwordCommand = "sudo cat ${osConfig.sops.secrets."rafiq/workEmailPassword".path}"; - imap = { - host = "imap.forwardemail.net"; - port = 993; - }; - smtp = { - host = "smtp.forwardemail.net"; - port = 465; - }; - }; + } // mkEmailAccount "rafiq@rrv.sh"; + "mohammadrafiq@rrv.sh" = mkEmailAccount "mohammadrafiq@rrv.sh"; }; }; }; @@ -73,7 +64,10 @@ inputs.nixspect.packages."x86_64-linux".nixspect ]; - persistence."/persist/home/rafiq".directories = [ "repos" ]; + persistence."/persist/home/rafiq".directories = [ + "docs" + "repos" + ]; }; programs = { nh.enable = true; @@ -86,5 +80,9 @@ enable = true; nix-direnv.enable = true; }; + thunderbird.enable = true; + thunderbird.profiles.rafiq = { + isDefault = true; + }; }; }