Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down Expand Up @@ -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;
Expand Down
19 changes: 11 additions & 8 deletions doc/lazy-nix-helper.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down Expand Up @@ -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;
Expand Down