Skip to content

Instantly share code, notes, and snippets.

@Th0rgal
Last active September 2, 2022 07:08
Show Gist options
  • Save Th0rgal/4a44b635ab3639212662ad73f8f95a1e to your computer and use it in GitHub Desktop.
Save Th0rgal/4a44b635ab3639212662ad73f8f95a1e to your computer and use it in GitHub Desktop.
What binaries to install?
with import <nixpkgs> { };
let pythonPackages = python39Packages;
in pkgs.mkShell rec {
name = "impurePythonEnv";
venvDir = "./env";
buildInputs = [
# 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
# required by fastecdsa
gmp
];
# 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
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment