blob: fea30545e558ce5d641be762481e800a03bac159 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
{ config, pkgs, lib, ... }:
let
cfg = config.my.home.python;
pythonEnv = pkgs.python310.withPackages (p: with p; [
black # format
isort # format
pylsp-mypy # language server protocol
requests # HTTP library
types-requests # types for requests (for mypy)
pip # to install dependencies
ipython # nicer REPL
poetry # to install dependencies
]);
in
{
options.my.home.python = with lib; {
enable = mkEnableOption "python configuration";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs.python310Packages; [ pythonEnv ];
home.sessionVariables = with config.xdg; {
PIP_LOG = "${cacheHome}/pip/pip.log";
PYLINTHOME = "${cacheHome}/pylint";
PYTHON_EGG_CACHE = "${cacheHome}/python-eggs";
PYTHON_HISTFILE = "${cacheHome}/python_history";
};
};
}
|