nix-community.nixvim/plugins/null-ls/servers.nix

55 lines
1.3 KiB
Nix
Raw Normal View History

2022-11-15 11:36:42 +00:00
{ pkgs, config, lib, inputs, ... }@args:
let
helpers = import ./helpers.nix args;
serverData = {
2022-11-13 15:20:23 +00:00
code_actions = { };
completion = { };
diagnostics = {
2022-11-13 15:20:23 +00:00
flake8 = {
packages = [ pkgs.python3Packages.flake8 ];
};
2022-11-15 11:36:42 +00:00
shellcheck = {
packages = [ pkgs.shellcheck ];
};
};
formatting = {
2022-10-04 13:17:56 +00:00
phpcbf = {
packages = [ pkgs.phpPackages.phpcbf ];
};
alejandra = {
packages = [ pkgs.alejandra ];
};
nixfmt = {
packages = [ pkgs.nixfmt ];
};
prettier = {
packages = [ pkgs.nodePackages.prettier ];
};
2022-11-13 15:20:23 +00:00
black = {
packages = [ pkgs.python3Packages.black ];
};
2022-11-15 11:36:42 +00:00
beautysh = {
packages = [ inputs.beautysh.packages.${pkgs.system}.beautysh-python38 ];
};
2022-12-01 14:37:30 +00:00
fourmolu = {
packages = [ pkgs.haskellPackages.fourmolu ];
};
};
};
# Format the servers to be an array of attrs like the following example
# [{
# name = "prettier";
# sourceType = "formatting";
# packages = [...];
# }]
2022-11-13 15:20:23 +00:00
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;
}