-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧 Add shell.nix for reproductible dev environements
- Loading branch information
1 parent
f62eb2c
commit 0493c83
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
with import <nixpkgs> { }; | ||
|
||
let | ||
pythonPackages = python3Packages; | ||
in pkgs.mkShell rec { | ||
name = "localDevPythonEnv"; | ||
venvDir = "./.venv"; | ||
buildInputs = [ | ||
# A Python interpreter including the 'venv' module is required to bootstrap | ||
# the environment. | ||
pythonPackages.python | ||
|
||
# This executes some shell code to initialize a venv in $venvDir before | ||
# dropping into the shell | ||
pythonPackages.venvShellHook | ||
|
||
# Those are dependencies that we would like to use from nixpkgs, which will | ||
# add them to PYTHONPATH and thus make them accessible from within the venv. | ||
pythonPackages.numpy | ||
pythonPackages.networkx | ||
pythonPackages.matplotlib | ||
pythonPackages.seaborn | ||
pythonPackages.tqdm | ||
pythonPackages.pygame | ||
]; | ||
|
||
# Run this command, only after creating the virtual environment | ||
postVenvCreation = '' | ||
pip install -e '.[dev,gui,planning,gym]' | ||
''; | ||
|
||
# Now we can execute any commands within the virtual environment. | ||
# This is optional and can be left out to run pip manually. | ||
postShellHook = '' | ||
''; | ||
|
||
} |