Unverified Commit a466f146 authored by NotAShelf's avatar NotAShelf
Browse files

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.
parent fbec0c0d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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.";
      }
      {