nixvim icon indicating copy to clipboard operation
nixvim copied to clipboard

Deprecate strLua types/option helpers

Open MattSturgeon opened this issue 1 year ago • 2 comments

Why

The biggest issue with types/options that transform the value is that once implemented, we are stuck with it lest we break users configs that rely on the transformation.

The other issue is that the transformation is somewhat hidden, meaning users end up defining a config in nix that is subtly different from the lua we end up producing.

Neither of these are an issue for "normal" module options, but for rfc42 style options such as settings it is not ideal.

How

We can deprecate passing strings directly using transitionType coercion. Similar to extraFiles, we would need a transition period before eventually removing support for string definitions.

When

We should update internal uses before having a deprecation warning.

Even if we don't want to deprecate yet, replacing the option apply implementation with a coercedTo type would be a good refactor IMO.

We should consider moving to nixpkg's lib.generators.mkLuaInline too, before asking users to change their configs. See #1935

MattSturgeon avatar Aug 10 '24 10:08 MattSturgeon