ldap: set assertions to forbid ldap and loginAccounts simultaneously
This commit is contained in:
parent
7695c856f1
commit
6775502be3
2 changed files with 18 additions and 0 deletions
|
@ -1252,6 +1252,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
./mail-server/assertions.nix
|
||||||
./mail-server/borgbackup.nix
|
./mail-server/borgbackup.nix
|
||||||
./mail-server/debug.nix
|
./mail-server/debug.nix
|
||||||
./mail-server/rsnapshot.nix
|
./mail-server/rsnapshot.nix
|
||||||
|
|
17
mail-server/assertions.nix
Normal file
17
mail-server/assertions.nix
Normal 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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
Loading…
Reference in a new issue