From 8415083eb6acc343dfa404dbbc12fa0171a48a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 18 Oct 2019 19:43:39 +0200 Subject: Add new machine to nixops --- modules/private/websites/tools/mail/mta-sts.nix | 42 +++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'modules/private/websites/tools/mail/mta-sts.nix') diff --git a/modules/private/websites/tools/mail/mta-sts.nix b/modules/private/websites/tools/mail/mta-sts.nix index bedefda..d443f55 100644 --- a/modules/private/websites/tools/mail/mta-sts.nix +++ b/modules/private/websites/tools/mail/mta-sts.nix @@ -28,28 +28,30 @@ let "cp ${file d} $out/${d.domain}.txt" ) domains)} ''; + cfg = config.myServices.websites.tools.email; in { - config.myServices.websites.webappDirs = { - _mta-sts = root; - }; + config = lib.mkIf cfg.enable { + myServices.websites.webappDirs = { + _mta-sts = root; + }; - config.services.websites.env.tools.vhostConfs.mta_sts = { - certName = "mail"; - addToCerts = true; - hosts = ["mta-sts.mail.immae.eu"] ++ map (v: "mta-sts.${v.domain}") domains; - root = "/run/current-system/webapps/_mta-sts"; - extraConfig = [ - '' - RewriteEngine on - RewriteCond %{HTTP_HOST} ^mta-sts.(.*)$ - RewriteRule ^/.well-known/mta-sts.txt$ %{DOCUMENT_ROOT}/%1.txt [L] - - Require all granted - Options -Indexes - - '' - ]; + services.websites.env.tools.vhostConfs.mta_sts = { + certName = "mail"; + addToCerts = true; + hosts = ["mta-sts.mail.immae.eu"] ++ map (v: "mta-sts.${v.domain}") domains; + root = "/run/current-system/webapps/_mta-sts"; + extraConfig = [ + '' + RewriteEngine on + RewriteCond %{HTTP_HOST} ^mta-sts.(.*)$ + RewriteRule ^/.well-known/mta-sts.txt$ %{DOCUMENT_ROOT}/%1.txt [L] + + Require all granted + Options -Indexes + + '' + ]; + }; }; - } -- cgit v1.2.3