| { config, lib, pkgs, ... }: let |
| mailDomains = [ |
| "clicks.codes" |
| "coded.codes" |
| "hopescaramels.com" |
| "trans.gg" |
| "starrysky.fyi" |
| "a.starrysky.fyi" |
| "thecoded.prof" |
| "turquoise.fyi" |
| ]; |
| mailACMEHosts = [ |
| "mail.clicks.codes" |
| "mail.coded.codes" |
| "mail.trans.gg" |
| "mail.hopescaramels.com" |
| ] ++ ( |
| builtins.concatMap |
| (domain: [ domain "mail.${domain}" "imap.${domain}" "smtp.${domain}" ]) |
| mailDomains |
| ); |
| in { |
| security.acme = { |
| certs = lib.pipe mailACMEHosts [ |
| (map (name: { inherit name; value = {}; })) |
| builtins.listToAttrs |
| ] // { |
| "mail.clicks.codes".postRun = '' |
| cp -r $(pwd) /opt/mailcow-dockerized/data/assets/ssl/ |
| cp -r $(pwd)/* /opt/mailcow-dockerized/data/assets/ssl/ |
| ''; |
| }; |
| defaults.postRun = "cp -r $(pwd) /opt/mailcow-dockerized/data/assets/ssl/"; |
| }; |
| } |