From d7e1df96efd95a49f9b235e419d452e1247c38fc Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Mon, 6 Aug 2018 19:10:57 +0900 Subject: [PATCH] accounts: added gmail as a flavor to help with some autoconfiguration --- modules/accounts/email.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/accounts/email.nix b/modules/accounts/email.nix index 6846cadb..e56172a9 100644 --- a/modules/accounts/email.nix +++ b/modules/accounts/email.nix @@ -120,9 +120,6 @@ let }; }); - # gpgModule = types.submodule { - # }; - mailAccount = types.submodule ({ name, config, ... }: { options = { name = mkOption { @@ -144,7 +141,7 @@ let }; flavor = mkOption { - type = types.enum [ "plain" "runbox.com" ]; + type = types.enum [ "plain" "runbox.com" "gmail"]; default = "plain"; description = '' Some email providers have peculiar behavior that require @@ -262,6 +259,21 @@ let maildir = mkOptionDefault { path = "${name}"; }; } + (mkIf (config.flavor == "gmail") { + imap = { + host = "imap.gmail.com"; + }; + + smtp = { + host = "smtp.gmail.com"; + port = 587; + }; + }) + + (mkIf (config.alot.enable) { + notmuch.enable = true; + }) + (mkIf (config.flavor == "runbox.com") { imap = { host = "mail.runbox.com";