mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 01:04:34 +02:00
null-ls: init with prettier and flake8 (#31)
This commit is contained in:
parent
f12a79bda6
commit
5cb317a5cb
4 changed files with 128 additions and 0 deletions
33
plugins/null-ls/servers.nix
Normal file
33
plugins/null-ls/servers.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue