shell-generate.nix
59 lines
| 1.2 KiB
| text/x-nix
|
NixLexer
/ pkgs / shell-generate.nix
r472 | { pkgs ? (import <nixpkgs> {}) | |||
, pythonPackages ? "python27Packages" | ||||
}: | ||||
with pkgs.lib; | ||||
r970 | let | |||
_pythonPackages = pythonPackages; | ||||
in | ||||
r472 | let | |||
pythonPackages = getAttr _pythonPackages pkgs; | ||||
pip2nix = import ./nix-common/pip2nix.nix { | ||||
inherit | ||||
pkgs | ||||
pythonPackages; | ||||
}; | ||||
in | ||||
pkgs.stdenv.mkDerivation { | ||||
name = "pip2nix-generated"; | ||||
r970 | ||||
r472 | buildInputs = [ | |||
r970 | # Allows to generate python packages | |||
r472 | pip2nix.pip2nix | |||
pythonPackages.pip-tools | ||||
r970 | # compile using ffi | |||
pkgs.libffi | ||||
r472 | pkgs.apr | |||
pkgs.aprutil | ||||
]; | ||||
shellHook = '' | ||||
runHook preShellHook | ||||
echo "Setting SVN_* variables" | ||||
export SVN_LIBRARY_PATH=${pkgs.subversion}/lib | ||||
export SVN_HEADER_PATH=${pkgs.subversion.dev}/include | ||||
runHook postShellHook | ||||
''; | ||||
preShellHook = '' | ||||
echo "Starting Generate Shell" | ||||
r970 | # set unpack source date to 1980 to fix ZIP problems that does not support <1980 | |||
export SOURCE_DATE_EPOCH=315532800 | ||||
export TMPDIR=/tmp | ||||
r971 | export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive" | |||
export LC_ALL="en_US.UTF-8" | ||||
r970 | ||||
r472 | # Custom prompt to distinguish from other dev envs. | |||
r970 | export PS1="\n\[\033[1;32m\][pip2nix-generate-shell]$\[\033[0m\] " | |||
export PYCURL_SSL_LIBRARY=openssl | ||||
r472 | ''; | |||
} | ||||