Created
January 11, 2021 16:08
-
-
Save GuillaumeDesforges/d2da062c0e3d627471c503a28623fc66 to your computer and use it in GitHub Desktop.
A simple Nix shell to use a Python environment using pip (convenient for NixOS workstations)
This file contains hidden or 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
| let | |
| pkgs = import <nixpkgs> {}; | |
| python-env = pkgs.python38.withPackages (pp: with pp; [ pip wheel cython ]); | |
| in | |
| pkgs.mkShell { | |
| buildInputs = [ | |
| python-env | |
| ]; | |
| shellHook = '' | |
| [[ -d .venv ]] || python -m venv .venv | |
| source .venv/bin/activate | |
| ''; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment