2023-05-20 07:52:25 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
|
|
assertions = lib.optionals config.mailserver.ldap.enable [
|
|
|
|
{
|
|
|
|
assertion = config.mailserver.loginAccounts == {};
|
|
|
|
message = "When the LDAP support is enable (mailserver.ldap.enable = true), it is not possible to define mailserver.loginAccounts";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
assertion = config.mailserver.forwards == {};
|
|
|
|
message = "When the LDAP support is enable (mailserver.ldap.enable = true), it is not possible to define mailserver.forwards";
|
|
|
|
}
|
2024-06-04 15:31:28 +00:00
|
|
|
] ++ lib.optionals (config.mailserver.enable && config.mailserver.certificateScheme != "acme") [
|
2023-06-28 19:42:37 +00:00
|
|
|
{
|
|
|
|
assertion = config.mailserver.acmeCertificateName == config.mailserver.fqdn;
|
|
|
|
message = "When the certificate scheme is not 'acme' (mailserver.certificateScheme != \"acme\"), it is not possible to define mailserver.acmeCertificateName";
|
|
|
|
}
|
2023-05-20 07:52:25 +00:00
|
|
|
];
|
|
|
|
}
|