diff --git a/pkgs/development/python-modules/offline-distutils/default.nix b/pkgs/development/python-modules/offline-distutils/default.nix new file mode 100644 index 000000000000..2ed41b08bb71 --- /dev/null +++ b/pkgs/development/python-modules/offline-distutils/default.nix @@ -0,0 +1,21 @@ +# Used during module installation to prevent easy_install and python +# setup.py install/test from downloading + +{ stdenv, python }: + +stdenv.mkDerivation { + name = "python-offline-distutils-${python.version}"; + + buildInputs = [ python ]; + + unpackPhase = "true"; + installPhase = '' + dst="$out/lib/${python.libPrefix}" + ensureDir $dst/distutils + ln -s ${python}/lib/${python.libPrefix}/distutils/* $dst/distutils/ + cat < $dst/distutils/distutils.cfg +[easy_install] +allow-hosts = None +EOF + ''; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 761f63d4be6d..318ce39022e2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -18,6 +18,10 @@ let pythonPackages = python.modules // rec { inherit python wrapPython; }; + offlineDistutils = import ../development/python-modules/offline-distutils { + inherit (pkgs) stdenv; + inherit python; + }; ipython = import ../shells/ipython { inherit (pkgs) stdenv fetchurl;