Skip to content

Commit

Permalink
nix-shell: add shell.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
herbetom committed Oct 2, 2021
1 parent 4fd2e3e commit 6a90ff3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
with import <nixpkgs> { };

let
pythonPackages = python3Packages;
in pkgs.mkShell rec {
name = "impurePythonEnv";
venvDir = "./venv";
buildInputs = [
git
lsb-release
ethtool

# A Python interpreter including the 'venv' module is required to bootstrap
# the environment.
pythonPackages.python

# This execute some shell code to initialize a venv in $venvDir before
# dropping into the shell
pythonPackages.venvShellHook

];

# Run this command, only after creating the virtual environment
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
pip install -r requirements.txt
'';

# Now we can execute any commands within the virtual environment.
# This is optional and can be left out to run pip manually.
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
'';

}

0 comments on commit 6a90ff3

Please sign in to comment.