migrating dev environments to output
This commit is contained in:
@@ -4,34 +4,54 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
python = pkgs.python3.withPackages (
|
||||
ps:
|
||||
builtins.attrValues {
|
||||
inherit (ps)
|
||||
black # Python code formatter
|
||||
editorconfig # follow rules of contributin
|
||||
flake8 # wraper for pyflakes, pycodestyle and mccabe
|
||||
isort # sort Python imports
|
||||
pyflakes # checks source code for errors
|
||||
pylint # bug and style checker for python
|
||||
pytest # tests
|
||||
speedtest-cli # check internet speed from the comand line
|
||||
;
|
||||
}
|
||||
);
|
||||
packages =
|
||||
[ python ]
|
||||
++ builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
pipenv # python development workflow for humans
|
||||
pyright # LSP
|
||||
;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.my.dev.python.enable = lib.mkEnableOption "enable";
|
||||
config = lib.mkIf config.my.dev.python.enable {
|
||||
home-manager.users.jawz.xdg.configFile."python/pythonrc".source = ../../dotfiles/pythonrc;
|
||||
environment.variables.PYTHONSTARTUP = "\${XDG_CONFIG_HOME}/python/pythonrc";
|
||||
users.users.jawz.packages =
|
||||
builtins.attrValues {
|
||||
inherit (pkgs)
|
||||
pipenv # python development workflow for humans
|
||||
pyright # LSP
|
||||
;
|
||||
}
|
||||
++ [
|
||||
(pkgs.python3.withPackages (
|
||||
ps:
|
||||
builtins.attrValues {
|
||||
inherit (ps)
|
||||
black # Python code formatter
|
||||
editorconfig # follow rules of contributin
|
||||
flake8 # wraper for pyflakes, pycodestyle and mccabe
|
||||
isort # sort Python imports
|
||||
pyflakes # checks source code for errors
|
||||
pylint # bug and style checker for python
|
||||
pytest # tests
|
||||
speedtest-cli # check internet speed from the comand line
|
||||
;
|
||||
}
|
||||
))
|
||||
];
|
||||
options = {
|
||||
my.dev.python.enable = lib.mkEnableOption "Install Python tools globally";
|
||||
devShells.python = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.mkShell {
|
||||
inherit packages;
|
||||
name = "python-dev-shell";
|
||||
shellHook = ''
|
||||
echo "🐍 Python dev environment"
|
||||
which python
|
||||
'';
|
||||
description = "Python development shell";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.my.dev.python.enable {
|
||||
users.users.jawz.packages = packages;
|
||||
})
|
||||
{
|
||||
home-manager.users.jawz.xdg.configFile."python/pythonrc".source = ../../dotfiles/pythonrc;
|
||||
environment.variables.PYTHONSTARTUP = "\${XDG_CONFIG_HOME}/python/pythonrc";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user