28 lines
596 B
Nix
28 lines
596 B
Nix
{ pkgs ? import <nixpkgs> {}, python ? pkgs.python3, ... }:
|
|
|
|
let
|
|
python-packages = ps: with ps; [
|
|
pip
|
|
setuptools
|
|
wheel
|
|
];
|
|
in
|
|
pkgs.mkShell {
|
|
nativeBuildInputs = with pkgs; [
|
|
(python.withPackages python-packages)
|
|
poetry
|
|
git
|
|
zlib
|
|
libgccjit
|
|
glibc
|
|
glibc_multi
|
|
];
|
|
|
|
shellHook = ''
|
|
export LD_LIBRARY_PATH="${pkgs.glibc}/lib:${pkgs.glibc_multi}/lib:${pkgs.zlib}/lib:${pkgs.libgccjit}/lib"
|
|
[ ! -f "pyproject.toml" ] && poetry init -n
|
|
poetry env use "$(command -v ${python}/bin/python)"
|
|
[ -d "./.venv" ] && source .venv/bin/activate
|
|
'';
|
|
}
|