Add separate python venv template
This commit is contained in:
parent
49643683d4
commit
df08ddf5bf
|
@ -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
24
templates/venv.nix
Normal 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
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue