From db91cbf795236ac4c499932e32d98a9fd07fd955 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 13 Mar 2026 12:53:34 -0500 Subject: [PATCH] yazi: use state version default helper Replace the inline shellWrapperName migration logic with the shared state-version default helper. This keeps the existing warning and version-dependent default, but moves the message and defaultText formatting into one reusable implementation. Inline the helper directly at the option declaration so the module stays small while matching the new deprecation-default pattern for future adoptions. Signed-off-by: Austin Horstman --- modules/programs/yazi.nix | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index 9aaa445a..3f698321 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -48,23 +48,22 @@ in shellWrapperName = lib.mkOption { type = types.str; - default = - if lib.versionAtLeast config.home.stateVersion "26.05" then - "y" - else - lib.warn '' - The default value of `programs.yazi.shellWrapperName` has changed from `yy` to `y`. - You are currently using the legacy default (`yy`) because `home.stateVersion` is less than "26.05". - To silence this warning and keep legacy behavior, set: - programs.yazi.shellWrapperName = "yy"; - To adopt the new default behavior, set: - programs.yazi.shellWrapperName = "y"; - '' "yy"; - defaultText = literalExpression '' - "y" for state version ≥ 26.05 - "yy" for state version < 26.05 - ''; example = "yy"; + inherit + (lib.hm.deprecations.mkStateVersionOptionDefault { + inherit (config.home) stateVersion; + since = "26.05"; + optionPath = [ + "programs" + "yazi" + "shellWrapperName" + ]; + legacy.value = "yy"; + current.value = "y"; + }) + default + defaultText + ; description = '' Name of the shell wrapper to be called. '';