Skip to content

Commit

Permalink
🔧 Add shell.nix for reproductible dev environements
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisFederico committed Aug 19, 2024
1 parent f62eb2c commit 0493c83
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions shell.nix
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 = ''
'';

}

0 comments on commit 0493c83

Please sign in to comment.