From 2cd05d5d00538af81631d3e3240ad51b3b933ddc Mon Sep 17 00:00:00 2001 From: Brett Gleason Date: Tue, 18 Mar 2025 22:45:16 -0500 Subject: [PATCH 1/3] update NixOS Configuration section in README. update sanitizePluginName function to account for plugins that have moved to additional package sets since lazy-nix-helper was originally released --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; From 316829823d69913b82f9a8158743a89803029785 Mon Sep 17 00:00:00 2001 From: Brett Gleason Date: Tue, 18 Mar 2025 22:47:56 -0500 Subject: [PATCH 2/3] update CHANGELOG to reflect README updates --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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 From 27bc6bf9c062ebcfede02125a153d971e27a58e6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 19 Mar 2025 03:49:52 +0000 Subject: [PATCH 3/3] Auto generate docs --- doc/lazy-nix-helper.nvim.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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;