nixos/templates/python39/shell.nix

9 lines
301 B
Nix
Raw Normal View History

{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
'';
}