summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/services/x11/desktop-managers/kde5.nix389
-rw-r--r--pkgs/applications/editors/kile/frameworks.nix3
-rw-r--r--pkgs/applications/misc/yakuake/3.0.nix4
-rw-r--r--pkgs/applications/networking/irc/konversation/1.6.nix3
-rw-r--r--pkgs/desktops/kde-5/applications/ark/default.nix3
-rw-r--r--pkgs/desktops/kde-5/applications/dolphin.nix3
-rw-r--r--pkgs/desktops/kde-5/applications/filelight.nix5
-rw-r--r--pkgs/desktops/kde-5/applications/gwenview.nix3
-rw-r--r--pkgs/desktops/kde-5/applications/kate.nix3
-rw-r--r--pkgs/desktops/kde-5/applications/kcalc.nix5
-rw-r--r--pkgs/desktops/kde-5/applications/kcolorchooser.nix5
-rw-r--r--pkgs/desktops/kde-5/applications/kdenlive.nix3
-rw-r--r--pkgs/desktops/kde-5/applications/kdf.nix5
-rw-r--r--pkgs/desktops/kde-5/applications/khelpcenter.nix5
-rw-r--r--pkgs/desktops/kde-5/applications/kompare.nix5
-rw-r--r--pkgs/desktops/kde-5/applications/konsole.nix5
-rw-r--r--pkgs/desktops/kde-5/applications/kwalletmanager.nix3
-rw-r--r--pkgs/desktops/kde-5/applications/marble.nix3
-rw-r--r--pkgs/desktops/kde-5/applications/okular.nix3
-rw-r--r--pkgs/desktops/kde-5/applications/spectacle.nix3
-rw-r--r--pkgs/desktops/kde-5/plasma/oxygen.nix3
-rw-r--r--pkgs/development/compilers/emscripten-fastcomp/default.nix48
-rw-r--r--pkgs/development/compilers/emscripten/default.nix8
-rw-r--r--pkgs/development/compilers/ghc/head.nix21
-rw-r--r--pkgs/development/compilers/ghc/nokinds.nix83
-rw-r--r--pkgs/development/compilers/rust/nightlyBin.nix36
-rw-r--r--pkgs/development/haskell-modules/configuration-ghc-nokinds.nix102
-rw-r--r--pkgs/development/libraries/kde-frameworks/kde-wrapper.nix80
-rw-r--r--pkgs/tools/misc/kronometer/default.nix3
-rw-r--r--pkgs/tools/misc/peruse/default.nix3
-rw-r--r--pkgs/tools/networking/curl/default.nix6
-rw-r--r--pkgs/tools/networking/curl/fix-http2-window-size.patch88
-rw-r--r--pkgs/top-level/all-packages.nix20
-rw-r--r--pkgs/top-level/haskell-packages.nix9
34 files changed, 409 insertions, 562 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix
index 9b51b92faa4d..de5bfe263d49 100644
--- a/nixos/modules/services/x11/desktop-managers/kde5.nix
+++ b/nixos/modules/services/x11/desktop-managers/kde5.nix
@@ -31,204 +31,223 @@ in
         '';
       };
 
+      extraPackages = mkOption {
+        type = types.listOf types.package;
+        default = [];
+        description = ''
+          KDE packages that need to be installed system-wide.
+        '';
+      };
+
     };
 
   };
 
 
-  config = mkIf (xcfg.enable && cfg.enable) {
+  config = mkMerge [
+    (mkIf (cfg.extraPackages != []) {
+      environment.systemPackages = [ (kde5.kdeWrapper cfg.extraPackages) ];
+    })
 
-    warnings = optional config.services.xserver.desktopManager.kde4.enable
-      "KDE 4 should not be enabled at the same time as KDE 5";
+    (mkIf (xcfg.enable && cfg.enable) {
 
-    services.xserver.desktopManager.session = singleton {
-      name = "kde5";
-      bgSupport = true;
-      start = ''
-        # Load PulseAudio module for routing support.
-        # See http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
-        ${optionalString config.hardware.pulseaudio.enable ''
-          ${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
-        ''}
+      warnings = optional config.services.xserver.desktopManager.kde4.enable
+        "KDE 4 should not be enabled at the same time as KDE 5";
 
-        exec "${kde5.startkde}"
+      services.xserver.desktopManager.session = singleton {
+        name = "kde5";
+        bgSupport = true;
+        start = ''
+          # Load PulseAudio module for routing support.
+          # See http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
+          ${optionalString config.hardware.pulseaudio.enable ''
+            ${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
+          ''}
 
-      '';
-    };
+          exec "${kde5.startkde}"
 
-    security.setuidOwners = [
-      {
-        program = "kcheckpass";
-        source = "${kde5.plasma-workspace.out}/lib/libexec/kcheckpass";
-        owner = "root";
-        setuid = true;
-      }
-      {
-        program = "start_kdeinit";
-        source = "${kde5.kinit.out}/lib/libexec/kf5/start_kdeinit";
-        owner = "root";
-        setuid = true;
-      }
-    ];
-
-    environment.systemPackages =
-      [
-        kde5.frameworkintegration
-        kde5.kactivities
-        kde5.kauth
-        kde5.kcmutils
-        kde5.kconfig
-        kde5.kconfigwidgets
-        kde5.kcoreaddons
-        kde5.kdbusaddons
-        kde5.kdeclarative
-        kde5.kded
-        kde5.kdesu
-        kde5.kdnssd
-        kde5.kemoticons
-        kde5.kfilemetadata
-        kde5.kglobalaccel
-        kde5.kguiaddons
-        kde5.kiconthemes
-        kde5.kidletime
-        kde5.kimageformats
-        kde5.kinit
-        kde5.kio
-        kde5.kjobwidgets
-        kde5.knewstuff
-        kde5.knotifications
-        kde5.knotifyconfig
-        kde5.kpackage
-        kde5.kparts
-        kde5.kpeople
-        kde5.krunner
-        kde5.kservice
-        kde5.ktextwidgets
-        kde5.kwallet
-        kde5.kwayland
-        kde5.kwidgetsaddons
-        kde5.kxmlgui
-        kde5.kxmlrpcclient
-        kde5.plasma-framework
-        kde5.solid
-        kde5.sonnet
-        kde5.threadweaver
-
-        kde5.breeze-qt5
-        kde5.kactivitymanagerd
-        kde5.kde-cli-tools
-        kde5.kdecoration
-        kde5.kdeplasma-addons
-        kde5.kgamma5
-        kde5.khelpcenter
-        kde5.khotkeys
-        kde5.kinfocenter
-        kde5.kmenuedit
-        kde5.kscreen
-        kde5.kscreenlocker
-        kde5.ksysguard
-        kde5.kwayland
-        kde5.kwin
-        kde5.kwrited
-        kde5.libkscreen
-        kde5.libksysguard
-        kde5.milou
-        kde5.oxygen
-        kde5.plasma-integration
-        kde5.polkit-kde-agent
-        kde5.systemsettings
-
-        kde5.plasma-desktop
-        kde5.plasma-workspace
-        kde5.plasma-workspace-wallpapers
-
-        kde5.dolphin
-        kde5.dolphin-plugins
-        kde5.ffmpegthumbs
-        kde5.kdegraphics-thumbnailers
-        kde5.kio-extras
-        kde5.konsole
-        kde5.print-manager
-
-        # Install Breeze icons if available
-        (kde5.breeze-icons or kde5.oxygen-icons5 or kde5.oxygen-icons)
-        pkgs.hicolor_icon_theme
-
-        kde5.kde-gtk-config kde5.breeze-gtk
-
-        pkgs.qt5.phonon-backend-gstreamer
-      ]
-
-      # Plasma 5.5 and later has a Breeze GTK theme.
-      # If it is not available, Orion is very similar to Breeze.
-      ++ lib.optional (!(lib.hasAttr "breeze-gtk" kde5)) pkgs.orion
-
-      # Install activity manager if available
-      ++ lib.optional (lib.hasAttr "kactivitymanagerd" kde5) kde5.kactivitymanagerd
-
-      # frameworkintegration was split with plasma-integration in Plasma 5.6
-      ++ lib.optional (lib.hasAttr "plasma-integration" kde5) kde5.plasma-integration
-
-      ++ lib.optionals cfg.enableQt4Support [ kde5.breeze-qt4 pkgs.phonon-backend-gstreamer ]
-
-      # Optional hardware support features
-      ++ lib.optional config.hardware.bluetooth.enable kde5.bluedevil
-      ++ lib.optional config.networking.networkmanager.enable kde5.plasma-nm
-      ++ lib.optional config.hardware.pulseaudio.enable kde5.plasma-pa
-      ++ lib.optional config.powerManagement.enable kde5.powerdevil
-      ++ lib.optional config.services.colord.enable pkgs.colord-kde
-      ++ lib.optionals config.services.samba.enable [ kde5.kdenetwork-filesharing pkgs.samba ];
-
-    environment.pathsToLink = [ "/share" ];
-
-    environment.etc = singleton {
-      source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
-      target = "X11/xkb";
-    };
+        '';
+      };
 
-    # Enable GTK applications to load SVG icons
-    environment.variables =
-      {
-        GST_PLUGIN_SYSTEM_PATH_1_0 =
-          lib.makeSearchPath "/lib/gstreamer-1.0"
-          (builtins.map (pkg: pkg.out) (with pkgs.gst_all_1; [
-            gstreamer
-            gst-plugins-base
-            gst-plugins-good
-            gst-plugins-ugly
-            gst-plugins-bad
-            gst-libav # for mp3 playback
-          ]));
-      }
-      // (if (lib.hasAttr "breeze-icons" kde5)
-          then { GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; }
-          else { });
-
-    fonts.fonts = [ (kde5.oxygen-fonts or pkgs.noto-fonts) ];
-
-    programs.ssh.askPassword = "${kde5.ksshaskpass.out}/bin/ksshaskpass";
-
-    # Enable helpful DBus services.
-    services.udisks2.enable = true;
-    services.upower.enable = config.powerManagement.enable;
-
-    # Extra UDEV rules used by Solid
-    services.udev.packages = [
-      pkgs.libmtp
-      pkgs.media-player-info
-    ];
-
-    services.xserver.displayManager.sddm = {
-      theme = "breeze";
-      themes = [
-        kde5.ecm # for the setup-hook
-        kde5.plasma-workspace
-        kde5.breeze-icons
+      security.setuidOwners = [
+        {
+          program = "kcheckpass";
+          source = "${kde5.plasma-workspace.out}/lib/libexec/kcheckpass";
+          owner = "root";
+          setuid = true;
+        }
+        {
+          program = "start_kdeinit";
+          source = "${kde5.kinit.out}/lib/libexec/kf5/start_kdeinit";
+          owner = "root";
+          setuid = true;
+        }
       ];
-    };
 
-    security.pam.services.kde = { allowNullPassword = true; };
+      environment.systemPackages =
+        [
+          kde5.frameworkintegration
+          kde5.kactivities
+          kde5.kauth
+          kde5.kcmutils
+          kde5.kconfig
+          kde5.kconfigwidgets
+          kde5.kcoreaddons
+          kde5.kdbusaddons
+          kde5.kdeclarative
+          kde5.kded
+          kde5.kdesu
+          kde5.kdnssd
+          kde5.kemoticons
+          kde5.kfilemetadata
+          kde5.kglobalaccel
+          kde5.kguiaddons
+          kde5.kiconthemes
+          kde5.kidletime
+          kde5.kimageformats
+          kde5.kinit
+          kde5.kio
+          kde5.kjobwidgets
+          kde5.knewstuff
+          kde5.knotifications
+          kde5.knotifyconfig
+          kde5.kpackage
+          kde5.kparts
+          kde5.kpeople
+          kde5.krunner
+          kde5.kservice
+          kde5.ktextwidgets
+          kde5.kwallet
+          kde5.kwayland
+          kde5.kwidgetsaddons
+          kde5.kxmlgui
+          kde5.kxmlrpcclient
+          kde5.plasma-framework
+          kde5.solid
+          kde5.sonnet
+          kde5.threadweaver
+
+          kde5.breeze-qt5
+          kde5.kactivitymanagerd
+          kde5.kde-cli-tools
+          kde5.kdecoration
+          kde5.kdeplasma-addons
+          kde5.kgamma5
+          kde5.khotkeys
+          kde5.kinfocenter
+          kde5.kmenuedit
+          kde5.kscreen
+          kde5.kscreenlocker
+          kde5.ksysguard
+          kde5.kwayland
+          kde5.kwin
+          kde5.kwrited
+          kde5.libkscreen
+          kde5.libksysguard
+          kde5.milou
+          kde5.plasma-integration
+          kde5.polkit-kde-agent
+          kde5.systemsettings
+
+          kde5.plasma-desktop
+          kde5.plasma-workspace
+          kde5.plasma-workspace-wallpapers
+
+          kde5.dolphin-plugins
+          kde5.ffmpegthumbs
+          kde5.kdegraphics-thumbnailers
+          kde5.kio-extras
+          kde5.print-manager
+
+          # Install Breeze icons if available
+          (kde5.breeze-icons or kde5.oxygen-icons5 or kde5.oxygen-icons)
+          pkgs.hicolor_icon_theme
+
+          kde5.kde-gtk-config kde5.breeze-gtk
+
+          pkgs.qt5.phonon-backend-gstreamer
+        ]
+
+        # Plasma 5.5 and later has a Breeze GTK theme.
+        # If it is not available, Orion is very similar to Breeze.
+        ++ lib.optional (!(lib.hasAttr "breeze-gtk" kde5)) pkgs.orion
+
+        # Install activity manager if available
+        ++ lib.optional (lib.hasAttr "kactivitymanagerd" kde5) kde5.kactivitymanagerd
+
+        # frameworkintegration was split with plasma-integration in Plasma 5.6
+        ++ lib.optional (lib.hasAttr "plasma-integration" kde5) kde5.plasma-integration
+
+        ++ lib.optionals cfg.enableQt4Support [ kde5.breeze-qt4 pkgs.phonon-backend-gstreamer ]
+
+        # Optional hardware support features
+        ++ lib.optional config.hardware.bluetooth.enable kde5.bluedevil
+        ++ lib.optional config.networking.networkmanager.enable kde5.plasma-nm
+        ++ lib.optional config.hardware.pulseaudio.enable kde5.plasma-pa
+        ++ lib.optional config.powerManagement.enable kde5.powerdevil
+        ++ lib.optional config.services.colord.enable pkgs.colord-kde
+        ++ lib.optionals config.services.samba.enable [ kde5.kdenetwork-filesharing pkgs.samba ];
+
+      services.xserver.desktopManager.kde5.extraPackages =
+        [
+          kde5.khelpcenter
+          kde5.oxygen
+
+          kde5.dolphin
+          kde5.konsole
+        ];
+
+      environment.pathsToLink = [ "/share" ];
+
+      environment.etc = singleton {
+        source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
+        target = "X11/xkb";
+      };
 
-  };
+      environment.variables =
+        {
+          # Enable GTK applications to load SVG icons
+          GST_PLUGIN_SYSTEM_PATH_1_0 =
+            lib.makeSearchPath "/lib/gstreamer-1.0"
+            (builtins.map (pkg: pkg.out) (with pkgs.gst_all_1; [
+              gstreamer
+              gst-plugins-base
+              gst-plugins-good
+              gst-plugins-ugly
+              gst-plugins-bad
+              gst-libav # for mp3 playback
+            ]));
+        }
+        // (if (lib.hasAttr "breeze-icons" kde5)
+            then { GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; }
+            else { });
+
+      fonts.fonts = [ (kde5.oxygen-fonts or pkgs.noto-fonts) ];
+
+      programs.ssh.askPassword = "${kde5.ksshaskpass.out}/bin/ksshaskpass";
+
+      # Enable helpful DBus services.
+      services.udisks2.enable = true;
+      services.upower.enable = config.powerManagement.enable;
+
+      # Extra UDEV rules used by Solid
+      services.udev.packages = [
+        pkgs.libmtp
+        pkgs.media-player-info
+      ];
+
+      services.xserver.displayManager.sddm = {
+        theme = "breeze";
+        themes = [
+          kde5.ecm # for the setup-hook
+          kde5.plasma-workspace
+          kde5.breeze-icons
+        ];
+      };
+
+      security.pam.services.kde = { allowNullPassword = true; };
+
+    })
+  ];
 
 }
