Skip to content

Instantly share code, notes, and snippets.

@mmai
Created October 28, 2019 09:17
Show Gist options
  • Save mmai/1ee7356c7418c2a1f5741f9c2e973a85 to your computer and use it in GitHub Desktop.
Save mmai/1ee7356c7418c2a1f5741f9c2e973a85 to your computer and use it in GitHub Desktop.
Creates a nix-shell environnement for installing apps using pip install
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "random-project";
buildInputs = [
python
python37Packages.virtualenv
];
env = buildEnv { name = name; paths = buildInputs; };
shellHook = ''
export SOURCE_DATE_EPOCH=315532800
virtualenv .env
source .env/bin/activate
pip install -r requirements.txt
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment