diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-10-18 19:43:39 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-10-18 19:43:39 +0200 |
commit | 8415083eb6acc343dfa404dbbc12fa0171a48a20 (patch) | |
tree | d83f54c99763ae49076bf3071449595b6ccae133 /modules/private/websites/tools/mail | |
parent | 8fa7ff2c63fb0722144bc90837512d9f8b8c929d (diff) | |
download | Nix-8415083eb6acc343dfa404dbbc12fa0171a48a20.tar.gz Nix-8415083eb6acc343dfa404dbbc12fa0171a48a20.tar.zst Nix-8415083eb6acc343dfa404dbbc12fa0171a48a20.zip |
Add new machine to nixops
Diffstat (limited to 'modules/private/websites/tools/mail')
-rw-r--r-- | modules/private/websites/tools/mail/mta-sts.nix | 42 |
1 files changed, 22 insertions, 20 deletions
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 | |||
28 | "cp ${file d} $out/${d.domain}.txt" | 28 | "cp ${file d} $out/${d.domain}.txt" |
29 | ) domains)} | 29 | ) domains)} |
30 | ''; | 30 | ''; |
31 | cfg = config.myServices.websites.tools.email; | ||
31 | in | 32 | in |
32 | { | 33 | { |
33 | config.myServices.websites.webappDirs = { | 34 | config = lib.mkIf cfg.enable { |
34 | _mta-sts = root; | 35 | myServices.websites.webappDirs = { |
35 | }; | 36 | _mta-sts = root; |
37 | }; | ||
36 | 38 | ||
37 | config.services.websites.env.tools.vhostConfs.mta_sts = { | 39 | services.websites.env.tools.vhostConfs.mta_sts = { |
38 | certName = "mail"; | 40 | certName = "mail"; |
39 | addToCerts = true; | 41 | addToCerts = true; |
40 | hosts = ["mta-sts.mail.immae.eu"] ++ map (v: "mta-sts.${v.domain}") domains; | 42 | hosts = ["mta-sts.mail.immae.eu"] ++ map (v: "mta-sts.${v.domain}") domains; |
41 | root = "/run/current-system/webapps/_mta-sts"; | 43 | root = "/run/current-system/webapps/_mta-sts"; |
42 | extraConfig = [ | 44 | extraConfig = [ |
43 | '' | 45 | '' |
44 | RewriteEngine on | 46 | RewriteEngine on |
45 | RewriteCond %{HTTP_HOST} ^mta-sts.(.*)$ | 47 | RewriteCond %{HTTP_HOST} ^mta-sts.(.*)$ |
46 | RewriteRule ^/.well-known/mta-sts.txt$ %{DOCUMENT_ROOT}/%1.txt [L] | 48 | RewriteRule ^/.well-known/mta-sts.txt$ %{DOCUMENT_ROOT}/%1.txt [L] |
47 | <Directory /run/current-system/webapps/_mta-sts> | 49 | <Directory /run/current-system/webapps/_mta-sts> |
48 | Require all granted | 50 | Require all granted |
49 | Options -Indexes | 51 | Options -Indexes |
50 | </Directory> | 52 | </Directory> |
51 | '' | 53 | '' |
52 | ]; | 54 | ]; |
55 | }; | ||
53 | }; | 56 | }; |
54 | |||
55 | } | 57 | } |