From bc1a1b8993def6c207ac8b63a0a58e1c718582c0 Mon Sep 17 00:00:00 2001 From: Robin Raymond Date: Tue, 21 Nov 2017 12:04:10 +0100 Subject: [PATCH] put the warning where it actually works ^^ --- default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 2f0a9f3..1631e13 100644 --- a/default.nix +++ b/default.nix @@ -117,7 +117,6 @@ in extraVirtualAliases = mkOption { type = types.attrsOf (types.enum (builtins.attrNames cfg.loginAccounts)); - warnings = [ "virtualAliases had been derprecated. Use extraVirtualAliases instead or use the `aliases` field of the loginAccount attribute set"]; example = { "info@example.com" = "user1@example.com"; "postmaster@example.com" = "user1@example.com"; @@ -136,7 +135,6 @@ in virtualAliases = mkOption { type = types.attrsOf (types.enum (builtins.attrNames cfg.loginAccounts)); - warnings = [ "virtualAliases had been derprecated. Use extraVirtualAliases instead or use the `aliases` field of the loginAccount attribute set"]; example = { "info@example.com" = "user1@example.com"; "postmaster@example.com" = "user1@example.com"; @@ -327,4 +325,12 @@ in ./mail-server/rmilter.nix ./mail-server/nginx.nix ]; + + config = lib.mkIf config.mailserver.enable { + warnings = if (config.mailserver.virtualAliases != {}) then [ '' + virtualAliases had been derprecated. Use extraVirtualAliases instead or + use the `aliases` field of the loginAccount attribute set + ''] + else []; + }; }