18 lines
384 B
Nix
18 lines
384 B
Nix
{ pkgs ? import <nixpkgs> {} }:
|
|
pkgs.mkShell {
|
|
name = "python-environment";
|
|
buildInputs = with pkgs; [
|
|
python3
|
|
python3Packages.virtualenv
|
|
];
|
|
shellHook = ''
|
|
if [ ! -d .venv ]; then
|
|
python -m venv .venv
|
|
fi
|
|
source .venv/bin/activate
|
|
pip install --upgrade pip
|
|
if [ -s requirements.txt ]; then
|
|
pip install -r requirements.txt
|
|
fi
|
|
'';
|
|
}
|