diff options
author | Matthieu Coudron <mattator@gmail.com> | 2018-08-06 19:10:57 +0900 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2018-08-16 23:46:27 +0200 |
commit | 168d5463042b9e8090190e20bb49f6f951034b02 (patch) | |
tree | 9bcc9e11e8300f96ac39eade9bf929d31706ee32 /modules/accounts/email.nix | |
parent | 34133ca7f34d4ef80d83052ca6580e89885837eb (diff) |
accounts.mail: add "gmail.com" as a flavor
To help with some autoconfiguration.
Diffstat (limited to 'modules/accounts/email.nix')
-rw-r--r-- | modules/accounts/email.nix | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/modules/accounts/email.nix b/modules/accounts/email.nix index 2f45fe7e7d7..640edc59b33 100644 --- a/modules/accounts/email.nix +++ b/modules/accounts/email.nix @@ -121,9 +121,6 @@ let }; }); - # gpgModule = types.submodule { - # }; - mailAccountOpts = { name, config, ... }: { options = { name = mkOption { @@ -145,7 +142,7 @@ let }; flavor = mkOption { - type = types.enum [ "plain" "runbox.com" ]; + type = types.enum [ "plain" "gmail.com" "runbox.com" ]; default = "plain"; description = '' Some email providers have peculiar behavior that require @@ -263,6 +260,19 @@ let maildir = mkOptionDefault { path = "${name}"; }; } + (mkIf (config.flavor == "gmail.com") { + userName = mkDefault config.address; + + imap = { + host = "imap.gmail.com"; + }; + + smtp = { + host = "smtp.gmail.com"; + port = 587; + }; + }) + (mkIf (config.flavor == "runbox.com") { imap = { host = "mail.runbox.com"; |