nixos/templates/python.nix

24 lines
419 B
Nix
Raw Normal View History

{ pkgs ? import <nixpkgs> {}, python ? pkgs.python39, ... }:
let
python-packages = ps: with ps; [
pip
setuptools
wheel
];
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
(python.withPackages python-packages)
git
zlib
libgccjit
];
shellHook = ''
export LD_LIBRARY_PATH="${pkgs.zlib}/lib:${pkgs.libgccjit}/lib"
python -m venv .venv
source .venv/bin/activate
'';
}