From f7c50a8aa060b38c9b8fa0a40fca6e7049be2652 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 9 Nov 2020 04:35:12 +0100 Subject: [PATCH] nixos/ssmtp: add assertion for useSTARTTLS dependency on useTLS services.ssmtp.useSTARTTLS has no effect when services.ssmtp.useTLS is disabled. --- nixos/modules/programs/ssmtp.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/programs/ssmtp.nix b/nixos/modules/programs/ssmtp.nix index 98ff21bd37f2..1f49ddc91bb3 100644 --- a/nixos/modules/programs/ssmtp.nix +++ b/nixos/modules/programs/ssmtp.nix @@ -142,6 +142,13 @@ in config = mkIf cfg.enable { + assertions = [ + { + assertion = cfg.useSTARTTLS -> cfg.useTLS; + message = "services.ssmtp.useSTARTTLS has no effect without services.ssmtp.useTLS"; + } + ]; + services.ssmtp.settings = mkMerge [ ({ MailHub = cfg.hostName;