diff --git a/CHANGELOG.md b/CHANGELOG.md index 12627ca..367cb80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Docs +- Update sanitizePluginName function in example NixOS config in README to account for plugins that have moved to different package sets since the original release of lazy-nix-helper - Add nixCats and nvf to the Alternatives section in the README ## [0.6.0] 2024-08-28 diff --git a/README.md b/README.md index 4bbe5bf..62395c7 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,8 @@ The configuration instructions below include code that will install Lazy-Nix-Hel if there is a plugin name collision with these rules applied then lazy-nix-helper will thrown an error. in that case you will have to set this option to false and match plugin names exactly. - it is recommended to keep this set to false. this was a more relevant feature when `auto_plugin_discovery` was the only method and the plugin names weren't always clear. now that the plugin accepts an `input_plugin_table` generated by your nix config, it is recommended to reference the plugin names as output by your nix builds. - - `auto_plugin_discovery`: when set to `true` enables the automatic plugin discovery originally included in Lazy-Nix-Helper. the automatic plugin discovery is a nix anti-pattern and only works for a subset of nix/nixos use cases and config arrangements. this option has been left in place to let early adopters of Lazy-Nix-Helper keep their original configuration, but it should be set to `false` for all new configurations + it is recommended to keep this set to false. this was a more relevant feature when `auto_plugin_discovery` was the only method and the plugin names weren't always clear. now that the plugin accepts an `input_plugin_table` generated by your nix config, it is recommended to reference the plugin names as output by your nix builds. + - `auto_plugin_discovery`: when set to `true` enables the automatic plugin discovery originally included in Lazy-Nix-Helper. the automatic plugin discovery is a nix anti-pattern and only works for a subset of nix/nixos use cases and config arrangements. since some neovim plugin packages have been moved to different package sets this will no longer work for every plugin. this option has been left in place to let early adopters of Lazy-Nix-Helper keep their original configuration, but it should be set to `false` for all new configurations - `input_plugin_table`: the plugin table mapping plugin names to plugin paths generated by your nix config. instructions for generating this table are provided in the NixOS Configuration section **Lazy-Nix-Helper's own Nix Store Path** @@ -289,8 +289,10 @@ let sanitizePluginName = input: let name = lib.strings.getName input; - intermediate = lib.strings.removePrefix "vimplugin-" name; - result = lib.strings.removePrefix "lua5.1-" intermediate; + vimplugin_removed = lib.strings.removePrefix "vimplugin-" name; + luajit_removed = lib.strings.removePrefix "luajit2.1-" vimplugin_removed + lua5_1_removed = lib.strings.removePrefix "lua5.1-" luajit_removed; + result = lib.strings.removeSuffix "-scm" lua5_1_removed; in result; pluginList = plugins: lib.strings.concatMapStrings (plugin: " [\"${sanitizePluginName plugin.name}\"] = \"${plugin.outPath}\",\n") plugins; diff --git a/doc/lazy-nix-helper.nvim.txt b/doc/lazy-nix-helper.nvim.txt index b6baf77..e8081df 100644 --- a/doc/lazy-nix-helper.nvim.txt +++ b/doc/lazy-nix-helper.nvim.txt @@ -121,12 +121,13 @@ your nix config, it is recommended to reference the plugin names as output by your nix builds. - `auto_plugin_discovery`: when set to `true` enables the automatic plugin discovery originally included in Lazy-Nix-Helper. the automatic plugin discovery is a nix anti-pattern and only works for a subset of -nix/nixos use cases and config arrangements. this option has been left in place -to let early adopters of Lazy-Nix-Helper keep their original configuration, but -it should be set to `false` for all new configurations - `input_plugin_table`: -the plugin table mapping plugin names to plugin paths generated by your nix -config. instructions for generating this table are provided in the NixOS -Configuration section +nix/nixos use cases and config arrangements. since some neovim plugin packages +have been moved to different package sets this will no longer work for every +plugin. this option has been left in place to let early adopters of +Lazy-Nix-Helper keep their original configuration, but it should be set to +`false` for all new configurations - `input_plugin_table`: the plugin table +mapping plugin names to plugin paths generated by your nix config. instructions +for generating this table are provided in the NixOS Configuration section **Lazy-Nix-Helper’s own Nix Store Path** @@ -373,8 +374,10 @@ Generate the plugins table 5. Include the rest of your config files with sanitizePluginName = input: let name = lib.strings.getName input; - intermediate = lib.strings.removePrefix "vimplugin-" name; - result = lib.strings.removePrefix "lua5.1-" intermediate; + vimplugin_removed = lib.strings.removePrefix "vimplugin-" name; + luajit_removed = lib.strings.removePrefix "luajit2.1-" vimplugin_removed + lua5_1_removed = lib.strings.removePrefix "lua5.1-" luajit_removed; + result = lib.strings.removeSuffix "-scm" lua5_1_removed; in result; pluginList = plugins: lib.strings.concatMapStrings (plugin: " [\"${sanitizePluginName plugin.name}\"] = \"${plugin.outPath}\",\n") plugins;