diff --git a/pkgs/applications/editors/kile/frameworks.nix b/pkgs/applications/editors/kile/frameworks.nix
index 7a02c3d3f8c6..34ea76478937 100644
--- a/pkgs/applications/editors/kile/frameworks.nix
+++ b/pkgs/applications/editors/kile/frameworks.nix
@@ -60,8 +60,9 @@ let
       };
     };
 in
-kdeWrapper unwrapped
+kdeWrapper
 {
+  inherit unwrapped;
   targets = [ "bin/kile" ];
   paths = [ konsole.unwrapped ];
 }
diff --git a/pkgs/applications/misc/yakuake/3.0.nix b/pkgs/applications/misc/yakuake/3.0.nix
index 4ccef7f435a4..8bce26deefc3 100644
--- a/pkgs/applications/misc/yakuake/3.0.nix
+++ b/pkgs/applications/misc/yakuake/3.0.nix
@@ -55,9 +55,9 @@ let
 
 
 in
-kdeWrapper unwrapped
+kdeWrapper
 {
+  inherit unwrapped;
   targets = [ "bin/yakuake" ];
   paths = [ konsole.unwrapped ];
 }
-
diff --git a/pkgs/applications/networking/irc/konversation/1.6.nix b/pkgs/applications/networking/irc/konversation/1.6.nix
index c68764054627..9724ae5f4bf0 100644
--- a/pkgs/applications/networking/irc/konversation/1.6.nix
+++ b/pkgs/applications/networking/irc/konversation/1.6.nix
@@ -75,7 +75,8 @@ let
       homepage = https://konversation.kde.org;
     };
   };
-in kdeWrapper unwrapped {
+in kdeWrapper {
+  inherit unwrapped;
   targets = [ "bin/konversation" ];
 }
 
diff --git a/pkgs/desktops/kde-5/applications/ark/default.nix b/pkgs/desktops/kde-5/applications/ark/default.nix
index 249027570663..6b471614f5a6 100644
--- a/pkgs/desktops/kde-5/applications/ark/default.nix
+++ b/pkgs/desktops/kde-5/applications/ark/default.nix
@@ -36,7 +36,8 @@ let
       };
     };
 in
-kdeWrapper unwrapped
+kdeWrapper
 {
+  inherit unwrapped;
   targets = [ "bin/ark" ];
 }
diff --git a/pkgs/desktops/kde-5/applications/dolphin.nix b/pkgs/desktops/kde-5/applications/dolphin.nix
index 4e636ae31863..9be40e9439b6 100644
--- a/pkgs/desktops/kde-5/applications/dolphin.nix
+++ b/pkgs/desktops/kde-5/applications/dolphin.nix
@@ -24,8 +24,9 @@ let
       ];
     };
 in
-kdeWrapper unwrapped
+kdeWrapper
 {
+  inherit unwrapped;
   targets = [ "bin/dolphin" ];
   paths = [ dolphin-plugins konsole.unwrapped ];
 }
diff --git a/pkgs/desktops/kde-5/applications/filelight.nix b/pkgs/desktops/kde-5/applications/filelight.nix
index acc5808b4a34..e3d9172145c8 100644
--- a/pkgs/desktops/kde-5/applications/filelight.nix
+++ b/pkgs/desktops/kde-5/applications/filelight.nix
@@ -18,4 +18,7 @@ let
       ];
     };
 in
-kdeWrapper unwrapped { targets = [ "bin/filelight" ]; }
+kdeWrapper {
+  inherit unwrapped;
+  targets = [ "bin/filelight" ];
+}
diff --git a/pkgs/desktops/kde-5/applications/gwenview.nix b/pkgs/desktops/kde-5/applications/gwenview.nix
index 18f5036127d0..b97e4ce3bd6e 100644
--- a/pkgs/desktops/kde-5/applications/gwenview.nix
+++ b/pkgs/desktops/kde-5/applications/gwenview.nix
@@ -20,7 +20,8 @@ let
       ];
     };
 in
-kdeWrapper unwrapped {
+kdeWrapper {
+  inherit unwrapped;
   targets = [ "bin/gwenview" ];
   paths = [ kipi-plugins ];
 }
diff --git a/pkgs/desktops/kde-5/applications/kate.nix b/pkgs/desktops/kde-5/applications/kate.nix
index ab0087930c01..03cc0e1fe33b 100644
--- a/pkgs/desktops/kde-5/applications/kate.nix
+++ b/pkgs/desktops/kde-5/applications/kate.nix
@@ -24,8 +24,9 @@ let
       ];
     };
 in
-kdeWrapper unwrapped
+kdeWrapper
 {
+  inherit unwrapped;
   targets = [ "bin/kate" "bin/kwrite" ];
   paths = [ konsole.unwrapped ];
 }
diff --git a/pkgs/desktops/kde-5/applications/kcalc.nix b/pkgs/desktops/kde-5/applications/kcalc.nix
index f6d87e3e6e97..10164692f770 100644
--- a/pkgs/desktops/kde-5/applications/kcalc.nix
+++ b/pkgs/desktops/kde-5/applications/kcalc.nix
@@ -18,4 +18,7 @@ let
       ];
     };
 in
-kdeWrapper unwrapped { targets = [ "bin/kcalc" ]; }
+kdeWrapper {
+  inherit unwrapped;
+  targets = [ "bin/kcalc" ];
+}
diff --git a/pkgs/desktops/kde-5/applications/kcolorchooser.nix b/pkgs/desktops/kde-5/applications/kcolorchooser.nix
index 45a72a0bbc1b..1dc6ccbc44c4 100644
--- a/pkgs/desktops/kde-5/applications/kcolorchooser.nix
+++ b/pkgs/desktops/kde-5/applications/kcolorchooser.nix
@@ -15,4 +15,7 @@ let
       propagatedBuildInputs = [ ki18n kwidgetsaddons kxmlgui ];
     };
 in
