move default.nix to shell.nix
This commit is contained in:
parent
b2e0bda97e
commit
e26c68f285
2 changed files with 7 additions and 11 deletions
18
python_environment/shell.nix
Normal file
18
python_environment/shell.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ 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
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue