From 85abc48714ea7079d61430aae0c9d69a65d4484b Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 30 Sep 2023 22:21:22 +0200 Subject: [PATCH] modules/autocmd: better handling of 'desc' option rename --- modules/autocmd.nix | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/modules/autocmd.nix b/modules/autocmd.nix index 421bd699..ba167d25 100644 --- a/modules/autocmd.nix +++ b/modules/autocmd.nix @@ -17,13 +17,6 @@ with lib; let }; autoCmdOption = types.submodule { - imports = [ - ( - # TODO remove this deprecation warning in December 2023 - mkRenamedOptionModule - ["description"] ["desc"] - ) - ]; options = { event = helpers.mkNullOrOption (types.either types.str (types.listOf types.str)) '' The event or events to register this autocommand. @@ -42,6 +35,12 @@ with lib; let Cannot be used with `pattern`. ''; + # Introduced early October 2023. + # TODO remove in early December 2023. + description = helpers.mkNullOrOption types.str '' + DEPRECATED, please use `desc`. + ''; + desc = helpers.mkNullOrOption types.str '' A textual description of this autocommand. ''; @@ -114,6 +113,21 @@ in { inherit (config) autoGroups autoCmd; in mkIf (autoGroups != {} || autoCmd != {}) { + # Introduced early October 2023. + # TODO remove in early December 2023. + assertions = [ + { + assertion = + all + (x: x.description == null) + autoCmd; + message = '' + RENAMED OPTION: `autoCmd[].description` has been renamed `autoCmd[].desc`. + Please update your configuration. + ''; + } + ]; + extraConfigLuaPost = (optionalString (autoGroups != {}) '' -- Set up autogroups {{