nixos-configs/homeManagerModules/neovim/langs/python/default.nix
matt1432 0f627107ce
All checks were successful
Discord / discord commits (push) Has been skipped
refactor(nvim): add _file and config attrs to all submodules
2024-12-21 23:34:10 -05:00

48 lines
1,023 B
Nix

{
config,
lib,
pkgs,
...
}: let
inherit (lib) attrValues mkIf;
cfg = config.programs.neovim;
pythonPkgs = py:
(attrValues {
inherit (py) python-lsp-server;
})
++ py.python-lsp-server.optional-dependencies.all;
in {
config = mkIf cfg.enable {
programs = {
neovim = {
withPython3 = true;
extraPython3Packages = pythonPkgs;
extraPackages = pythonPkgs pkgs.python3Packages;
extraLuaConfig =
# lua
''
require('lspconfig').pylsp.setup({
capabilities = require('cmp_nvim_lsp').default_capabilities(),
settings = {
pylsp = {
plugins = {
pycodestyle = {
maxLineLength = 100,
},
},
},
},
});
'';
};
};
};
# For accurate stack trace
_file = ./default.nix;
}