nixos/wakapi: fix incorrect assertion conditions

Using implication here (->) causes the assertions to fail haphazardly due to the ordering *implied* by the operator. By using AND, we avoid this case. Unsurprisingly, this was caught by the NixOS test.
This commit is contained in:
NotAShelf 2024-10-22 12:27:24 +03:00
parent fbec0c0d7f
commit a466f14627
No known key found for this signature in database
GPG Key ID: AF26552424E53993

View File

@ -182,11 +182,11 @@ in
message = "Either `services.wakapi.passwordSalt` or `services.wakapi.passwordSaltFile` must be set.";
}
{
assertion = cfg.passwordSalt != null -> cfg.passwordSaltFile != null;
assertion = !(cfg.passwordSalt != null && cfg.passwordSaltFile != null);
message = "Both `services.wakapi.passwordSalt` `services.wakapi.passwordSaltFile` should not be set at the same time.";
}
{
assertion = cfg.smtpPassword != null -> cfg.smtpPasswordFile != null;
assertion = !(cfg.smtpPassword != null && cfg.smtpPasswordFile != null);
message = "Both `services.wakapi.smtpPassword` `services.wakapi.smtpPasswordFile` should not be set at the same time.";
}
{