misc_nixos-mailserver/mail-server
emilylange 6ef1eb9ce1
assertions: fix eval error when mailserver.stateVersion is unset (null)
Eval does not stop on the first assertion failure it encouters.
Instead, it tries to evaluate all assertions and returns with a list of
those that failed.

This means our very top `config.mailserver.stateVersion != null`
assertion does not gate against any other assertions trying to compare
null against an integer.

The error prior to this commit can be reproduced by removing
`mailserver.stateVersion = 999;` in tests/lib/config.nix and then trying
to evaluate any of the tests:

~~~bash
# nix eval --raw .#checks.x86_64-linux.internal-unstable
error:
       … while evaluating the attribute 'outPath'
         at /nix/store/syvnmj3hhckkbncm94kfkbl76qsdqqj3-source/lib/customisation.nix:421:7:
          420|         drv.drvPath;
          421|       outPath =
             |       ^
          422|         assert condition;

       … while calling the 'getAttr' builtin
         at «internal»:1:500:
       (stack trace truncated; use '--show-trace' to show the full trace)

       error: cannot compare null with an integer
~~~
2025-06-21 20:15:46 +02:00
..
dovecot/imap_sieve dovecot: drop unused pipe scripts 2025-05-15 16:29:05 +02:00
assertions.nix assertions: fix eval error when mailserver.stateVersion is unset (null) 2025-06-21 20:15:46 +02:00
borgbackup.nix treewide: reformat with nixfmt-rfc-style 2025-06-15 03:39:44 +02:00
clamav.nix treewide: remove dead nix references 2025-05-15 16:41:30 +02:00
common.nix treewide: reformat with nixfmt-rfc-style 2025-06-15 03:39:44 +02:00
dovecot.nix dovecot: fix custom index dir configuration for ldap users 2025-06-21 09:47:03 +02:00
environment.nix treewide: remove overly broad with cfg 2025-06-15 05:39:20 +02:00
kresd.nix treewide: reformat with nixfmt-rfc-style 2025-06-15 03:39:44 +02:00
monit.nix treewide: remove dead nix references 2025-05-15 16:41:30 +02:00
networking.nix treewide: remove overly broad with cfg 2025-06-15 05:39:20 +02:00
nginx.nix treewide: reformat with nixfmt-rfc-style 2025-06-15 03:39:44 +02:00
postfix.nix postfix: disable SHA1 for SMTP connections 2025-06-18 06:58:42 +02:00
rsnapshot.nix treewide: remove global with lib 2025-06-15 05:08:47 +02:00
rspamd.nix Create per service debug logging toggles 2025-06-17 22:02:31 +02:00
systemd.nix treewide: remove overly broad with cfg 2025-06-15 05:39:20 +02:00
users.nix treewide: reformat with nixfmt-rfc-style 2025-06-15 03:39:44 +02:00