-kdeWrapper unwrapped { targets = [ "bin/kcolorchooser" ]; }
+kdeWrapper {
+  inherit unwrapped;
+  targets = [ "bin/kcolorchooser" ];
+}
diff --git a/pkgs/desktops/kde-5/applications/kdenlive.nix b/pkgs/desktops/kde-5/applications/kdenlive.nix
index 00826060b69b..071ec21bbd01 100644
--- a/pkgs/desktops/kde-5/applications/kdenlive.nix
+++ b/pkgs/desktops/kde-5/applications/kdenlive.nix
@@ -74,8 +74,9 @@ unwrapped = kdeApp {
   };
 };
 in
-kdeWrapper unwrapped
+kdeWrapper
 {
+  inherit unwrapped;
   targets = [ "bin/kdenlive" ];
   paths = [ kinit ];
 }
diff --git a/pkgs/desktops/kde-5/applications/kdf.nix b/pkgs/desktops/kde-5/applications/kdf.nix
index 835f0344da74..c73eadc1df44 100644
--- a/pkgs/desktops/kde-5/applications/kdf.nix
+++ b/pkgs/desktops/kde-5/applications/kdf.nix
@@ -18,4 +18,7 @@ let
       ];
     };
 in
-kdeWrapper unwrapped { targets = [ "bin/kdf" ]; }
+kdeWrapper {
+  inherit unwrapped;
+  targets = [ "bin/kdf" ];
+}
diff --git a/pkgs/desktops/kde-5/applications/khelpcenter.nix b/pkgs/desktops/kde-5/applications/khelpcenter.nix
index 934f13425e8a..3f13d131c77a 100644
--- a/pkgs/desktops/kde-5/applications/khelpcenter.nix
+++ b/pkgs/desktops/kde-5/applications/khelpcenter.nix
@@ -16,4 +16,7 @@ let
       ];
     };
 in
-kdeWrapper unwrapped { targets = [ "bin/khelpcenter" ]; }
+kdeWrapper {
+  inherit unwrapped;
+  targets = [ "bin/khelpcenter" ];
+}
diff --git a/pkgs/desktops/kde-5/applications/kompare.nix b/pkgs/desktops/kde-5/applications/kompare.nix
index 3b2143af615c..45789edbfcc8 100644
--- a/pkgs/desktops/kde-5/applications/kompare.nix
+++ b/pkgs/desktops/kde-5/applications/kompare.nix
@@ -15,4 +15,7 @@ let
       ];
     };
 in
-kdeWrapper unwrapped { targets = [ "bin/kompare" ]; }
+kdeWrapper {
+  inherit unwrapped;
+  targets = [ "bin/kompare" ];
+}
diff --git a/pkgs/desktops/kde-5/applications/konsole.nix b/pkgs/desktops/kde-5/applications/konsole.nix
index bf3a497fefaa..2dfd305b46b2 100644
--- a/pkgs/desktops/kde-5/applications/konsole.nix
+++ b/pkgs/desktops/kde-5/applications/konsole.nix
@@ -24,4 +24,7 @@ let
       ];
     };
 in
-kdeWrapper unwrapped { targets = [ "bin/konsole" ]; }
+kdeWrapper {
+  inherit unwrapped;
+  targets = [ "bin/konsole" ];
+}
diff --git a/pkgs/desktops/kde-5/applications/kwalletmanager.nix b/pkgs/desktops/kde-5/applications/kwalletmanager.nix
index a7a7ba47f432..03c2ab3853a1 100644
--- a/pkgs/desktops/kde-5/applications/kwalletmanager.nix
+++ b/pkgs/desktops/kde-5/applications/kwalletmanager.nix
@@ -30,6 +30,7 @@ let
       kxmlgui
     ];
   };
-in kdeWrapper unwrapped {
+in kdeWrapper {
+  inherit unwrapped;
   targets = ["bin/kwalletmanager5"];
 }
diff --git a/pkgs/desktops/kde-5/applications/marble.nix b/pkgs/desktops/kde-5/applications/marble.nix
index 8d6ee5a0f7c5..5b8a82dbf098 100644
--- a/pkgs/desktops/kde-5/applications/marble.nix
+++ b/pkgs/desktops/kde-5/applications/marble.nix
@@ -18,7 +18,8 @@ let
       enableParallelBuilding = true;
     };
 in
-kdeWrapper unwrapped {
+kdeWrapper {
+  inherit unwrapped;
   targets = [ "bin/marble-qt" ];
   paths = [ unwrapped ];
 }
diff --git a/pkgs/desktops/kde-5/applications/okular.nix b/pkgs/desktops/kde-5/applications/okular.nix
index faebf3e679b2..499e8cc93681 100644
--- a/pkgs/desktops/kde-5/applications/okular.nix
+++ b/pkgs/desktops/kde-5/applications/okular.nix
@@ -25,6 +25,7 @@ let
     };
   };
 in
-kdeWrapper unwrapped {
+kdeWrapper {
+  inherit unwrapped;
   targets = [ "bin/okular" ];
 }
diff --git a/pkgs/desktops/kde-5/applications/spectacle.nix b/pkgs/desktops/kde-5/applications/spectacle.nix
index aa618ffcde11..4c3a5246b2e7 100644
--- a/pkgs/desktops/kde-5/applications/spectacle.nix
+++ b/pkgs/desktops/kde-5/applications/spectacle.nix
@@ -18,7 +18,8 @@ let
       ];
     };
 in
-kdeWrapper unwrapped {
+kdeWrapper {
+  inherit unwrapped;
   targets = [ "bin/spectacle" ];
   paths = [ kipi-plugins ];
 }
diff --git a/pkgs/desktops/kde-5/plasma/oxygen.nix b/pkgs/desktops/kde-5/plasma/oxygen.nix
index f880f2e3ab23..ca63c8d7a377 100644
--- a/pkgs/desktops/kde-5/plasma/oxygen.nix
+++ b/pkgs/desktops/kde-5/plasma/oxygen.nix
@@ -15,6 +15,7 @@ let
     ];
   };
 in
