nixos/templates/python39/shell.nix
Evie Litherland-Smith 1805e26cc1 Update python venv template to be more robust
Move template into python39 folder in case I add more in the future
2023-05-18 09:36:17 +01:00

9 lines
301 B
Nix

{pkgs ? import <nixpkgs> {}, ...}:
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
'';
}