24 lines
467 B
Nix
24 lines
467 B
Nix
|
# shell.nix
|
||
|
{ pkgs ? import <nixpkgs> {} }:
|
||
|
|
||
|
pkgs.mkShell {
|
||
|
buildInputs = with pkgs; [
|
||
|
python312
|
||
|
python312Packages.pip
|
||
|
python312Packages.virtualenv
|
||
|
];
|
||
|
|
||
|
shellHook = ''
|
||
|
# Create and activate virtual environment
|
||
|
python -m venv .venv
|
||
|
source .venv/bin/activate
|
||
|
|
||
|
# Install requirements if they exist
|
||
|
if [ -f requirements.txt ]; then
|
||
|
pip install -r requirements.txt
|
||
|
fi
|
||
|
|
||
|
echo "Python virtual environment activated"
|
||
|
'';
|
||
|
}
|