-kdeWrapper unwrapped {
+kdeWrapper {
+  inherit unwrapped;
   targets = [ "bin/oxygen-demo5" "bin/oxygen-settings5" ];
 }
diff --git a/pkgs/development/compilers/emscripten-fastcomp/default.nix b/pkgs/development/compilers/emscripten-fastcomp/default.nix
index 5403c29baab4..c457ae158389 100644
--- a/pkgs/development/compilers/emscripten-fastcomp/default.nix
+++ b/pkgs/development/compilers/emscripten-fastcomp/default.nix
@@ -1,44 +1,52 @@
-{ stdenv, fetchFromGitHub, python }:
+{ stdenv, fetchFromGitHub, cmake, python, ... }:
 
 let
-  rev = "1.36.4";
+  rev = "1.37.1";
+  gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
 in
-
 stdenv.mkDerivation rec {
   name = "emscripten-fastcomp-${rev}";
 
-  srcFC = fetchFromGitHub {
+  src = fetchFromGitHub {
     owner = "kripken";
     repo = "emscripten-fastcomp";
-    sha256 = "0838rl0n9hyq5dd0gmj5rvigbmk5mhrhzyjk0zd8mjs2mk8z510l";
+    sha256 = "08jci6h73j4pcd6iq5r4zn8c6qpd6qxc7xivxh3iama9hghmxyk9";
     inherit rev;
   };
 
   srcFL = fetchFromGitHub {
     owner = "kripken";
     repo = "emscripten-fastcomp-clang";
-    sha256 = "169hfabamv3jmf88flhl4scwaxdh24196gwpz3sdb26lzcns519q";
+    sha256 = "053svm8vnsma61jzzr8n1224brmjw4pzvklh572bm1p7yg32chaw";
     inherit rev;
   };
 
-  buildInputs = [ python ];
-  buildCommand = ''
-    cp -as ${srcFC} $TMPDIR/src
-    chmod +w $TMPDIR/src/tools
-    cp -as ${srcFL} $TMPDIR/src/tools/clang
-
-    chmod +w $TMPDIR/src
-    mkdir $TMPDIR/src/build
-    cd $TMPDIR/src/build
-
-    ../configure --enable-optimized --disable-assertions --enable-targets=host,js
-    make
-    cp -a Release/bin $out
+  nativeBuildInputs = [ cmake python ];
+  preConfigure = ''
+    cp -Lr ${srcFL} tools/clang
+    chmod +w -R tools/clang
   '';
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DLLVM_TARGETS_TO_BUILD='X86;JSBackend'"
+    "-DLLVM_INCLUDE_EXAMPLES=OFF"
+    "-DLLVM_INCLUDE_TESTS=OFF"
+    # "-DCLANG_INCLUDE_EXAMPLES=OFF"
+    "-DCLANG_INCLUDE_TESTS=OFF"
+  ] ++ (stdenv.lib.optional stdenv.isLinux
+    # necessary for clang to find crtend.o
+    "-DGCC_INSTALL_PREFIX=${gcc}"
+  );
+  enableParallelBuilding = true;
+
+  passthru = {
+    isClang = true;
+    inherit gcc;
+  };
 
   meta = with stdenv.lib; {
     homepage = https://github.com/kripken/emscripten-fastcomp;
-    description = "Emscripten llvm";
+    description = "Emscripten LLVM";
     platforms = platforms.all;
     maintainers = with maintainers; [ qknight matthewbauer ];
     license = stdenv.lib.licenses.ncsa;
diff --git a/pkgs/development/compilers/emscripten/default.nix b/pkgs/development/compilers/emscripten/default.nix
index c78808b81bce..f94e826defbb 100644
--- a/pkgs/development/compilers/emscripten/default.nix
+++ b/pkgs/development/compilers/emscripten/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, emscriptenfastcomp, python, nodejs, closurecompiler, jre }:
 
 let
-  rev = "1.36.4";
+  rev = "1.37.1";
   appdir = "share/emscripten";
 in
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   src = fetchFromGitHub {
     owner = "kripken";
     repo = "emscripten";
-    sha256 = "1c9592i891z1v9rp4a4lnsp14nwiqfxnh37g6xwwjd1bqx7x4hn7";
+    sha256 = "0xl8lv0ihxsnwnhma3i34pkbz0v1yyc93ac6mdqmzv6fx2wczm04";
     inherit rev;
   };
 
@@ -23,11 +23,13 @@ stdenv.mkDerivation {
     sed -i -e "s,EM_CONFIG = '~/.emscripten',EM_CONFIG = '$out/${appdir}/config'," $out/${appdir}/tools/shared.py
     sed -i -e 's,^.*did not see a source tree above the LLVM.*$,      return True,' $out/${appdir}/tools/shared.py
     sed -i -e 's,def check_sanity(force=False):,def check_sanity(force=False):\n  return,' $out/${appdir}/tools/shared.py
+    # fixes cmake support
+    sed -i -e "s/print \('emcc (Emscript.*\)/sys.stderr.write(\1); sys.stderr.flush()/g" $out/${appdir}/emcc.py
     mkdir $out/bin
     ln -s $out/${appdir}/{em++,em-config,emar,embuilder.py,emcc,emcmake,emconfigure,emlink.py,emmake,emranlib,emrun,emscons} $out/bin
 
     echo "EMSCRIPTEN_ROOT = '$out/${appdir}'" > $out/${appdir}/config
-    echo "LLVM_ROOT = '${emscriptenfastcomp}'" >> $out/${appdir}/config
+    echo "LLVM_ROOT = '${emscriptenfastcomp}/bin'" >> $out/${appdir}/config
     echo "PYTHON = '${python}/bin/python'" >> $out/${appdir}/config
     echo "NODE_JS = '${nodejs}/bin/node'" >> $out/${appdir}/config
     echo "JS_ENGINES = [NODE_JS]" >> $out/${appdir}/config
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 7573451695c3..0581038d18df 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, libiconv, binutils, coreutils
-, autoconf, automake, happy, alex, crossSystem, selfPkgs, cross ? null
+, autoconf, automake, happy, alex, python3, crossSystem, selfPkgs, cross ? null
 }:
 
 let
   inherit (bootPkgs) ghc;
 
-  commonBuildInputs = [ ghc perl autoconf automake happy alex ];
+  commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
 
-  version = "8.1.20161115";
+  version = "8.1.20161224";
 
   commonPreConfigure =  ''
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
@@ -19,27 +19,26 @@ let
 in stdenv.mkDerivation (rec {
   inherit version;
   name = "ghc-${version}";
-  rev = "017d11e0a36866b05ace32ece1af11adf652a619";
+  rev = "2689a1692636521777f007861a484e7064b2d696";
 
   src = fetchgit {
     url = "git://git.haskell.org/ghc.git";
     inherit rev;
-    sha256 = "1ryggmz961qd0fl50rkjjvi6g9azwla2vx9310a9nzjaj5x6ib4y";
+    sha256 = "0rk6xy7kgxx849nprq1ji459p88nyy93236g841m5p6mdh7mmrcr";
   };
 
-  postPatch = ''
+  postPatch = "patchShebangs .";
+
+  preConfigure = ''
     echo ${version} >VERSION
     echo ${rev} >GIT_COMMIT_ID
-    patchShebangs .
     ./boot
-  '';
+  '' + commonPreConfigure ;
 
   buildInputs = commonBuildInputs;
 
   enableParallelBuilding = true;
 
-  preConfigure = commonPreConfigure;
-
   configureFlags = [
     "CC=${stdenv.cc}/bin/cc"
     "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
@@ -52,6 +51,8 @@ in stdenv.mkDerivation (rec {
   # that in turn causes GHCi to abort
   stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
 
+  checkTarget = "test";
+
   postInstall = ''
     paxmark m $out/lib/${name}/bin/{ghc,haddock}
 
diff --git a/pkgs/development/compilers/ghc/nokinds.nix b/pkgs/development/compilers/ghc/nokinds.nix
deleted file mode 100644
index a041ff02f936..000000000000
--- a/pkgs/development/compilers/ghc/nokinds.nix
+++ /dev/null
@@ -1,83 +0,0 @@
-{ stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, libiconv, autoconf, automake, happy, alex }:
-
-let
-  inherit (bootPkgs) ghc;
-
-  buildMK = ''
-    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
-    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
-    libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
-    libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
-    DYNAMIC_BY_DEFAULT = NO
-    SRC_HC_OPTS        = -H64m -O -fasm
-    GhcLibHcOpts       = -O -dcore-lint
-    GhcStage1HcOpts    = -Rghc-timing -O -fasm
-    GhcStage2HcOpts    = -Rghc-timing -O0 -DDEBUG
-    SplitObjs          = NO
-    HADDOCK_DOCS       = NO
-    BUILD_DOCBOOK_HTML = NO
-    BUILD_DOCBOOK_PS   = NO
-    BUILD_DOCBOOK_PDF  = NO
-    LAX_DEPENDENCIES   = YES
-    ${stdenv.lib.optionalString stdenv.isDarwin ''
-      libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
-      libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
-    ''}
-  '';
-
-in
-
-stdenv.mkDerivation rec {
-  version = "7.11.20150826";
-  name = "ghc-${version}"; # We cannot add a "nokinds" tag here; see git comment for details.
-  rev = "5f7f64b7fc879b5ecfd6987ec5565bd90f7c0179";
-
-  src = fetchgit {
-    url = "https://github.com/goldfirere/ghc.git";
-    inherit rev;
-    sha256 = "183l4v6aw52r3ydwl8bxg1lh3cwfakb35rpy6mjg23dqmqsynmcn";
-  };
-
-  patches = [ ./relocation.patch ];
-
-  postUnpack = ''
-    pushd ghc-${builtins.substring 0 7 rev}
-    echo ${version} >VERSION
-    echo ${rev} >GIT_COMMIT_ID
-    patchShebangs .
-    ./boot
-    popd
-  '';
-
-  buildInputs = [ ghc perl autoconf automake happy alex ];
-
-  preConfigure = ''
-    echo >mk/build.mk "${buildMK}"
-    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
-  '';
-
-  configureFlags = [
-    "--with-gcc=${stdenv.cc}/bin/cc"
-    "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
-  ];
-
-  enableParallelBuilding = true;
-
-  # required, because otherwise all symbols from HSffi.o are stripped, and
-  # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
-
-  passthru = {
-    inherit bootPkgs;
-  };
-
-  meta = {
-    homepage = "http://haskell.org/ghc";
-    description = "The dependently-typed 'nokinds' branch of the Glasgow Haskell Compiler by Richard Eisenberg";
-    maintainers = with stdenv.lib.maintainers; [ deepfire ];
-    inherit (ghc.meta) license platforms;
-  };
-
-}
diff --git a/pkgs/development/compilers/rust/nightlyBin.nix b/pkgs/development/compilers/rust/nightlyBin.nix
index a60d17fb7cbe..0671a88d2c4d 100644
--- a/pkgs/development/compilers/rust/nightlyBin.nix
+++ b/pkgs/development/compilers/rust/nightlyBin.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, makeWrapper, cacert, zlib }:
+{ stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage }:
 
 let
   inherit (stdenv.lib) optionalString;
 
-  platform = if stdenv.system == "x86_64-linux" 
+  platform = if stdenv.system == "x86_64-linux"
     then "x86_64-unknown-linux-gnu"
     else abort "missing boostrap url for platform ${stdenv.system}";
 
@@ -19,10 +19,12 @@ let
      sha256 = bootstrapHash;
   };
 
-  version = "2016-12-05";
+  version = "2016-12-29";
 in
 
 rec {
+  inherit buildRustPackage;
+
   rustc = stdenv.mkDerivation rec {
     name = "rustc-nightly-${version}";
 
@@ -49,5 +51,33 @@ rec {
           "$out/bin/rustc"
       ''}
     '';
+
+  };
+  cargo = stdenv.mkDerivation rec {
+    name = "cargo-nightly-${version}";
+
+    inherit version;
+    inherit src;
+
+    meta = with stdenv.lib; {
+      homepage = http://www.rust-lang.org/;
+      description = "A safe, concurrent, practical language";
+      maintainers = with maintainers; [ qknight ];
+      license = [ licenses.mit licenses.asl20 ];
+    };
+
+    buildInputs = [ makeWrapper ];
+    phases = ["unpackPhase" "installPhase"];
+
+    installPhase = ''
+      ./install.sh --prefix=$out \
+        --components=cargo
+
+      ${optionalString needsPatchelf ''
+        patchelf \
+          --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+          "$out/bin/cargo"
+      ''}
+    '';
   };
 }
diff --git a/pkgs/development/haskell-modules/configuration-ghc-nokinds.nix b/pkgs/development/haskell-modules/configuration-ghc-nokinds.nix
deleted file mode 100644
index 413984a7bd31..000000000000
--- a/pkgs/development/haskell-modules/configuration-ghc-nokinds.nix
+++ /dev/null
@@ -1,102 +0,0 @@
-{ pkgs }:
-
-with import ./lib.nix { inherit pkgs; };
-
-self: super: {
-
-  # Use the latest LLVM.
-  inherit (pkgs) llvmPackages;
-
-  # Disable GHC 7.11.x core libraries.
-  array = null;
-  base = null;
-  binary = null;
-  bin-package-db = null;
-  bytestring = null;
-  Cabal = null;
-  containers = null;
-  deepseq = null;
-  directory = null;
-  filepath = null;
-  ghc-prim = null;
-  haskeline = null;
-  hoopl = null;
-  hpc = null;
-  integer-gmp = null;
-  pretty = null;
-  process = null;
-  rts = null;
-  template-haskell = null;
-  terminfo = null;
-  time = null;
-  transformers = null;
-  unix = null;
-  xhtml = null;
-
-  # Don't use jailbreak built with Cabal 1.22.x because of https://github.com/peti/jailbreak-cabal/issues/9.
-  jailbreak-cabal = pkgs.haskell.packages.ghc784.jailbreak-cabal;
-
-  # GHC 7.10.x's Haddock binary cannot generate hoogle files.
-  # https://ghc.haskell.org/trac/ghc/ticket/9921
-  mkDerivation = drv: super.mkDerivation (drv // { doHoogle = false; doHaddock = false; });
-
-  # haddock: No input file(s).
-  nats = dontHaddock super.nats;
-  bytestring-builder = dontHaddock super.bytestring-builder;
-
-  # We have time 1.5
-  aeson = disableCabalFlag super.aeson "old-locale";
-
-  # Show works differently for record syntax now, breaking haskell-src-exts' parser tests
-  # https://github.com/haskell-suite/haskell-src-exts/issues/224
-  haskell-src-exts = dontCheck super.haskell-src-exts;
-
-  mono-traversable = appendPatch super.mono-traversable (pkgs.fetchpatch {
-    url = "https://github.com/snoyberg/mono-traversable/pull/77.patch";
-    sha256 = "1qrvrh3cqfkymi5yb9y9z88rq4n7ag0ac2k00mcnqh4dz1vh4fg1";
-  });
-  yesod-auth = appendPatch super.yesod-auth (pkgs.fetchpatch {
-    url = "https://github.com/yesodweb/yesod/pull/1006.patch";
-    sha256 = "0l6wjj8cfz6jy6j92kywsccafyffhlm5240q82bzirb278adqvar";
-    stripLen = 1;
-  });
-
-  # Setup: At least the following dependencies are missing: base <4.8
-  hspec-expectations = overrideCabal super.hspec-expectations (drv: {
-    postPatch = "sed -i -e 's|base < 4.8|base|' hspec-expectations.cabal";
-  });
-  utf8-string = overrideCabal super.utf8-string (drv: {
-    postPatch = "sed -i -e 's|base >= 3 && < 4.8|base|' utf8-string.cabal";
-  });
-
-  # bos/attoparsec#92
-  attoparsec = dontCheck super.attoparsec;
-
-  # test suite hangs silently for at least 10 minutes
-  split = dontCheck super.split;
-
-  # Test suite fails with some (seemingly harmless) error.
-  # https://code.google.com/p/scrapyourboilerplate/issues/detail?id=24
-  syb = dontCheck super.syb;
-
-  # Test suite has stricter version bounds
-  retry = dontCheck super.retry;
-
-  # Test suite fails with time >= 1.5
-  http-date = dontCheck super.http-date;
-
-  # Version 1.19.5 fails its test suite.
-  happy = dontCheck super.happy;
-
-  # Workaround for a workaround, see comment for "ghcjs" flag.
-  jsaddle = let jsaddle' = disableCabalFlag super.jsaddle "ghcjs";
-            in addBuildDepends jsaddle' [ self.glib self.gtk3 self.webkitgtk3
-                                          self.webkitgtk3-javascriptcore ];
-
-  # The compat library is empty in the presence of mtl 2.2.x.
-  mtl-compat = dontHaddock super.mtl-compat;
-
-  # Won't work with LLVM 3.5.
-  llvm-general = markBrokenVersion "3.4.5.3" super.llvm-general;
-
-}
diff --git a/pkgs/development/libraries/kde-frameworks/kde-wrapper.nix b/pkgs/development/libraries/kde-frameworks/kde-wrapper.nix
index 890ec1e4eec3..9ab6f7a10898 100644
--- a/pkgs/development/libraries/kde-frameworks/kde-wrapper.nix
+++ b/pkgs/development/libraries/kde-frameworks/kde-wrapper.nix
@@ -1,53 +1,73 @@
 { stdenv, lib, makeWrapper, buildEnv }:
 
-drv:
-
-{ targets, paths ? [] }:
+packages:
 
 let
+  packages_ = if builtins.isList packages then packages else [packages];
+
+  unwrapped = lib.concatMap (p: if builtins.isList p.unwrapped then p.unwrapped else [p.unwrapped]) packages_;
+  targets = lib.concatMap (p: p.targets) packages_;
+  paths = lib.concatMap (p: p.paths or []) packages_;
+
+  name =
+    if builtins.length unwrapped == 1
+    then (lib.head unwrapped).name
+    else "kde-application";
+  meta =
+    if builtins.length unwrapped == 1
+    then (lib.head unwrapped).meta
+    else {};
+
   env = buildEnv {
-    inherit (drv) name meta;
-    paths = builtins.map lib.getBin ([drv] ++ paths);
+    inherit name meta;
+    paths = builtins.map lib.getBin (unwrapped ++ paths);
     pathsToLink = [ "/bin" "/share" "/lib/qt5" "/etc/xdg" ];
   };
 in
 
 stdenv.mkDerivation {
-  inherit (drv) name meta;
+  inherit name meta;
   preferLocalBuild = true;
 
-  paths = builtins.map lib.getBin ([drv] ++ paths);
-  inherit drv env targets;
-  passthru = { unwrapped = drv; };
+  inherit unwrapped env targets;
 
-  nativeBuildInputs = [ makeWrapper ];
+  passthru = {
+    inherit targets paths;
+    unwrapped = if builtins.length unwrapped == 1 then lib.head unwrapped else unwrapped;
+  };
 
-  builder = builtins.toFile "builder.sh" ''
-    . $stdenv/setup
+  nativeBuildInputs = [ makeWrapper ];
 
+  buildCommand = ''
     for t in $targets; do
-        if [ -a "$drv/$t" ]; then
-            makeWrapper "$drv/$t" "$out/$t" \
-                --argv0 '"$0"' \
-                --suffix PATH : "$env/bin" \
-                --prefix XDG_CONFIG_DIRS : "$env/share" \
-                --prefix XDG_DATA_DIRS : "$env/etc/xdg" \
-                --set QML_IMPORT_PATH "$env/lib/qt5/imports" \
-                --set QML2_IMPORT_PATH "$env/lib/qt5/qml" \
-                --set QT_PLUGIN_PATH "$env/lib/qt5/plugins"
-        else
-            echo "no such file or directory: $drv/$t"
+        good=""
+        for drv in $unwrapped; do
+            if [ -a "$drv/$t" ]; then
+                makeWrapper "$drv/$t" "$out/$t" \
+                    --argv0 '"$0"' \
+                    --suffix PATH : "$env/bin" \
+                    --prefix XDG_CONFIG_DIRS : "$env/share" \
+                    --prefix XDG_DATA_DIRS : "$env/etc/xdg" \
+                    --set QML_IMPORT_PATH "$env/lib/qt5/imports" \
+                    --set QML2_IMPORT_PATH "$env/lib/qt5/qml" \
+                    --set QT_PLUGIN_PATH "$env/lib/qt5/plugins"
+                good="1"
+                break
+            fi
+        done
+        if [ -z "$good" ]; then
+            echo "file or directory not found in derivations: $t"
             exit 1
         fi
     done
 
-    if [ -a "$drv/share" ]; then
-        ln -s "$drv/share" "$out"
-    fi
+    ln -s "$env/share" "$out"
 
-    if [ -a "$drv/nix-support/propagated-user-env-packages" ]; then
-        mkdir -p "$out/nix-support"
-        ln -s "$drv/nix-support/propagated-user-env-packages" "$out/nix-support/"
-    fi
+    for drv in $unwrapped; do
+        if [ -a "$drv/nix-support/propagated-user-env-packages" ]; then
+            mkdir -p "$out/nix-support"
+            cat "$drv/nix-support/propagated-user-env-packages" >> "$out/nix-support/propagated-user-env-packages"
+        fi
+    done
   '';
 }
diff --git a/pkgs/tools/misc/kronometer/default.nix b/pkgs/tools/misc/kronometer/default.nix
index 5a3da3788d58..37399a1a4184 100644
--- a/pkgs/tools/misc/kronometer/default.nix
+++ b/pkgs/tools/misc/kronometer/default.nix
@@ -23,6 +23,7 @@ let
     propagatedBuildInputs = [ kconfig kinit ];
   };
 in
-kdeWrapper unwrapped {
+kdeWrapper {
+  inherit unwrapped;
   targets = [ "bin/kronometer" ];
 }
diff --git a/pkgs/tools/misc/peruse/default.nix b/pkgs/tools/misc/peruse/default.nix
index 865c6b1e842a..b6727f4e63bd 100644
--- a/pkgs/tools/misc/peruse/default.nix
+++ b/pkgs/tools/misc/peruse/default.nix
@@ -37,6 +37,7 @@ let
 
   };
 
-in kdeWrapper unwrapped {
+in kdeWrapper {
+  inherit unwrapped;
   targets = [ "bin/peruse" ];
 }
diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index 5dd523d6fa6b..9ed56ee1ec56 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -18,11 +18,11 @@ assert scpSupport -> libssh2 != null;
 assert c-aresSupport -> c-ares != null;
 
 stdenv.mkDerivation rec {
-  name = "curl-7.51.0";
+  name = "curl-7.52.1";
 
   src = fetchurl {
     url = "http://curl.haxx.se/download/${name}.tar.bz2";
-    sha256 = "1pldg1d8606p4q83k8fcp61kfcsbphln22mycw7h7r87i42410kz";
+    sha256 = "16rqhyzlpnivifin8n7l2fr9ihay9v2nw2drsniinb6bcykqaqfi";
   };
 
   outputs = [ "bin" "dev" "out" "man" "devdoc" ];
@@ -42,8 +42,6 @@ stdenv.mkDerivation rec {
     optional sslSupport openssl ++
     optional scpSupport libssh2;
 
-  patches = stdenv.lib.optional http2Support ./fix-http2-window-size.patch;
-
   # for the second line see http://curl.haxx.se/mail/tracker-2014-03/0087.html
   preConfigure = ''
     sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure
diff --git a/pkgs/tools/networking/curl/fix-http2-window-size.patch b/pkgs/tools/networking/curl/fix-http2-window-size.patch
deleted file mode 100644
index 6fac3e1b42ac..000000000000
--- a/pkgs/tools/networking/curl/fix-http2-window-size.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From a4d888857ede39a8e2aa5f961048c6362d3a5377 Mon Sep 17 00:00:00 2001
-From: Jay Satiro <raysatiro@yahoo.com>
-Date: Wed, 16 Nov 2016 02:55:30 -0500
-Subject: [PATCH] http2: Use huge HTTP/2 windows
-
-- Improve performance by using a huge HTTP/2 window size.
-
-Bug: https://github.com/curl/curl/issues/1102
-Reported-by: afrind@users.noreply.github.com
-Assisted-by: Tatsuhiro Tsujikawa
----
- docs/TODO   |  8 --------
- lib/http2.c | 15 +++++++++++++--
- 2 files changed, 13 insertions(+), 10 deletions(-)
-
-diff --git a/docs/TODO b/docs/TODO
-index c3bc4eb..99c610f 100644
---- a/docs/TODO
-+++ b/docs/TODO
-@@ -63,7 +63,6 @@
-  5.1 Better persistency for HTTP 1.0
-  5.2 support FF3 sqlite cookie files
-  5.3 Rearrange request header order
-- 5.4 Use huge HTTP/2 windows
-  5.5 auth= in URLs
-  5.6 Refuse "downgrade" redirects
-  5.7 Brotli compression
-@@ -528,13 +527,6 @@ This is not detailed in any FTP specification.
-  headers use a default value so only headers that need to be moved have to be
-  specified.
- 
--5.4 Use huge HTTP/2 windows
--
-- We're currently using nghttp2's default window size which is terribly small
-- (64K). This becomes a bottle neck over high bandwidth networks. We should
-- instead make the window size to be very big (512MB?) as we really don't do
-- much flow control anyway.
--
- 5.5 auth= in URLs
- 
-  Add the ability to specify the preferred authentication mechanism to use by
-diff --git a/lib/http2.c b/lib/http2.c
-index 6720984..202ab1b 100644
---- a/lib/http2.c
-+++ b/lib/http2.c
-@@ -59,6 +59,8 @@
- #define nghttp2_session_callbacks_set_error_callback(x,y)
- #endif
- 
-+#define HTTP2_HUGE_WINDOW_SIZE (1 << 30)
-+
- /*
-  * Curl_http2_init_state() is called when the easy handle is created and
-  * allows for HTTP/2 specific init of state.
-@@ -965,7 +967,7 @@ static ssize_t data_source_read_callback(nghttp2_session *session,
-  */
- static nghttp2_settings_entry settings[] = {
-   { NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100 },
--  { NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, NGHTTP2_INITIAL_WINDOW_SIZE },
-+  { NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, HTTP2_HUGE_WINDOW_SIZE },
- };
- 
- #define H2_BUFSIZE 32768
-@@ -2031,7 +2033,8 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
-   else {
-     /* stream ID is unknown at this point */
-     stream->stream_id = -1;
--    rv = nghttp2_submit_settings(httpc->h2, NGHTTP2_FLAG_NONE, NULL, 0);
-+    rv = nghttp2_submit_settings(httpc->h2, NGHTTP2_FLAG_NONE, settings,
-+                                 sizeof(settings) / sizeof(settings[0]));
-     if(rv != 0) {
-       failf(data, "nghttp2_submit_settings() failed: %s(%d)",
-             nghttp2_strerror(rv), rv);
-@@ -2039,6 +2042,14 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
-     }
-   }
- 
-+  rv = nghttp2_session_set_local_window_size(httpc->h2, NGHTTP2_FLAG_NONE, 0,
-+                                             HTTP2_HUGE_WINDOW_SIZE);
-+  if(rv != 0) {
-+    failf(data, "nghttp2_session_set_local_window_size() failed: %s(%d)",
-+          nghttp2_strerror(rv), rv);
-+    return CURLE_HTTP2;
-+  }
-+
-   /* we are going to copy mem to httpc->inbuf.  This is required since
-      mem is part of buffer pointed by stream->mem, and callbacks
-      called by nghttp2_session_mem_recv() will write stream specific
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index de561fa6391a..de455514f39c 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1555,7 +1555,18 @@ in
 
   emscripten = callPackage ../development/compilers/emscripten { };
 
-  emscriptenfastcomp = callPackage ../development/compilers/emscripten-fastcomp { };
+  emscriptenfastcomp-unwrapped = callPackage ../development/compilers/emscripten-fastcomp { };
+  emscriptenfastcomp-wrapped = wrapCC emscriptenfastcomp-unwrapped;
+  emscriptenfastcomp = symlinkJoin {
+    name = "emscriptenfastcomp";
+    paths = [ emscriptenfastcomp-wrapped emscriptenfastcomp-unwrapped ];
+    preferLocalBuild = false;
+    allowSubstitutes = true;
+    postBuild = ''
+      # replace unwrapped clang-3.9 binary by wrapper
+      ln -sf $out/bin/clang $out/bin/clang-[0-9]*
+    '';
+  };
 
   emscriptenPackages = recurseIntoAttrs (callPackage ./emscripten-packages.nix { });
 
@@ -5278,12 +5289,17 @@ in
   };
 
   rust = rustStable;
-  rustcNightlyBin = lowPrio (callPackage ../development/compilers/rust/nightlyBin.nix {});
   rustStable = callPackage ../development/compilers/rust {};
   rustBeta = callPackage ../development/compilers/rust/beta.nix {};
   rustNightly = callPackage ../development/compilers/rust/nightly.nix {
     rustPlatform = recurseIntoAttrs (makeRustPlatform rustBeta);
   };
+  rustNightlyBin = callPackage ../development/compilers/rust/nightlyBin.nix {
+     buildRustPackage = callPackage ../build-support/rust {
+       rust = rustNightlyBin;
+       rustRegistry = callPackage ./rust-packages.nix { };
+     };
+  };
 
   cargo = rust.cargo;
   rustc = rust.rustc;
diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix
index f229fb8a35cf..5b14af145e9f 100644
--- a/pkgs/top-level/haskell-packages.nix
+++ b/pkgs/top-level/haskell-packages.nix
@@ -58,11 +58,6 @@ rec {
       inherit crossSystem;
       selfPkgs = packages.ghcHEAD;
     };
-    ghcNokinds = callPackage ../development/compilers/ghc/nokinds.nix rec {
-      bootPkgs = packages.ghc784;
-      inherit (bootPkgs) alex happy;
-    };
-
     ghcjs = packages.ghc7103.callPackage ../development/compilers/ghcjs {
       bootPkgs = packages.ghc7103;
     };
@@ -138,10 +133,6 @@ rec {
       ghc = compiler.ghcHEAD.crossCompiler;
       compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
     };
-    ghcNokinds = callPackage ../development/haskell-modules {
-      ghc = compiler.ghcNokinds;
-      compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-nokinds.nix { };
-    };
     ghcjs = callPackage ../development/haskell-modules {
       ghc = compiler.ghcjs;
       compilerConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { };