diff --git a/profiles/develop/kakoune/default.nix b/profiles/develop/kakoune/default.nix index e27ba3fd..a6350e48 100644 --- a/profiles/develop/kakoune/default.nix +++ b/profiles/develop/kakoune/default.nix @@ -1,4 +1,6 @@ { pkgs, ... }: { + imports = [ ../python ]; + environment.systemPackages = with pkgs; [ cquery kak-lsp @@ -6,7 +8,6 @@ kakoune-unwrapped nixfmt python3Packages.python-language-server - python3 rustup ]; diff --git a/profiles/develop/python/default.nix b/profiles/develop/python/default.nix new file mode 100644 index 00000000..2cd21f5f --- /dev/null +++ b/profiles/develop/python/default.nix @@ -0,0 +1,33 @@ +{ pkgs, ... }: +let inherit (pkgs) python3Packages; +in { + environment.systemPackages = let + packages = pythonPackages: + with pythonPackages; [ + numpy + pandas + ptpython + requests + scipy + ]; + + python = pkgs.python3.withPackages packages; + + in [ python ]; + environment.sessionVariables = { + PYTHONSTARTUP = let + startup = pkgs.writers.writePython3 "ptpython.py" { + libraries = [ python3Packages.ptpython ]; + } '' + import sys + try: + from ptpython.repl import embed + except ImportError: + print("ptpython is not available: falling back to standard prompt") + else: + sys.exit(embed(globals(), locals())) + ''; + in "${startup}"; + }; +} +