python: Move to separate file
This commit is contained in:
parent
83b38ddf61
commit
8f370c5040
5 changed files with 56 additions and 42 deletions
56
hm/dev/python.nix
Normal file
56
hm/dev/python.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
config = lib.mkIf config.frogeye.dev.python {
|
||||
frogeye = {
|
||||
shellAliases = {
|
||||
ipython = "ipython --no-confirm-exit --pdb";
|
||||
};
|
||||
};
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
python3
|
||||
python3Packages.ipython
|
||||
];
|
||||
sessionVariables = {
|
||||
PYTHONSTARTUP = "${config.xdg.configHome}/pythonstartup.py";
|
||||
};
|
||||
};
|
||||
programs.nixvim.plugins.lsp.servers.pylsp = {
|
||||
# Python
|
||||
enable = config.frogeye.dev.python;
|
||||
settings.plugins = {
|
||||
black.enabled = true;
|
||||
flake8 = {
|
||||
enabled = true;
|
||||
maxLineLength = 88; # Compatibility with Black
|
||||
};
|
||||
isort.enabled = true;
|
||||
mccabe.enabled = true;
|
||||
pycodestyle = {
|
||||
enabled = true;
|
||||
maxLineLength = 88; # Compatibility with Black
|
||||
};
|
||||
pyflakes.enabled = true;
|
||||
pylint.enabled = true;
|
||||
pylsp_mypy = {
|
||||
enabled = true;
|
||||
overrides = [
|
||||
"--cache-dir=${config.xdg.cacheHome}/mypy"
|
||||
"--ignore-missing-imports"
|
||||
"--disallow-untyped-defs"
|
||||
"--disallow-untyped-calls"
|
||||
"--disallow-incomplete-defs"
|
||||
"--disallow-untyped-decorators"
|
||||
true
|
||||
];
|
||||
};
|
||||
# TODO Could add some, could also remove some
|
||||
};
|
||||
};
|
||||
xdg.configFile = {
|
||||
"pythonstartup.py" = {
|
||||
text = (builtins.readFile ./pythonstartup.py);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue