grimm-nixos-laptop/common/tooling/python.nix

46 lines
966 B
Nix
Raw Normal View History

2024-05-07 23:31:41 +02:00
{
pkgs,
config,
lib,
...
}:
let
2024-05-11 22:55:59 +02:00
inherit (config.grimmShared) enable tooling graphical;
pyLibs =
python-pkgs: with python-pkgs; [
requests
matplotlib
numpy
scipy
pygobject3
];
in
{
2024-05-11 22:55:59 +02:00
config = lib.mkIf (enable && tooling.enable) {
environment.systemPackages = [
(pkgs.python3.withPackages pyLibs)
] ++ lib.optionals graphical (with pkgs; [ jetbrains.pycharm-community ]);
2024-05-11 22:55:59 +02:00
programs.xonsh = {
enable = true;
config = lib.concatLines (
lib.mapAttrsToList (
2024-05-15 23:24:35 +02:00
name: value: "aliases[\"${name}\"] = '''${value}'''"
2024-05-11 22:55:59 +02:00
) config.environment.shellAliases
);
2024-05-17 12:18:20 +02:00
# package = pkgs.xonsh.wrapper.override { extraPackages = pyLibs; };
};
2024-05-15 23:24:35 +02:00
grimmShared.tooling.lang_servers = [
{
lsp.package = pkgs.pyright;
fmt = {
package = pkgs.yapf;
includes = [ "*.py" ];
options = [ "-i" ];
};
}
];
2024-05-11 22:55:59 +02:00
};
}