1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-26 16:38:34 +02:00

accounts.mail: add "gmail.com" as a flavor

To help with some autoconfiguration.
This commit is contained in:
Matthieu Coudron 2018-08-06 19:10:57 +09:00 committed by Robert Helgesson
parent 34133ca7f3
commit 168d546304
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89

View File

@ -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";