about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/languages-frameworks/python.md2
-rw-r--r--pkgs/top-level/python-packages.nix17
2 files changed, 18 insertions, 1 deletions
diff --git a/doc/languages-frameworks/python.md b/doc/languages-frameworks/python.md
index b854641dd32e0..f9a8f38af3db4 100644
--- a/doc/languages-frameworks/python.md
+++ b/doc/languages-frameworks/python.md
@@ -422,7 +422,7 @@ exists.
 
 #### Missing `tkinter` module standard library
 
-To reduce closure size the `Tkinter`/`tkinter` module is available as `python.tkinter`.
+To reduce closure size the `Tkinter`/`tkinter` is put in a separate output. The `tkinter` is available as `python35Packages.tkinter`.
 
 #### Attributes on interpreters packages
 
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 47eb2399ec849..2fec8b50f0ebb 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -24655,6 +24655,23 @@ in {
     };
   };
 
+  # Tkinter/tkinter is part of the Python standard library.
+  # To reduce closure size its put in a separate output, `python.tkinter`.
+  # This alias was added to make this output work like any other Python package.
+  tkinter = mkPythonDerivation rec {
+    name = "tkinter-${python.version}";
+    src = python.tkinter;
+
+    disabled = isPy26 || isPyPy;
+
+    installPhase = ''
+      mkdir -p $out
+      cp -R ${python.tkinter}/* $out
+    '';
+
+    inherit (python) meta;
+  };
+
   tlslite = buildPythonPackage rec {
     name = "tlslite-${version}";
     version = "0.4.8";