diff options
author | Linus Heckemann <git@sphalerite.org> | 2022-04-09 20:15:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-09 20:15:33 +0200 |
commit | 918a14988814948fc60ae69c830a00f72a91dbf4 (patch) | |
tree | cefb79d931fc1b708757fe65c3fca55e5829fb86 /nixos/modules/services/mail | |
parent | 0eba1fd8409f75199cd345a81a2eda694415de17 (diff) | |
parent | f4a0bb8334dbfef6e092078a78d78572ad3d6730 (diff) |
Merge pull request #167322 from alyssais/mailman-webHosts
nixos/mailman: improve empty webHosts error
Diffstat (limited to 'nixos/modules/services/mail')
-rw-r--r-- | nixos/modules/services/mail/mailman.nix | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/nixos/modules/services/mail/mailman.nix b/nixos/modules/services/mail/mailman.nix index 263f3b159d25f..5ddc188884558 100644 --- a/nixos/modules/services/mail/mailman.nix +++ b/nixos/modules/services/mail/mailman.nix @@ -225,7 +225,14 @@ in { See <https://mailman.readthedocs.io/en/latest/src/mailman/docs/mta.html>. ''; }; - in (lib.optionals cfg.enablePostfix [ + in [ + { assertion = cfg.webHosts != []; + message = '' + services.mailman.serve.enable requires there to be at least one entry + in services.mailman.webHosts. + ''; + } + ] ++ (lib.optionals cfg.enablePostfix [ { assertion = postfix.enable; message = '' Mailman's default NixOS configuration requires Postfix to be enabled. @@ -275,7 +282,7 @@ in { globals().update(json.load(f)) ''; - services.nginx = mkIf cfg.serve.enable { + services.nginx = mkIf (cfg.serve.enable && cfg.webHosts != []) { enable = mkDefault true; virtualHosts = lib.genAttrs cfg.webHosts (webHost: { locations = { |