mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
34 lines
819 B
Nix
34 lines
819 B
Nix
|
{ pkgs, config, lib, ... }@args:
|
||
|
let
|
||
|
helpers = import ./helpers.nix args;
|
||
|
serverData = {
|
||
|
code_actions = {
|
||
|
};
|
||
|
completion = {
|
||
|
};
|
||
|
diagnostics = {
|
||
|
};
|
||
|
formatting = {
|
||
|
prettier = {
|
||
|
packages = [ pkgs.nodePackages.prettier ];
|
||
|
};
|
||
|
flake8 = {
|
||
|
packages = [ pkgs.python3Packages.flake8 ];
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
# Format the servers to be an array of attrs like the following example
|
||
|
# [{
|
||
|
# name = "prettier";
|
||
|
# sourceType = "formatting";
|
||
|
# packages = [...];
|
||
|
# }]
|
||
|
serverDataFormatted = lib.mapAttrsToList (sourceType: sourceSet:
|
||
|
lib.mapAttrsToList (name: attrs: attrs // { inherit sourceType name; }) sourceSet
|
||
|
) serverData;
|
||
|
dataFlattened = lib.flatten serverDataFormatted;
|
||
|
in
|
||
|
{
|
||
|
imports = lib.lists.map (helpers.mkServer) dataFlattened;
|
||
|
}
|