develop#python: init profile
This commit is contained in:
parent
a53bd30aac
commit
4c79faac59
@ -1,4 +1,6 @@
|
|||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
|
imports = [ ../python ];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
cquery
|
cquery
|
||||||
kak-lsp
|
kak-lsp
|
||||||
@ -6,7 +8,6 @@
|
|||||||
kakoune-unwrapped
|
kakoune-unwrapped
|
||||||
nixfmt
|
nixfmt
|
||||||
python3Packages.python-language-server
|
python3Packages.python-language-server
|
||||||
python3
|
|
||||||
rustup
|
rustup
|
||||||
];
|
];
|
||||||
|
|
||||||
|
33
profiles/develop/python/default.nix
Normal file
33
profiles/develop/python/default.nix
Normal 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}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user