From 1861e82addf785dc5de8ca4f9fb3ac950c8dccef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20=E2=80=98Twey=E2=80=99=20Kay?= Date: Mon, 27 Feb 2023 14:52:16 +0000 Subject: [PATCH] address review comments --- mail-server/autoconfig/default.nix | 11 +---------- mail-server/autoconfig/template.xml | 2 +- mail-server/autoconfig/webroot.nix | 9 ++------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/mail-server/autoconfig/default.nix b/mail-server/autoconfig/default.nix index f47358b..4877941 100644 --- a/mail-server/autoconfig/default.nix +++ b/mail-server/autoconfig/default.nix @@ -75,16 +75,7 @@ in ''; }; - template = mkOption { - type = types.nullOr types.lines; - default = null; - description = '' - The text of a template for the autoconfig XML file. - If provided, overrides `templateFile`. - ''; - }; - - extraProviderConfig = mkOption { + extraEmailProvider = mkOption { type = types.lines; default = ""; description = '' diff --git a/mail-server/autoconfig/template.xml b/mail-server/autoconfig/template.xml index 3471692..ab305db 100644 --- a/mail-server/autoconfig/template.xml +++ b/mail-server/autoconfig/template.xml @@ -23,6 +23,6 @@ password-cleartext %EMAILADDRESS% - @extraProviderConfig@ + @extraEmailProvider@ diff --git a/mail-server/autoconfig/webroot.nix b/mail-server/autoconfig/webroot.nix index 04a181a..ea9a319 100644 --- a/mail-server/autoconfig/webroot.nix +++ b/mail-server/autoconfig/webroot.nix @@ -30,16 +30,11 @@ in { mailserver.autoconfig.webRoot = pkgs.substituteAll ({ name = "config-v1.1.xml"; dir = "mail"; - src = if cfg.template == null - then cfg.templateFile - else pkgs.writeTextFile { - name = "mailserver-autoconfig-template.xml"; - text = cfg.template; - }; + src = cfg.templateFile; } // { hostname = ms.fqdn; inherit (cfg) - emailProviderId displayName displayShortName extraProviderConfig; + emailProviderId displayName displayShortName extraEmailProvider; imapSslServer = incomingServer ms.enableImapSsl 993 "SSL"; imapServer = incomingServer ms.enableImapSsl 143 "STARTTLS"; pop3SslServer = incomingServer ms.enablePop3Ssl 995 "SSL";