aboutsummaryrefslogtreecommitdiff
path: root/modules/private/mail/default.nix
blob: ad2c6846ba9687672c2c72e704d1ef881738aa65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
{ lib, pkgs, config, myconfig,  ... }:
{
  config.security.acme.certs."mail" = config.services.myCertificates.certConfig // {
    domain = "eldiron.immae.eu";
    extraDomains = let
      zonesWithMx = builtins.filter (zone:
        lib.attrsets.hasAttr "withEmail" zone && lib.lists.length zone.withEmail > 0
      ) myconfig.env.dns.masterZones;
      mxs = map (zone: "mx-1.${zone.name}") zonesWithMx;
    in builtins.listToAttrs (map (mx: lib.attrsets.nameValuePair mx null) mxs);
  };
}