mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-16 04:04:34 +02:00
update-scripts: move out of flake
See the explanation in the new update-scripts/README.md file.
This commit is contained in:
parent
96d0a2e390
commit
d3cb750e6a
10 changed files with 146 additions and 88 deletions
54
update-scripts/efmls-configs.nix
Normal file
54
update-scripts/efmls-configs.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
lib,
|
||||
vimPlugins,
|
||||
writeText,
|
||||
}:
|
||||
let
|
||||
tools = lib.trivial.importJSON "${vimPlugins.efmls-configs-nvim.src}/doc/supported-list.json";
|
||||
languages = lib.attrNames tools;
|
||||
|
||||
toLangTools' = lang: kind: lib.map (lib.getAttr "name") (tools.${lang}.${kind} or [ ]);
|
||||
|
||||
miscLinters = toLangTools' "misc" "linters";
|
||||
miscFormatters = toLangTools' "misc" "formatters";
|
||||
|
||||
sources =
|
||||
(lib.listToAttrs (
|
||||
lib.map (
|
||||
lang:
|
||||
let
|
||||
toLangTools = toLangTools' lang;
|
||||
in
|
||||
{
|
||||
name = lang;
|
||||
value = {
|
||||
linter = {
|
||||
inherit lang;
|
||||
possible = (toLangTools "linters") ++ miscLinters;
|
||||
};
|
||||
formatter = {
|
||||
inherit lang;
|
||||
possible = (toLangTools "formatters") ++ miscFormatters;
|
||||
};
|
||||
};
|
||||
}
|
||||
) languages
|
||||
))
|
||||
// {
|
||||
all = {
|
||||
linter = {
|
||||
lang = "all languages";
|
||||
possible = miscLinters;
|
||||
};
|
||||
formatter = {
|
||||
lang = "all languages";
|
||||
possible = miscFormatters;
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
writeText "efmls-configs-sources.nix" (
|
||||
"# WARNING: DO NOT EDIT\n"
|
||||
+ "# This file is generated with packages.<system>.efmls-configs-sources, which is run automatically by CI\n"
|
||||
+ (lib.generators.toPretty { } sources)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue