diff --git a/templates/python39/shell.nix b/templates/python39/shell.nix new file mode 100644 index 00000000..a80de335 --- /dev/null +++ b/templates/python39/shell.nix @@ -0,0 +1,8 @@ +{pkgs ? import {}, ...}: +pkgs.mkShell { + nativeBuildInputs = with pkgs; [python39 poetry git]; + shellHook = '' + [ -e .venv/bin/python3 ] && VENV_FLAG="--upgrade" || VENV_FLAG="--clear"; python3 -m venv $VENV_FLAG .venv + [ -e .venv/bin/activate ] && source .venv/bin/activate + ''; +} diff --git a/templates/venv.nix b/templates/venv.nix deleted file mode 100644 index 5eda5735..00000000 --- a/templates/venv.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - pkgs ? import {}, - python ? pkgs.python39, - ... -}: -pkgs.mkShell { - nativeBuildInputs = with pkgs; [(python.withPackages (ps: with ps; [pip wheel])) poetry git]; - shellHook = '' - [ -d .venv ] || python -m venv .venv - source .venv/bin/activate - ''; -}