ldap: set assertions to forbid ldap and loginAccounts simultaneously

This commit is contained in:
Antoine Eiche 2023-05-20 09:52:25 +02:00 committed by lewo
parent 7695c856f1
commit 6775502be3
2 changed files with 18 additions and 0 deletions

View file

@ -1252,6 +1252,7 @@ in
};
imports = [
./mail-server/assertions.nix
./mail-server/borgbackup.nix
./mail-server/debug.nix
./mail-server/rsnapshot.nix

View file

@ -0,0 +1,17 @@
{ 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.extraVirtualAliases == {};
message = "When the LDAP support is enable (mailserver.ldap.enable = true), it is not possible to define mailserver.extraVirtualAliases";
}
{
assertion = config.mailserver.forwards == {};
message = "When the LDAP support is enable (mailserver.ldap.enable = true), it is not possible to define mailserver.forwards";
}
];
}