Skip to content

Instantly share code, notes, and snippets.

@Thomashrb
Created February 22, 2018 23:56
Show Gist options
  • Save Thomashrb/4f28fb90461a385961719c812e0dfd17 to your computer and use it in GitHub Desktop.
Save Thomashrb/4f28fb90461a385961719c812e0dfd17 to your computer and use it in GitHub Desktop.
# http://datakurre.pandala.org/2015/10/nix-for-python-developers.html
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "env";
# Mandatory boilerplate for buildable env
env = buildEnv { name = name; paths = buildInputs; };
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup; ln -s $env $out
'';
# Customizable development requirements
buildInputs = [
# Add packages from nix-env -qaP | grep -i needle queries
redis
# With Python configuration requiring a special wrapper
(python35.buildEnv.override {
ignoreCollisions = true;
extraLibs = with python35Packages; [
# Add pythonPackages without the prefix
redis
tornado
];
})
];
# Customizable development shell setup with at last SSL certs set
shellHook = ''
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment