2024-05-07 22:49:00 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
2024-05-25 20:28:35 -04:00
|
|
|
pkgs,
|
2024-05-07 22:49:00 -04:00
|
|
|
...
|
|
|
|
}: let
|
2024-12-16 17:44:17 -05:00
|
|
|
inherit (lib) attrValues mkIf;
|
2024-11-22 02:48:41 -05:00
|
|
|
|
|
|
|
cfg = config.programs.neovim;
|
2024-12-21 23:34:10 -05:00
|
|
|
|
2024-12-22 00:04:13 -05:00
|
|
|
# We keep the packages here because python is a bit complicated and common
|
2024-12-21 23:34:10 -05:00
|
|
|
pythonPkgs = py:
|
|
|
|
(attrValues {
|
|
|
|
inherit (py) python-lsp-server;
|
|
|
|
})
|
|
|
|
++ py.python-lsp-server.optional-dependencies.all;
|
2024-12-16 17:44:17 -05:00
|
|
|
in {
|
2024-12-21 23:34:10 -05:00
|
|
|
config = mkIf cfg.enable {
|
2024-05-07 22:49:00 -04:00
|
|
|
programs = {
|
|
|
|
neovim = {
|
|
|
|
withPython3 = true;
|
|
|
|
|
2024-12-21 23:34:10 -05:00
|
|
|
extraPython3Packages = pythonPkgs;
|
|
|
|
extraPackages = pythonPkgs pkgs.python3Packages;
|
2024-05-07 22:49:00 -04:00
|
|
|
|
2024-05-11 20:10:45 -04:00
|
|
|
extraLuaConfig =
|
2024-06-09 22:49:30 -04:00
|
|
|
# lua
|
2024-05-11 20:10:45 -04:00
|
|
|
''
|
2024-11-26 23:36:33 -05:00
|
|
|
require('lspconfig').pylsp.setup({
|
2024-07-28 02:54:34 -04:00
|
|
|
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
2024-12-16 17:44:17 -05:00
|
|
|
|
2024-11-26 23:36:33 -05:00
|
|
|
settings = {
|
|
|
|
pylsp = {
|
|
|
|
plugins = {
|
|
|
|
pycodestyle = {
|
|
|
|
maxLineLength = 100,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-07-28 02:54:34 -04:00
|
|
|
});
|
2024-05-11 20:10:45 -04:00
|
|
|
'';
|
2024-05-07 22:49:00 -04:00
|
|
|
};
|
|
|
|
};
|
2024-12-16 17:44:17 -05:00
|
|
|
};
|
2024-12-21 23:34:10 -05:00
|
|
|
|
|
|
|
# For accurate stack trace
|
|
|
|
_file = ./default.nix;
|
2024-12-16 17:44:17 -05:00
|
|
|
}
|