email: allow null certificatesFile
Allow the value of certificatesFile to be null. Also fixup uses of this variable. Fixes: #2206
This commit is contained in:
parent
2c4234cb79
commit
5515ec99cc
|
@ -71,7 +71,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
certificatesFile = mkOption {
|
certificatesFile = mkOption {
|
||||||
type = types.path;
|
type = types.nullOr types.path;
|
||||||
default = config.accounts.email.certificatesFile;
|
default = config.accounts.email.certificatesFile;
|
||||||
defaultText = "config.accounts.email.certificatesFile";
|
defaultText = "config.accounts.email.certificatesFile";
|
||||||
description = ''
|
description = ''
|
||||||
|
@ -354,7 +354,7 @@ let
|
||||||
in {
|
in {
|
||||||
options.accounts.email = {
|
options.accounts.email = {
|
||||||
certificatesFile = mkOption {
|
certificatesFile = mkOption {
|
||||||
type = types.path;
|
type = types.nullOr types.path;
|
||||||
default = "/etc/ssl/certs/ca-certificates.crt";
|
default = "/etc/ssl/certs/ca-certificates.crt";
|
||||||
description = ''
|
description = ''
|
||||||
Path to default file containing certificate authorities that
|
Path to default file containing certificate authorities that
|
||||||
|
|
|
@ -295,7 +295,8 @@ in {
|
||||||
"ssl")
|
"ssl")
|
||||||
else
|
else
|
||||||
"";
|
"";
|
||||||
smtpSslCertPath = mkIf smtp.tls.enable smtp.tls.certificatesFile;
|
smtpSslCertPath =
|
||||||
|
mkIf smtp.tls.enable (toString smtp.tls.certificatesFile);
|
||||||
smtpServer = smtp.host;
|
smtpServer = smtp.host;
|
||||||
smtpUser = userName;
|
smtpUser = userName;
|
||||||
from = address;
|
from = address;
|
||||||
|
|
|
@ -21,11 +21,12 @@ let
|
||||||
user = userName;
|
user = userName;
|
||||||
tls = onOff smtp.tls.enable;
|
tls = onOff smtp.tls.enable;
|
||||||
tls_starttls = onOff smtp.tls.useStartTls;
|
tls_starttls = onOff smtp.tls.useStartTls;
|
||||||
tls_trust_file = smtp.tls.certificatesFile;
|
|
||||||
} // optionalAttrs (msmtp.tls.fingerprint != null) {
|
} // optionalAttrs (msmtp.tls.fingerprint != null) {
|
||||||
tls_fingerprint = msmtp.tls.fingerprint;
|
tls_fingerprint = msmtp.tls.fingerprint;
|
||||||
} // optionalAttrs (smtp.port != null) { port = toString smtp.port; }
|
} // optionalAttrs (smtp.port != null) { port = toString smtp.port; }
|
||||||
// optionalAttrs (passwordCommand != null) {
|
// optionalAttrs (smtp.tls.certificatesFile != null) {
|
||||||
|
tls_trust_file = smtp.tls.certificatesFile;
|
||||||
|
} // optionalAttrs (passwordCommand != null) {
|
||||||
passwordeval = toString passwordCommand;
|
passwordeval = toString passwordCommand;
|
||||||
} // msmtp.extraConfig) ++ optional primary ''
|
} // msmtp.extraConfig) ++ optional primary ''
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,7 @@ let
|
||||||
''
|
''
|
||||||
# Generated by Home Manager.
|
# Generated by Home Manager.
|
||||||
set ssl_force_tls = yes
|
set ssl_force_tls = yes
|
||||||
set certificate_file=${config.accounts.email.certificatesFile}
|
set certificate_file=${toString config.accounts.email.certificatesFile}
|
||||||
|
|
||||||
# GPG section
|
# GPG section
|
||||||
set crypt_use_gpgme = yes
|
set crypt_use_gpgme = yes
|
||||||
|
|
|
@ -56,7 +56,7 @@ let
|
||||||
|
|
||||||
ssl = if imap.tls.enable then {
|
ssl = if imap.tls.enable then {
|
||||||
ssl = true;
|
ssl = true;
|
||||||
sslcacertfile = imap.tls.certificatesFile;
|
sslcacertfile = toString imap.tls.certificatesFile;
|
||||||
starttls = imap.tls.useStartTls;
|
starttls = imap.tls.useStartTls;
|
||||||
} else {
|
} else {
|
||||||
ssl = false;
|
ssl = false;
|
||||||
|
|
Loading…
Reference in a new issue