develop#python: init profile

This commit is contained in:
Timothy DeHerrera 2020-01-31 09:49:47 -07:00
parent a53bd30aac
commit 4c79faac59
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122
2 changed files with 35 additions and 1 deletions

View file

@ -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
];

View file

@ -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}";
};
}