plugins/none-ls: switch to mkNeovimPlugin

This commit is contained in:
Matt Sturgeon 2024-06-18 16:39:09 +01:00
parent cb9ee70e8b
commit ca8ac5f8e4
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
4 changed files with 479 additions and 300 deletions

View file

@ -317,16 +317,18 @@ in
-> [${concatStringsSep ", " uselesslyDeclaredToolNames}]
'');
plugins.none-ls.sourcesItems = builtins.map (
source:
let
sourceItem = "${source.sourceType}.${source.sourceName}";
withArgs = if source.withArgs == null then sourceItem else "${sourceItem}.with(${source.withArgs})";
in
helpers.mkRaw ''
require("null-ls").builtins.${withArgs}
''
) enabledSources;
plugins.none-ls.settings.sources = mkIf (enabledSources != [ ]) (
map (
{
sourceType,
sourceName,
withArgs,
...
}:
"require('null-ls').builtins.${sourceType}.${sourceName}"
+ optionalString (withArgs != null) ".with(${withArgs})"
) enabledSources
);
plugins.gitsigns.enable = mkIf gitsignsEnabled true;
extraPackages = map (source: source.package or null) enabledSources;
};