mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 14:40:29 +00:00
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
5 changed files with 9 additions and 7 deletions
|
@ -71,7 +71,7 @@ let
|
|||
};
|
||||
|
||||
certificatesFile = mkOption {
|
||||
type = types.path;
|
||||
type = types.nullOr types.path;
|
||||
default = config.accounts.email.certificatesFile;
|
||||
defaultText = "config.accounts.email.certificatesFile";
|
||||
description = ''
|
||||
|
@ -354,7 +354,7 @@ let
|
|||
in {
|
||||
options.accounts.email = {
|
||||
certificatesFile = mkOption {
|
||||
type = types.path;
|
||||
type = types.nullOr types.path;
|
||||
default = "/etc/ssl/certs/ca-certificates.crt";
|
||||
description = ''
|
||||
Path to default file containing certificate authorities that
|
||||
|
|
|
@ -295,7 +295,8 @@ in {
|
|||
"ssl")
|
||||
else
|
||||
"";
|
||||
smtpSslCertPath = mkIf smtp.tls.enable smtp.tls.certificatesFile;
|
||||
smtpSslCertPath =
|
||||
mkIf smtp.tls.enable (toString smtp.tls.certificatesFile);
|
||||
smtpServer = smtp.host;
|
||||
smtpUser = userName;
|
||||
from = address;
|
||||
|
|
|
@ -21,11 +21,12 @@ let
|
|||
user = userName;
|
||||
tls = onOff smtp.tls.enable;
|
||||
tls_starttls = onOff smtp.tls.useStartTls;
|
||||
tls_trust_file = smtp.tls.certificatesFile;
|
||||
} // optionalAttrs (msmtp.tls.fingerprint != null) {
|
||||
tls_fingerprint = msmtp.tls.fingerprint;
|
||||
} // 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;
|
||||
} // msmtp.extraConfig) ++ optional primary ''
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ let
|
|||
''
|
||||
# Generated by Home Manager.
|
||||
set ssl_force_tls = yes
|
||||
set certificate_file=${config.accounts.email.certificatesFile}
|
||||
set certificate_file=${toString config.accounts.email.certificatesFile}
|
||||
|
||||
# GPG section
|
||||
set crypt_use_gpgme = yes
|
||||
|
|
|
@ -56,7 +56,7 @@ let
|
|||
|
||||
ssl = if imap.tls.enable then {
|
||||
ssl = true;
|
||||
sslcacertfile = imap.tls.certificatesFile;
|
||||
sslcacertfile = toString imap.tls.certificatesFile;
|
||||
starttls = imap.tls.useStartTls;
|
||||
} else {
|
||||
ssl = false;
|
||||
|
|
Loading…
Reference in a new issue