Skip to content

Commit 4c6a079

Browse files
committed
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
1 parent ebaec1e commit 4c6a079

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ The configuration instructions below include code that will install Lazy-Nix-Hel
7070

7171
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.
7272

73-
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.
74-
- `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
73+
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.
74+
- `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
7575
- `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
7676

7777
**Lazy-Nix-Helper's own Nix Store Path**
@@ -289,8 +289,10 @@ let
289289
sanitizePluginName = input:
290290
let
291291
name = lib.strings.getName input;
292-
intermediate = lib.strings.removePrefix "vimplugin-" name;
293-
result = lib.strings.removePrefix "lua5.1-" intermediate;
292+
vimplugin_removed = lib.strings.removePrefix "vimplugin-" name;
293+
luajit_removed = lib.strings.removePrefix "luajit2.1-" vimplugin_removed
294+
lua5_1_removed = lib.strings.removePrefix "lua5.1-" luajit_removed;
295+
result = lib.strings.removeSuffix "-scm" lua5_1_removed;
294296
in result;
295297

296298
pluginList = plugins: lib.strings.concatMapStrings (plugin: " [\"${sanitizePluginName plugin.name}\"] = \"${plugin.outPath}\",\n") plugins;

0 commit comments

Comments
 (0)