2020-01-12 23:11:02 -08:00
|
|
|
# modules/dev/python.nix --- https://godotengine.org/
|
|
|
|
#
|
|
|
|
# Python's ecosystem repulses me. The list of environment "managers" exhausts
|
|
|
|
# me. The Py2->3 transition make trainwrecks jealous. But SciPy, NumPy, iPython
|
|
|
|
# and Jupyter can have my babies. Every single one.
|
2020-01-12 16:47:33 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
{ config, options, lib, pkgs, my, ... }:
|
|
|
|
|
2020-04-06 20:04:29 -07:00
|
|
|
with lib;
|
2020-10-01 15:46:04 -07:00
|
|
|
with lib.my;
|
|
|
|
let cfg = config.modules.dev.python;
|
|
|
|
in {
|
2020-04-06 20:04:29 -07:00
|
|
|
options.modules.dev.python = {
|
2020-10-01 15:46:04 -07:00
|
|
|
enable = mkBoolOpt false;
|
2021-08-05 22:30:07 -07:00
|
|
|
enableGlobally = mkBoolOpt false;
|
2020-04-06 20:04:29 -07:00
|
|
|
};
|
|
|
|
|
2021-08-05 22:30:07 -07:00
|
|
|
config = mkIf cfg.enable (mkMerge [
|
|
|
|
(mkIf cfg.enableGlobally {
|
|
|
|
user.packages = with pkgs; [
|
|
|
|
python37
|
|
|
|
python37Packages.pip
|
|
|
|
python37Packages.ipython
|
|
|
|
python37Packages.black
|
|
|
|
python37Packages.setuptools
|
|
|
|
python37Packages.pylint
|
|
|
|
python37Packages.poetry
|
|
|
|
];
|
2020-01-12 16:47:33 -08:00
|
|
|
|
2021-08-05 22:30:07 -07:00
|
|
|
environment.shellAliases = {
|
|
|
|
py = "python";
|
|
|
|
py2 = "python2";
|
|
|
|
py3 = "python3";
|
|
|
|
po = "poetry";
|
|
|
|
ipy = "ipython --no-banner";
|
|
|
|
ipylab = "ipython --pylab=qt5 --no-banner";
|
|
|
|
};
|
|
|
|
})
|
2020-01-12 16:47:33 -08:00
|
|
|
|
2021-08-05 22:30:07 -07:00
|
|
|
{
|
|
|
|
env.IPYTHONDIR = "$XDG_CONFIG_HOME/ipython";
|
|
|
|
env.PIP_CONFIG_FILE = "$XDG_CONFIG_HOME/pip/pip.conf";
|
|
|
|
env.PIP_LOG_FILE = "$XDG_DATA_HOME/pip/log";
|
|
|
|
env.PYLINTHOME = "$XDG_DATA_HOME/pylint";
|
|
|
|
env.PYLINTRC = "$XDG_CONFIG_HOME/pylint/pylintrc";
|
|
|
|
env.PYTHONSTARTUP = "$XDG_CONFIG_HOME/python/pythonrc";
|
|
|
|
env.PYTHON_EGG_CACHE = "$XDG_CACHE_HOME/python-eggs";
|
|
|
|
env.JUPYTER_CONFIG_DIR = "$XDG_CONFIG_HOME/jupyter";
|
|
|
|
}
|
|
|
|
]);
|
2020-01-12 16:47:33 -08:00
|
|
|
}
|