Improve the certificateScheme number deprecation warning message

This commit is contained in:
Antoine Eiche 2023-06-06 23:24:53 +02:00 committed by lewo
parent 7e09d8f537
commit 290d00f6db

View file

@ -454,7 +454,7 @@ in
certificateScheme = let certificateScheme = let
schemes = [ "manual" "selfsigned" "acme-nginx" "acme" ]; schemes = [ "manual" "selfsigned" "acme-nginx" "acme" ];
translate = i: warn "setting mailserver.certificateScheme by number is deprecated, please use names instead" translate = i: warn "Setting mailserver.certificateScheme by number is deprecated, please use names instead: 'mailserver.certificateScheme = ${builtins.toString i}' can be replaced by 'mailserver.certificateScheme = \"${(builtins.elemAt schemes (i - 1))}\"'."
(builtins.elemAt schemes (i - 1)); (builtins.elemAt schemes (i - 1));
in mkOption { in mkOption {
type = with types; coercedTo (enum [ 1 2 3 ]) translate (enum schemes); type = with types; coercedTo (enum [ 1 2 3 ]) translate (enum schemes);