Add separate python venv template

This commit is contained in:
Evie Litherland-Smith 2023-04-04 09:48:40 +01:00
parent 49643683d4
commit df08ddf5bf
2 changed files with 24 additions and 3 deletions

View file

@ -17,8 +17,5 @@ pkgs.mkShell {
shellHook = '' shellHook = ''
export LD_LIBRARY_PATH="${pkgs.zlib}/lib:${pkgs.libgccjit}/lib" export LD_LIBRARY_PATH="${pkgs.zlib}/lib:${pkgs.libgccjit}/lib"
python -m venv .venv
source .venv/bin/activate
pip list --outdated | grep -iE "^(pip|wheel)" > /dev/null && python -m pip install --upgrade pip wheel
''; '';
} }

24
templates/venv.nix Normal file
View file

@ -0,0 +1,24 @@
{ 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
pip list --outdated | grep -iE "^(pip|wheel)" > /dev/null && python -m pip install --upgrade pip wheel
'';
}