1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01: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:
Matthew Leach 2021-08-02 19:23:50 +01:00 committed by Robert Helgesson
parent 2c4234cb79
commit 5515ec99cc
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
5 changed files with 9 additions and 7 deletions

View file

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

View file

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

View file

@ -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 ''

View file

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

View file

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