Skip to content

Instantly share code, notes, and snippets.

@GuillaumeDesforges
Created January 11, 2021 16:08
Show Gist options
  • Select an option

  • Save GuillaumeDesforges/d2da062c0e3d627471c503a28623fc66 to your computer and use it in GitHub Desktop.

Select an option

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)
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