From ceb9110aad9479e012eb5a04904ec9203f22672e Mon Sep 17 00:00:00 2001
From: Nadrieril <nadrieril@gmail.com>
Date: Wed, 4 Jul 2018 20:10:21 +0100
Subject: [PATCH 01/34] passff-host: init at 1.0.2

---
 pkgs/tools/security/passff-host/default.nix | 36 +++++++++++++++++++++
 pkgs/top-level/all-packages.nix             |  2 ++
 2 files changed, 38 insertions(+)
 create mode 100644 pkgs/tools/security/passff-host/default.nix

diff --git a/pkgs/tools/security/passff-host/default.nix b/pkgs/tools/security/passff-host/default.nix
new file mode 100644
index 00000000000..1bb621eab36
--- /dev/null
+++ b/pkgs/tools/security/passff-host/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, python3, pass }:
+
+stdenv.mkDerivation rec {
+  name = "passff-host-${version}";
+  version = "1.0.2";
+
+  src = fetchFromGitHub {
+    owner = "passff";
+    repo = "passff-host";
+    rev = version;
+    sha256 = "1zks34rg9i8vphjrj1h80y5rijadx33z911qxa7pslf7ahmjqdv3";
+  };
+
+  buildInputs = [ python3 ];
+
+  patchPhase = ''
+    sed -i 's#COMMAND      = "pass"#COMMAND = "${pass}/bin/pass"#' src/passff.py
+  '';
+
+  preBuild = "cd src";
+  postBuild = "cd ..";
+
+  installPhase = ''
+    install -D bin/testing/passff.py $out/share/passff-host/passff.py
+    cp bin/testing/passff.json $out/share/passff-host/passff.json
+    substituteInPlace $out/share/passff-host/passff.json \
+      --replace PLACEHOLDER $out/share/passff-host/passff.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Host app for the WebExtension PassFF";
+    homepage = https://github.com/passff/passff-host;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ nadrieril ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6b1219690d7..f828e4d0e84 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -688,6 +688,8 @@ with pkgs;
 
   browserpass = callPackage ../tools/security/browserpass { };
 
+  passff-host = callPackage ../tools/security/passff-host { };
+
   oracle-instantclient = callPackage ../development/libraries/oracle-instantclient { };
 
   kwakd = callPackage ../servers/kwakd { };

From 47f78cd36ae1acd85557b27e7e4b6e8eb8012bc2 Mon Sep 17 00:00:00 2001
From: Silvan Mosberger <infinisil@icloud.com>
Date: Thu, 19 Jul 2018 00:05:53 +0200
Subject: [PATCH 02/34] minecraft: clean and fix up

The launcher now downloads almost all required libraries itself into
~/.minecraft and there's nothing one can do about it. Sound only works
with libpulseaudio though
---
 pkgs/games/minecraft/default.nix | 49 ++++++++++++--------------------
 pkgs/top-level/all-packages.nix  |  4 +--
 2 files changed, 19 insertions(+), 34 deletions(-)

diff --git a/pkgs/games/minecraft/default.nix b/pkgs/games/minecraft/default.nix
index e59181bb0fa..76edc512b0e 100644
--- a/pkgs/games/minecraft/default.nix
+++ b/pkgs/games/minecraft/default.nix
@@ -1,11 +1,6 @@
-{ stdenv, fetchurl, makeDesktopItem
-, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
-, openjdk
-, libGLU_combined, openal
-, useAlsa ? false, alsaOss ? null }:
-with stdenv.lib;
-
-assert useAlsa -> alsaOss != null;
+{ stdenv, fetchurl, makeDesktopItem, makeWrapper
+, jdk, jre, libpulseaudio
+}:
 
 let
   desktopItem = makeDesktopItem {
@@ -19,41 +14,33 @@ let
   };
 
 in stdenv.mkDerivation {
-  name = "minecraft-2015.07.24";
+  name = "minecraft-2015-07-24";
 
   src = fetchurl {
     url = "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar";
     sha256 = "04pj4l5q0a64jncm2kk45r7nxnxa2z9n110dcxbbahdi6wk0png8";
   };
 
-  phases = "installPhase";
+  nativeBuildInputs = [ makeWrapper ];
+
+  unpackPhase = "${jdk}/bin/jar xf $src favicon.png";
 
   installPhase = ''
-    set -x
-    mkdir -pv $out/bin
-    cp -v $src $out/minecraft.jar
+    mkdir -p $out/bin $out/share/minecraft
 
-    cat > $out/bin/minecraft << EOF
-    #!${stdenv.shell}
+    makeWrapper ${jre}/bin/java $out/bin/minecraft \
+      --add-flags "-jar $out/share/minecraft/minecraft.jar" \
+      --suffix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libpulseaudio ]}
 
-    export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${makeLibraryPath [ libX11 libXext libXcursor libXrandr libXxf86vm libGLU_combined openal ]}
-    ${if useAlsa then "${alsaOss}/bin/aoss" else "" } \
-      ${jre}/bin/java -jar $out/minecraft.jar
-    EOF
-
-    chmod +x $out/bin/minecraft
-
-    mkdir -p $out/share/applications
-    ln -s ${desktopItem}/share/applications/* $out/share/applications/
-
-    ${openjdk}/bin/jar xf $out/minecraft.jar favicon.png
+    cp $src $out/share/minecraft/minecraft.jar
+    cp -r ${desktopItem}/share/applications $out/share
     install -D favicon.png $out/share/icons/hicolor/32x32/apps/minecraft.png
   '';
 
-  meta = {
-      description = "A sandbox-building game";
-      homepage = http://www.minecraft.net;
-      maintainers = with stdenv.lib.maintainers; [ cpages ryantm ];
-      license = stdenv.lib.licenses.unfreeRedistributable;
+  meta = with stdenv.lib; {
+    description = "A sandbox-building game";
+    homepage = https://minecraft.net;
+    maintainers = with maintainers; [ cpages ryantm infinisil ];
+    license = licenses.unfreeRedistributable;
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 5a5def85f40..814b6ad6c1e 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -19661,9 +19661,7 @@ with pkgs;
 
   megaglest = callPackage ../games/megaglest {};
 
-  minecraft = callPackage ../games/minecraft {
-    useAlsa = config.minecraft.alsa or false;
-  };
+  minecraft = callPackage ../games/minecraft { };
 
   minecraft-server = callPackage ../games/minecraft-server { };
 

From 9877ba507b5c9eaf9bd0edcb3e7216c3bf8b714c Mon Sep 17 00:00:00 2001
From: Jesper Geertsen Jonsson <yesbox@users.noreply.github.com>
Date: Thu, 19 Jul 2018 13:42:39 +0200
Subject: [PATCH 03/34] bfs: enable the test_fstype test

This test would previously fail in the nix build sandbox.
It was fixed in version 1.2.2.
---
 pkgs/tools/system/bfs/default.nix |  2 --
 pkgs/tools/system/bfs/tests.patch | 10 ----------
 2 files changed, 12 deletions(-)
 delete mode 100644 pkgs/tools/system/bfs/tests.patch

diff --git a/pkgs/tools/system/bfs/default.nix b/pkgs/tools/system/bfs/default.nix
index 3f618301a86..746367a6bb2 100644
--- a/pkgs/tools/system/bfs/default.nix
+++ b/pkgs/tools/system/bfs/default.nix
@@ -11,8 +11,6 @@ stdenv.mkDerivation rec {
     sha256 = "0a7zsipvndvg1kp2i35jrg9y9kncj7i6mp36dhpj8zjmkm5d5b8g";
   };
 
-  # Disable fstype test, tries to read /etc/mtab
-  patches = [ ./tests.patch ];
   postPatch = ''
     # Patch tests (both shebangs and usage in scripts)
     for f in $(find -type f -name '*.sh'); do
diff --git a/pkgs/tools/system/bfs/tests.patch b/pkgs/tools/system/bfs/tests.patch
deleted file mode 100644
index a30291d7095..00000000000
--- a/pkgs/tools/system/bfs/tests.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/tests.sh
-+++ b/tests.sh
-@@ -369,7 +369,6 @@
-     test_printf_nul
-     test_quit_after_print
-     test_quit_before_print
--    test_fstype
-     test_not
-     test_and
-     test_or

From 539f4f644ad1462420917b85e327ac7e63e18c2e Mon Sep 17 00:00:00 2001
From: Frederik Rietdijk <fridh@fridh.nl>
Date: Sat, 21 Jul 2018 13:48:19 +0200
Subject: [PATCH 04/34] vim_configurable: get rid of composableDerivation

Use `stdenv.mkDerivation` directly instead of `composableDerivation`.

Some configure flags may have changed as the conversion wasn't exactly
straightforward.
---
 .../applications/editors/vim/configurable.nix | 241 ++++++++----------
 pkgs/top-level/all-packages.nix               |   6 -
 2 files changed, 110 insertions(+), 137 deletions(-)

diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix
index ad04cab62f5..da15081173d 100644
--- a/pkgs/applications/editors/vim/configurable.nix
+++ b/pkgs/applications/editors/vim/configurable.nix
@@ -1,7 +1,7 @@
 # TODO tidy up eg The patchelf code is patching gvim even if you don't build it..
 # but I have gvim with python support now :) - Marc
 args@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, gettext
-, composableDerivation, writeText, lib, config, glib, gtk2, gtk3, python, perl, tcl, ruby
+, writeText, lib, config, glib, gtk2, gtk3, python, perl, tcl, ruby
 , libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu
 , libICE
 , vimPlugins
@@ -10,13 +10,27 @@ args@{ source ? "default", callPackage, fetchurl, stdenv, ncurses, pkgconfig, ge
 # apple frameworks
 , CoreServices, CoreData, Cocoa, Foundation, libobjc, cf-private
 
-, wrapPythonDrv ? false
-
+, features          ? "huge" # One of tiny, small, normal, big or huge
+, wrapPythonDrv     ? false
+, guiSupport        ? config.vim.gui or "auto"
+, luaSupport        ? config.vim.lua or true
+, perlSupport       ? config.vim.perl or false      # Perl interpreter
+, pythonSupport     ? config.vim.python or true     # Python interpreter
+, rubySupport       ? config.vim.ruby or true       # Ruby interpreter
+, nlsSupport        ? config.vim.nls or false       # Enable NLS (gettext())
+, tclSupport        ? config.vim.tcl or false       # Include Tcl interpreter
+, multibyteSupport  ? config.vim.multibyte or false # Enable multibyte editing support
+, cscopeSupport     ? config.vim.cscope or true     # Enable cscope interface
+, netbeansSupport   ? config.netbeans or true       # Enable NetBeans integration support.
+, ximSupport        ? config.vim.xim or true        # less than 15KB, needed for deadkeys
+# By default, compile with darwin support if we're compiling on darwin, but
+# allow this to be disabled by setting config.vim.darwin to false
+, darwinSupport     ? stdenv.isDarwin && (config.vim.darwin or true) # Enable Darwin support
+, ftNixSupport      ? config.vim.ftNix or true      # Add .nix filetype detection and minimal syntax highlighting support
 , ... }: with args;
 
 
 let
-  inherit (args.composableDerivation) composableDerivation edf;
   nixosRuntimepath = writeText "nixos-vimrc" ''
     set nocompatible
     syntax on
@@ -48,148 +62,113 @@ let
   '';
 
   common = callPackage ./common.nix {};
-in
-composableDerivation {
-} (fix: rec {
 
-    name = "vim_configurable-${version}";
+  isPython3 = python.isPy3 or false;
 
-    inherit (common) version postPatch hardeningDisable enableParallelBuilding meta;
+in stdenv.mkDerivation rec {
 
-    src = builtins.getAttr source {
-      "default" = common.src; # latest release
+  name = "vim_configurable-${version}";
 
-      "vim-nox" =
-          {
-            # vim nox branch: client-server without X by uing sockets
-            # REGION AUTO UPDATE: { name="vim-nox"; type="hg"; url="https://code.google.com/r/yukihironakadaira-vim-cmdsrv-nox/"; branch="cmdsrv-nox"; }
-            src = (fetchurl { url = "http://mawercer.de/~nix/repos/vim-nox-hg-2082fc3.tar.bz2"; sha256 = "293164ca1df752b7f975fd3b44766f5a1db752de6c7385753f083499651bd13a"; });
-            name = "vim-nox-hg-2082fc3";
-            # END
-          }.src;
-      };
+  inherit (common) version postPatch hardeningDisable enableParallelBuilding meta;
 
-    patches = [ ./cflags-prune.diff ];
+  src = builtins.getAttr source {
+    "default" = common.src; # latest release
 
-    configureFlags
-      = [ "--enable-gui=${args.gui}" "--with-features=${args.features}" ];
-
-    nativeBuildInputs = [ pkgconfig ];
-
-    buildInputs
-      = [ ncurses libX11 libXext libSM libXpm libXt libXaw libXau
-          libXmu glib libICE ] ++ (if args.gui == "gtk3" then [gtk3] else [gtk2]);
-
-    # most interpreters aren't tested yet.. (see python for example how to do it)
-    flags = {
-        ftNix = {
-          patches = [ ./ft-nix-support.patch ];
-          preConfigure = ''
-            cp ${vimPlugins.vim-nix.src}/ftplugin/nix.vim runtime/ftplugin/nix.vim
-            cp ${vimPlugins.vim-nix.src}/indent/nix.vim runtime/indent/nix.vim
-            cp ${vimPlugins.vim-nix.src}/syntax/nix.vim runtime/syntax/nix.vim
-          '';
-        };
-      }
-      // edf {
-        name = "darwin";
-        enable = {
-          buildInputs = [ CoreServices CoreData Cocoa Foundation libobjc cf-private ];
-          NIX_LDFLAGS = stdenv.lib.optional stdenv.isDarwin
-            "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation";
-        };
-      } #Disable Darwin (macOS) support.
-      // edf { name = "xsmp"; } #Disable XSMP session management
-      // edf { name = "xsmp_interact"; } #Disable XSMP interaction
-      // edf { name = "mzscheme"; feat = "mzschemeinterp";} #Include MzScheme interpreter.
-      // edf { name = "perl"; feat = "perlinterp"; enable = { nativeBuildInputs = [perl]; };} #Include Perl interpreter.
-
-      // edf {
-        name = "python";
-        feat = "python${if python ? isPy3 then "3" else ""}interp";
-        enable = {
-          buildInputs = [ python ];
-        } // lib.optionalAttrs wrapPythonDrv {
-          nativeBuildInputs = [ makeWrapper ];
-          postInstall = ''
-            wrapProgram "$out/bin/vim" --prefix PATH : "${python}/bin"
-          '';
-        } // lib.optionalAttrs stdenv.isDarwin {
-          configureFlags
-            = [ "--enable-python${if python ? isPy3 then "3" else ""}interp=yes"
-                "--with-python${if python ? isPy3 then "3" else ""}-config-dir=${python}/lib"
-                "--disable-python${if python ? isPy3 then "" else "3"}interp" ];
-        };
-      }
-
-      // edf { name = "tcl"; feat = "tclinterp"; enable = { buildInputs = [tcl]; }; } #Include Tcl interpreter.
-      // edf { name = "ruby"; feat = "rubyinterp"; enable = { buildInputs = [ruby]; };} #Include Ruby interpreter.
-      // edf {
-        name = "lua";
-        feat = "luainterp";
-        enable = {
-          buildInputs = [lua];
-          configureFlags = [
-            "--with-lua-prefix=${args.lua}"
-            "--enable-luainterp"
-          ];
-        };
-      }
-      // edf { name = "cscope"; } #Include cscope interface.
-      // edf { name = "workshop"; } #Include Sun Visual Workshop support.
-      // edf { name = "netbeans"; } #Disable NetBeans integration support.
-      // edf { name = "sniff"; feat = "sniff" ; } #Include Sniff interface.
-      // edf { name = "multibyte"; } #Include multibyte editing support.
-      // edf { name = "hangulinput"; feat = "hangulinput" ;} #Include Hangul input support.
-      // edf { name = "xim"; } #Include XIM input support.
-      // edf { name = "fontset"; } #Include X fontset output support.
-      // edf { name = "acl"; } #Don't check for ACL support.
-      // edf { name = "gpm"; } #Don't use gpm (Linux mouse daemon).
-      // edf { name = "nls"; enable = {nativeBuildInputs = [gettext];}; } #Don't support NLS (gettext()).
-      ;
-
-  cfg = {
-    luaSupport       = config.vim.lua or true;
-    pythonSupport    = config.vim.python or true;
-    rubySupport      = config.vim.ruby or true;
-    nlsSupport       = config.vim.nls or false;
-    tclSupport       = config.vim.tcl or false;
-    multibyteSupport = config.vim.multibyte or false;
-    cscopeSupport    = config.vim.cscope or true;
-    netbeansSupport  = config.netbeans or true; # eg envim is using it
-    ximSupport       = config.vim.xim or true; # less than 15KB, needed for deadkeys
-
-    # by default, compile with darwin support if we're compiling on darwin, but
-    # allow this to be disabled by setting config.vim.darwin to false
-    darwinSupport    = stdenv.isDarwin && (config.vim.darwin or true);
-
-    # add .nix filetype detection and minimal syntax highlighting support
-    ftNixSupport     = config.vim.ftNix or true;
+    "vim-nox" =
+      {
+        # vim nox branch: client-server without X by uing sockets
+        # REGION AUTO UPDATE: { name="vim-nox"; type="hg"; url="https://code.google.com/r/yukihironakadaira-vim-cmdsrv-nox/"; branch="cmdsrv-nox"; }
+        src = (fetchurl { url = "http://mawercer.de/~nix/repos/vim-nox-hg-2082fc3.tar.bz2"; sha256 = "293164ca1df752b7f975fd3b44766f5a1db752de6c7385753f083499651bd13a"; });
+        name = "vim-nox-hg-2082fc3";
+        # END
+      }.src;
   };
 
-  #--enable-gui=OPTS     X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gtk3/gnome/gnome2/motif/athena/neXtaw/photon/carbon
-    /*
-      // edf "gtk_check" "gtk_check" { } #If auto-select GUI, check for GTK default=yes
-      // edf "gtk2_check" "gtk2_check" { } #If GTK GUI, check for GTK+ 2 default=yes
-      // edf "gnome_check" "gnome_check" { } #If GTK GUI, check for GNOME default=no
-      // edf "motif_check" "motif_check" { } #If auto-select GUI, check for Motif default=yes
-      // edf "athena_check" "athena_check" { } #If auto-select GUI, check for Athena default=yes
-      // edf "nextaw_check" "nextaw_check" { } #If auto-select GUI, check for neXtaw default=yes
-      // edf "carbon_check" "carbon_check" { } #If auto-select GUI, check for Carbon default=yes
-      // edf "gtktest" "gtktest" { } #Do not try to compile and run a test GTK program
-    */
+  patches = [ ./cflags-prune.diff ] ++ stdenv.lib.optional ftNixSupport ./ft-nix-support.patch;
 
-  preInstall = ''
-    mkdir -p $out/share/applications $out/share/icons/{hicolor,locolor}/{16x16,32x32,48x48}/apps
-  '';
+  configureFlags = [
+    "--enable-gui=${guiSupport}"
+    "--with-features=${features}"
+    "--disable-xsmp"              # XSMP session management
+    "--disable-xsmp_interact"     # XSMP interaction
+    "--disable-workshop"          # Sun Visual Workshop support
+    "--disable-sniff"             # Sniff interface
+    "--disable-hangulinput"       # Hangul input support
+    "--disable-fontset"           # X fontset output support
+    "--disable-acl"               # ACL support
+    "--disable-gpm"               # GPM (Linux mouse daemon)
+    "--disable-mzschemeinterp"
+    "--disable-gtk_check"
+    "--disable-gtk2_check"
+    "--disable-gnome_check"
+    "--disable-motif_check"
+    "--disable-athena_check"
+    "--disable-nextaf_check"
+    "--disable-carbon_check"
+    "--disable-gtktest"
+  ]
+  ++ stdenv.lib.optionals luaSupport [
+    "--with-lua-prefix=${args.lua}"
+    "--enable-luainterp"
+  ]
+  ++ stdenv.lib.optionals pythonSupport [
+    "--enable-python${if isPython3 then "3" else ""}"
+  ]
+  ++ stdenv.lib.optionals (pythonSupport && stdenv.isDarwin) [  # Why only for Darwin?
+    "--enable-python${if isPython3 then "3" else ""}interp=yes" # Duplicate?
+    "--with-python${if isPython3 then "3" else ""}-config-dir=${python}/lib"
+    "--disable-python${if isPython3 then "" else "3"}interp"
+  ]
+  ++ stdenv.lib.optional nlsSupport          "--enable-nls"
+  ++ stdenv.lib.optional perlSupport         "--enable-perlinterp"
+  ++ stdenv.lib.optional rubySupport         "--enable-rubyinterp"
+  ++ stdenv.lib.optional tclSupport          "--enable-tclinterp"
+  ++ stdenv.lib.optional multibyteSupport    "--enable-multibyte"
+  ++ stdenv.lib.optional cscopeSupport       "--enable-cscope"
+  ++ stdenv.lib.optional netbeansSupport     "--enable-netbeans"
+  ++ stdenv.lib.optional ximSupport          "--enable-xim";
 
-  postInstall = stdenv.lib.optionalString stdenv.isLinux ''
+  nativeBuildInputs = [
+    pkgconfig
+  ]
+  ++ stdenv.lib.optional wrapPythonDrv makeWrapper
+  ++ stdenv.lib.optional nlsSupport gettext
+  ++ stdenv.lib.optional perlSupport perl
+  ;
+
+  buildInputs = [ ncurses libX11 libXext libSM libXpm libXt libXaw libXau
+    libXmu glib libICE ]
+    ++ (if guiSupport == "gtk3" then [gtk3] else [gtk2])
+    ++ stdenv.lib.optionals darwinSupport [ CoreServices CoreData Cocoa Foundation libobjc cf-private ]
+    ++ stdenv.lib.optional luaSupport lua
+    ++ stdenv.lib.optional pythonSupport python
+    ++ stdenv.lib.optional tclSupport tcl
+    ++ stdenv.lib.optional rubySupport ruby;
+
+  preConfigure = ''
+    '' + stdenv.lib.optionalString ftNixSupport ''
+      cp ${vimPlugins.vim-nix.src}/ftplugin/nix.vim runtime/ftplugin/nix.vim
+      cp ${vimPlugins.vim-nix.src}/indent/nix.vim runtime/indent/nix.vim
+      cp ${vimPlugins.vim-nix.src}/syntax/nix.vim runtime/syntax/nix.vim
+    '';
+
+  NIX_LDFLAGS = stdenv.lib.optionalString (darwinSupport && stdenv.isDarwin)
+    "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation";
+
+  postInstall = ''
+  '' + stdenv.lib.optionalString stdenv.isLinux ''
     patchelf --set-rpath \
       "$(patchelf --print-rpath $out/bin/vim):${lib.makeLibraryPath buildInputs}" \
       "$out"/bin/{vim,gvim}
 
     ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc
+  '' + stdenv.lib.optionalString wrapPythonDrv ''
+    wrapProgram "$out/bin/vim" --prefix PATH : "${python}/bin"
+  '';
+
+  preInstall = ''
+    mkdir -p $out/share/applications $out/share/icons/{hicolor,locolor}/{16x16,32x32,48x48}/apps
   '';
 
   dontStrip = 1;
-})
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index bc4caf5988f..29de405df2f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -18710,12 +18710,6 @@ with pkgs;
     inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData;
     inherit (darwin) libobjc cf-private;
     inherit lua;
-
-    features = "huge"; # one of  tiny, small, normal, big or huge
-    gui = config.vim.gui or "auto";
-
-    # optional features by flags
-    flags = [ "python" "X11" ]; # only flag "X11" by now
   });
 
   vimNox = lowPrio (vim_configurable.override {

From 9cb1e7a1f3f2c5b087221936a645d8ae499c5237 Mon Sep 17 00:00:00 2001
From: Frederik Rietdijk <fridh@fridh.nl>
Date: Sat, 21 Jul 2018 16:49:06 +0200
Subject: [PATCH 05/34] qvim: get rid of composableDerivation

Use `stdenv.mkDerivation` directly instead of `composableDerivation`.

Some configure flags may have changed as the conversion wasn't exactly
straightforward.
---
 pkgs/applications/editors/vim/qvim.nix | 180 +++++++++++--------------
 1 file changed, 82 insertions(+), 98 deletions(-)

diff --git a/pkgs/applications/editors/vim/qvim.nix b/pkgs/applications/editors/vim/qvim.nix
index c23bf360daf..81948918a11 100644
--- a/pkgs/applications/editors/vim/qvim.nix
+++ b/pkgs/applications/editors/vim/qvim.nix
@@ -1,110 +1,94 @@
 args@{ fetchgit, stdenv, ncurses, pkgconfig, gettext
-, composableDerivation, lib, config, python, perl, tcl, ruby, qt4
+, lib, config, python, perl, tcl, ruby, qt4
 , libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu
-, libICE, ... }: with args;
+, libICE
+, lua
+, features
+, luaSupport       ? config.vim.lua or true
+, perlSupport      ? config.vim.perl or false      # Perl interpreter
+, pythonSupport    ? config.vim.python or true
+, rubySupport      ? config.vim.ruby or true
+, nlsSupport       ? config.vim.nls or false
+, tclSupport       ? config.vim.tcl or false
+, multibyteSupport ? config.vim.multibyte or false
+, cscopeSupport    ? config.vim.cscope or false
+, netbeansSupport  ? config.netbeans or true # eg envim is using it
+
+# by default, compile with darwin support if we're compiling on darwin, but
+# allow this to be disabled by setting config.vim.darwin to false
+, darwinSupport    ? stdenv.isDarwin && (config.vim.darwin or true)
+
+# add .nix filetype detection and minimal syntax highlighting support
+, ftNixSupport     ? config.vim.ftNix or true
+
+, ... }: with args;
 
 let tag = "20140827";
     sha256 = "0ncgbcm23z25naicxqkblz0mcl1zar2qwgi37y5ar8q8884w9ml2";
-in
+in {
 
-let inherit (args.composableDerivation) composableDerivation edf; in
-composableDerivation {
-} (fix: {
+  name = "qvim-7.4." + tag;
 
-    name = "qvim-7.4." + tag;
+  enableParallelBuilding = true; # test this
 
-    enableParallelBuilding = true; # test this
-
-    src = fetchgit {
-      url = https://bitbucket.org/equalsraf/vim-qt.git ;
-      rev = "refs/tags/package-" + tag;
-      inherit sha256;
-    };
-
-    # FIXME: adopt Darwin fixes from vim/default.nix, then chage meta.platforms.linux
-    # to meta.platforms.unix
-    preConfigure = assert (! stdenv.isDarwin); "";
-
-    configureFlags = [ "--with-vim-name=qvim" "--enable-gui=qt" "--with-features=${args.features}" ];
-
-    nativeBuildInputs
-      = [ ncurses pkgconfig libX11 libXext libSM libXpm libXt libXaw libXau
-          libXmu libICE qt4];
-
-    # most interpreters aren't tested yet.. (see python for example how to do it)
-    flags = {
-        ftNix = {
-          # because we cd to src in the main patch phase, we can't just add this
-          # patch to the list, we have to apply it manually
-          postPatch = ''
-            cd runtime
-            patch -p2 < ${./ft-nix-support.patch}
-            cd ..
-          '';
-        };
-      }
-      // edf { name = "darwin"; } #Disable Darwin (macOS) support.
-      // edf { name = "xsmp"; } #Disable XSMP session management
-      // edf { name = "xsmp_interact"; } #Disable XSMP interaction
-      // edf { name = "mzscheme"; } #Include MzScheme interpreter.
-      // edf { name = "perl"; feat = "perlinterp"; enable = { nativeBuildInputs = [perl]; };} #Include Perl interpreter.
-
-      // edf {
-        name = "python";
-        feat = "pythoninterp";
-        enable = {
-          nativeBuildInputs = [ python ];
-        } // lib.optionalAttrs stdenv.isDarwin {
-          configureFlags
-            = [ "--enable-pythoninterp=yes"
-                "--with-python-config-dir=${python}/lib" ];
-        };
-      }
-
-      // edf { name = "tcl"; enable = { nativeBuildInputs = [tcl]; }; } #Include Tcl interpreter.
-      // edf { name = "ruby"; feat = "rubyinterp"; enable = { nativeBuildInputs = [ruby]; };} #Include Ruby interpreter.
-      // edf {
-        name = "lua";
-        feat = "luainterp";
-        enable = {
-          nativeBuildInputs = [lua];
-          configureFlags = [
-            "--with-lua-prefix=${args.lua}"
-            "--enable-luainterp"
-          ];
-        };
-      }
-      // edf { name = "cscope"; } #Include cscope interface.
-      // edf { name = "workshop"; } #Include Sun Visual Workshop support.
-      // edf { name = "netbeans"; } #Disable NetBeans integration support.
-      // edf { name = "sniff"; feat = "sniff" ; } #Include Sniff interface.
-      // edf { name = "multibyte"; } #Include multibyte editing support.
-      // edf { name = "hangulinput"; feat = "hangulinput" ;} #Include Hangul input support.
-      // edf { name = "xim"; } #Include XIM input support.
-      // edf { name = "fontset"; } #Include X fontset output support.
-      // edf { name = "acl"; } #Don't check for ACL support.
-      // edf { name = "gpm"; } #Don't use gpm (Linux mouse daemon).
-      // edf { name = "nls"; enable = {nativeBuildInputs = [gettext];}; } #Don't support NLS (gettext()).
-      ;
-
-  cfg = {
-    luaSupport       = config.vim.lua or true;
-    pythonSupport    = config.vim.python or true;
-    rubySupport      = config.vim.ruby or true;
-    nlsSupport       = config.vim.nls or false;
-    tclSupport       = config.vim.tcl or false;
-    multibyteSupport = config.vim.multibyte or false;
-    cscopeSupport    = config.vim.cscope or false;
-    netbeansSupport  = config.netbeans or true; # eg envim is using it
-
-    # by default, compile with darwin support if we're compiling on darwin, but
-    # allow this to be disabled by setting config.vim.darwin to false
-    darwinSupport    = stdenv.isDarwin && (config.vim.darwin or true);
-
-    # add .nix filetype detection and minimal syntax highlighting support
-    ftNixSupport     = config.vim.ftNix or true;
+  src = fetchgit {
+    url = https://bitbucket.org/equalsraf/vim-qt.git;
+    rev = "refs/tags/package-" + tag;
+    inherit sha256;
   };
 
+  # FIXME: adopt Darwin fixes from vim/default.nix, then chage meta.platforms.linux
+  # to meta.platforms.unix
+  preConfigure = assert (! stdenv.isDarwin); "";
+
+  configureFlags = [
+    "--with-vim-name=qvim"
+    "--enable-gui=qt"
+    "--with-features=${features}"
+    "--disable-xsmp"
+    "--disable-xsmp_interact"
+    "--disable-workshop"          # Sun Visual Workshop support
+    "--disable-sniff"             # Sniff interface
+    "--disable-hangulinput"       # Hangul input support
+    "--disable-fontset"           # X fontset output support
+    "--disable-acl"               # ACL support
+    "--disable-gpm"               # GPM (Linux mouse daemon)
+    "--disable-mzscheme"
+  ]
+  ++ stdenv.lib.optionals luaSupport [
+    "--with-lua-prefix=${lua}"
+    "--enable-luainterp"
+  ]
+  ++ stdenv.lib.optional pythonSupport      "--enable-pythoninterp"
+  ++ stdenv.lib.optional (pythonSupport && stdenv.isDarwin) "--with-python-config-dir=${python}/lib"
+  ++ stdenv.lib.optional nlsSupport         "--enable-nls"
+  ++ stdenv.lib.optional perlSupport        "--enable-perlinterp"
+  ++ stdenv.lib.optional rubySupport        "--enable-rubyinterp"
+  ++ stdenv.lib.optional tclSupport         "--enable-tcl"
+  ++ stdenv.lib.optional multibyteSupport   "--enable-multibyte"
+  ++ stdenv.lib.optional darwinSupport      "--enable-darwin"
+  ++ stdenv.lib.optional cscopeSupport      "--enable-cscope";
+
+  nativeBuildInputs = [ ncurses pkgconfig libX11 libXext libSM libXpm libXt libXaw
+    libXau libXmu libICE qt4
+  ]
+  ++ stdenv.lib.optional nlsSupport gettext
+  ++ stdenv.lib.optional perlSupport perl
+  ++ stdenv.lib.optional pythonSupport python
+  ++ stdenv.lib.optional tclSupport tcl
+  ++ stdenv.lib.optional rubySupport ruby
+  ++ stdenv.lib.optional luaSupport lua
+  ;
+
+  postPatch = ''
+  '' + stdenv.lib.optionalString ftNixSupport ''
+    # because we cd to src in the main patch phase, we can't just add this
+    # patch to the list, we have to apply it manually
+    cd runtime
+    patch -p2 < ${./ft-nix-support.patch}
+    cd ..
+  '';
+
   postInstall = stdenv.lib.optionalString stdenv.isLinux ''
     rpath=`patchelf --print-rpath $out/bin/qvim`;
     for i in $nativeBuildInputs; do
@@ -125,5 +109,5 @@ composableDerivation {
     maintainers = with maintainers; [ smironov ttuegel ];
     platforms   = platforms.linux;
   };
-})
+}
 

From cd4ed379186946bd980e10b092b82f8f4fe42143 Mon Sep 17 00:00:00 2001
From: "R. RyanTM" <ryantm+bot@ryantm.com>
Date: Sat, 21 Jul 2018 15:59:46 -0700
Subject: [PATCH 06/34] libfilezilla: 0.12.3 -> 0.13.0

Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/libfilezilla/versions.
---
 pkgs/development/libraries/libfilezilla/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/libraries/libfilezilla/default.nix b/pkgs/development/libraries/libfilezilla/default.nix
index a86cf9b935c..367f1c9aadd 100644
--- a/pkgs/development/libraries/libfilezilla/default.nix
+++ b/pkgs/development/libraries/libfilezilla/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libfilezilla-${version}";
-  version = "0.12.3";
+  version = "0.13.0";
 
   src = fetchurl {
     url = "http://download.filezilla-project.org/libfilezilla/${name}.tar.bz2";
-    sha256 = "1v606kcz2rdmmlwxrv3xvwh7ia1nh6jfc9bhjw2r4ai3rm16gch5";
+    sha256 = "0sk8kz2zrvf7kp9jrp3l4rpipv4xh0hg8d4h734xyag7vd03rjpz";
   };
 
   meta = with stdenv.lib; {

From 7dde18891f1e67269e3e9c18ec5e8c3ce7c76823 Mon Sep 17 00:00:00 2001
From: Daiderd Jordan <daiderd@gmail.com>
Date: Tue, 24 Jul 2018 21:53:58 +0200
Subject: [PATCH 07/34] ycmd: 2018-06-14 -> 2018-07-24

Also added missing parso library, this caused issues with the python
semantic completion (and possibly others)
---
 pkgs/development/tools/misc/ycmd/default.nix | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkgs/development/tools/misc/ycmd/default.nix b/pkgs/development/tools/misc/ycmd/default.nix
index 2eb9b453661..c0e12aa22c4 100644
--- a/pkgs/development/tools/misc/ycmd/default.nix
+++ b/pkgs/development/tools/misc/ycmd/default.nix
@@ -7,12 +7,12 @@
 
 stdenv.mkDerivation rec {
   name = "ycmd-${version}";
-  version = "2018-06-14";
+  version = "2018-07-24";
 
   src = fetchgit {
     url = "https://github.com/Valloric/ycmd.git";
-    rev = "29e36f74f749d10b8d6ce285c1453fac26f15a41";
-    sha256 = "0s62nf18jmgjihyba7lk7si8xrxsg60whdr430nlb5gjikag8zr5";
+    rev = "f8a8b04892b925efeee24298a957cc6d6a69ad06";
+    sha256 = "1br2sh6bs0fg1axq2hq9f48fz8klkzydi1mf0j0jdsh3zjzkmxbn";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
 
     mkdir -p $out/lib/ycmd/third_party/{gocode,godef,racerd/target/release}
 
-    for p in jedi waitress frozendict bottle python-future requests; do
+    for p in jedi waitress frozendict bottle parso python-future requests; do
       cp -r third_party/$p $out/lib/ycmd/third_party
     done
 

From 4eb70fbd22217e35e3970c664f975f1674155826 Mon Sep 17 00:00:00 2001
From: Daiderd Jordan <daiderd@gmail.com>
Date: Tue, 24 Jul 2018 21:56:15 +0200
Subject: [PATCH 08/34] vim-youcompleteme: 2018-06-20 -> 2018-07-24

---
 pkgs/misc/vim-plugins/default.nix | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix
index b52e6324199..8a9580d99e1 100644
--- a/pkgs/misc/vim-plugins/default.nix
+++ b/pkgs/misc/vim-plugins/default.nix
@@ -2848,11 +2848,11 @@ let
   };
 
   youcompleteme = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "youcompleteme-2018-06-20";
+    name = "youcompleteme-2018-07-24";
     src = fetchgit {
       url = "https://github.com/valloric/youcompleteme";
-      rev = "e1ead995c13fe20989ee3d69fd76b20c5fff5d5b";
-      sha256 = "01my9m7a5m24zrh6i867fhqz42jxs0ai2pl4pra8wzvyk4ai1p5f";
+      rev = "459b3e620e45191b15c48c66b02ff89f1a0674db";
+      sha256 = "0s4sndx0mm13xcb559agfcqqdwhp2sr7kpp4ksc9gx41k7626rdr";
     };
     dependencies = [];
     buildPhase = ''
@@ -3259,7 +3259,7 @@ let
       sha256 = "0hj5bhfhd9am11ixaxad370p982bjig53mbm74fi6slhjpikdrdq";
     };
     dependencies = [];
-    buildInputs = [ python3 ]; 
+    buildInputs = [ python3 ];
     buildPhase = ''
       pushd ./rplugin/python3/deoplete/ujson
       python3 setup.py build --build-base=$PWD/build --build-lib=$PWD/build

From 8b306bab12b10a207fccd50f66b24e6cfdda673f Mon Sep 17 00:00:00 2001
From: Carlos D <carlos.dagostino@gmail.com>
Date: Wed, 25 Jul 2018 11:35:02 +1000
Subject: [PATCH 09/34] cntlm: add support for darwin

---
 pkgs/tools/networking/cntlm/default.nix | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pkgs/tools/networking/cntlm/default.nix b/pkgs/tools/networking/cntlm/default.nix
index efd2c17a43e..6267e3a7790 100644
--- a/pkgs/tools/networking/cntlm/default.nix
+++ b/pkgs/tools/networking/cntlm/default.nix
@@ -11,6 +11,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ which ];
 
+  preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace "xlc_r gcc" "xlc_r gcc $CC"
+    substitute Makefile Makefile.$CC --replace "CC=gcc" "CC=$CC"
+  '';
+
   installPhase = ''
     mkdir -p $out/bin; cp cntlm $out/bin/;
     mkdir -p $out/share/; cp COPYRIGHT README VERSION doc/cntlm.conf $out/share/;
@@ -21,11 +26,12 @@ stdenv.mkDerivation rec {
     description = "NTLM/NTLMv2 authenticating HTTP proxy";
     homepage = http://cntlm.sourceforge.net/;
     license = licenses.gpl2;
-    maintainers = 
+    maintainers =
       [
         maintainers.qknight
         maintainers.markWot
+        maintainers.carlosdagos
       ];
-    platforms = platforms.linux;
+    platforms = platforms.linux ++ platforms.darwin;
   };
 }

From 0438900c7a3f138df81a68a8228375db5884671f Mon Sep 17 00:00:00 2001
From: Ruben Maher <ruben@maher.fyi>
Date: Wed, 25 Jul 2018 11:34:32 +0930
Subject: [PATCH 10/34] eot_utilities: change platforms to unix

This works on Darwin too.
---
 pkgs/tools/misc/eot-utilities/default.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/tools/misc/eot-utilities/default.nix b/pkgs/tools/misc/eot-utilities/default.nix
index b44159be8ce..b9efead2798 100644
--- a/pkgs/tools/misc/eot-utilities/default.nix
+++ b/pkgs/tools/misc/eot-utilities/default.nix
@@ -17,6 +17,6 @@ stdenv.mkDerivation rec {
     description = "Create Embedded Open Type from OpenType or TrueType font";
     license = stdenv.lib.licenses.w3c;
     maintainers = with stdenv.lib.maintainers; [ leenaars ];
-    platforms = with stdenv.lib.platforms; linux; 
+    platforms = with stdenv.lib.platforms; unix;
   };
 }

From 87357fc39c170c16b83d07fa24063a12534e8097 Mon Sep 17 00:00:00 2001
From: John Ericson <John.Ericson@Obsidian.Systems>
Date: Wed, 25 Jul 2018 03:55:09 -0400
Subject: [PATCH 11/34] cross stdenv: Forget `allowedRequisites = nulll;` on
 inline

---
 pkgs/stdenv/cross/default.nix   | 1 +
 pkgs/top-level/all-packages.nix | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix
index 29521874d1e..bc8d772530a 100644
--- a/pkgs/stdenv/cross/default.nix
+++ b/pkgs/stdenv/cross/default.nix
@@ -43,6 +43,7 @@ in lib.init bootStages ++ [
       # a different platform, and so are disabled.
       overrides = _: _: {};
       extraBuildInputs = [ ]; # Old ones run on wrong platform
+      allowedRequisites = null;
 
       cc = if crossSystem.useiOSPrebuilt or false
              then buildPackages.darwin.iosSdkPkgs.clang
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 38ffc52b2ba..e96e3977e02 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -34,7 +34,8 @@ with pkgs;
       extraPackages = [];
       inherit bintools;
     };
-    allowedRequisites = stdenv.allowedRequisites ++ [ bintools ];
+    allowedRequisites =
+      lib.mapNullable (rs: rs ++ [ bintools ]) (stdenv.allowedRequisites or null);
   };
 
   # For convenience, allow callers to get the path to Nixpkgs.

From 09cfb65c99cbf1f1d7d4fe45bc09adc8afb2b2f4 Mon Sep 17 00:00:00 2001
From: Periklis Tsirakidis <periklis.tsirakidis@holidaycheck.com>
Date: Sat, 21 Jul 2018 16:15:29 +0200
Subject: [PATCH 12/34] skhd: bump 0.1.1 to 0.2.2

---
 pkgs/os-specific/darwin/skhd/default.nix | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkgs/os-specific/darwin/skhd/default.nix b/pkgs/os-specific/darwin/skhd/default.nix
index c51ada10d68..b3bf590bf26 100644
--- a/pkgs/os-specific/darwin/skhd/default.nix
+++ b/pkgs/os-specific/darwin/skhd/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "skhd-${version}";
-  version = "0.1.1";
+  version = "0.2.2";
 
   src = fetchFromGitHub {
     owner = "koekeishiya";
     repo = "skhd";
     rev = "v${version}";
-    sha256 = "1wh7v90ydh27gbaiwn2r6ncx6yiic4mph3w9vi1282nz2q02zxss";
+    sha256 = "0mn6svz2mqbpwlx510r447vflfcxryykpin6h6429dlz0wjlipa8";
   };
 
   buildInputs = [ Carbon ];
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     description = "Simple hotkey daemon for macOS";
     homepage = https://github.com/koekeishiya/skhd;
     platforms = platforms.darwin;
-    maintainers = with maintainers; [ lnl7 ];
+    maintainers = with maintainers; [ lnl7 periklis ];
     license = licenses.mit;
   };
 }

From cd5095c0ee9115158668f949f4a7700bb0130142 Mon Sep 17 00:00:00 2001
From: Tuomas Tynkkynen <tuomas@tuxera.com>
Date: Wed, 25 Jul 2018 15:54:40 +0300
Subject: [PATCH 13/34] simg2img: Init at 1.1.3

---
 pkgs/tools/filesystems/simg2img/default.nix | 25 +++++++++++++++++++++
 pkgs/top-level/all-packages.nix             |  2 ++
 2 files changed, 27 insertions(+)
 create mode 100644 pkgs/tools/filesystems/simg2img/default.nix

diff --git a/pkgs/tools/filesystems/simg2img/default.nix b/pkgs/tools/filesystems/simg2img/default.nix
new file mode 100644
index 00000000000..94c45ec4689
--- /dev/null
+++ b/pkgs/tools/filesystems/simg2img/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, zlib }:
+
+stdenv.mkDerivation rec {
+  name = "simg2img-${version}";
+  version = "1.1.3";
+
+  src = fetchFromGitHub {
+    owner = "anestisb";
+    repo = "android-simg2img";
+    rev = "${version}";
+    sha256 = "119gl9i61g2wr07hzv6mi1ihql6yd6pwq94ki2pgcpfbamv8f6si";
+  };
+
+  buildInputs = [ zlib ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "Tool to convert Android sparse images to raw images";
+    homepage = "https://github.com/anestisb/android-simg2img";
+    license = licenses.asl20;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.dezgeg ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index a8844e3949e..fae84d49120 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1439,6 +1439,8 @@ with pkgs;
 
   s2png = callPackage ../tools/graphics/s2png { };
 
+  simg2img = callPackage ../tools/filesystems/simg2img { };
+
   socklog = callPackage ../tools/system/socklog { };
 
   staccato = callPackage ../tools/text/staccato { };

From 9f22576897b272300b48c312c5956cfab66acfc6 Mon Sep 17 00:00:00 2001
From: Anthony Cowley <acowley@gmail.com>
Date: Tue, 17 Jul 2018 14:32:29 -0400
Subject: [PATCH 14/34] pcl: boost167 compatibility

Cherry pick an upstream commit not yet available in a tagged release.
---
 pkgs/development/libraries/pcl/default.nix | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/pkgs/development/libraries/pcl/default.nix b/pkgs/development/libraries/pcl/default.nix
index 59f674789e4..9fb2e0b7fed 100644
--- a/pkgs/development/libraries/pcl/default.nix
+++ b/pkgs/development/libraries/pcl/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchFromGitHub, cmake, qhull, flann, boost, vtk, eigen, pkgconfig, qtbase
+{ stdenv, fetchFromGitHub, fetchpatch, cmake
+, qhull, flann, boost, vtk, eigen, pkgconfig, qtbase
 , libusb1, libpcap, libXt, libpng, Cocoa, AGL, cf-private, OpenGL
 }:
 
@@ -12,6 +13,14 @@ stdenv.mkDerivation rec {
     sha256 = "05wvqqi2fyk5innw4mg356r71c1hmc9alc7xkf4g81ds3b3867xq";
   };
 
+  patches = [
+    # boost-1.67 compatibility
+    (fetchpatch {
+      url = "https://github.com/PointCloudLibrary/pcl/commit/2309bdab20fb2a385d374db6a87349199279db18.patch";
+      sha256 = "112p4687xrm0vsm0magmkvsm1hpks9hj42fm0lncy3yy2j1v3r4h";
+      name = "boost167-random.patch";
+  })];
+
   enableParallelBuilding = true;
 
   nativeBuildInputs = [ pkgconfig cmake ];

From 7a1a0036e6f6108bd12f65d2473bf080e3841da4 Mon Sep 17 00:00:00 2001
From: Lorenzo Manacorda <lorenzo@mailbox.org>
Date: Wed, 25 Jul 2018 15:55:16 +0200
Subject: [PATCH 15/34] buildMaven: Check for authenticated attribute

The `authenticated` attribute is not always present in the
`project-info.json` produced by maven2nix[0]

We therefore check for its presence, and default it to false.

[0]: https://github.com/NixOS/mvn2nix-maven-plugin/issues/5#issuecomment-311846950
---
 pkgs/build-support/build-maven.nix | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pkgs/build-support/build-maven.nix b/pkgs/build-support/build-maven.nix
index 30df3e8e733..b9da06c43c8 100644
--- a/pkgs/build-support/build-maven.nix
+++ b/pkgs/build-support/build-maven.nix
@@ -16,10 +16,11 @@ infoFile: let
   script = writeText "build-maven-repository.sh" ''
     ${lib.concatStrings (map (dep: let
       inherit (dep)
-        url sha1 groupId artifactId version
-        authenticated metadata repository-id;
+        url sha1 groupId artifactId
+        version metadata repository-id;
 
       versionDir = dep.unresolved-version or version;
+      authenticated = dep.authenticated or false;
 
       fetch = (if authenticated then requireFile else fetchurl) {
         inherit url sha1;

From 49ae194b2353bffa255ae86c09feb0e9c2d0f6e1 Mon Sep 17 00:00:00 2001
From: Sage <neonfuz@gmail.com>
Date: Wed, 25 Jul 2018 07:14:14 -0700
Subject: [PATCH 16/34] yaxg: init at 2018-07-20

* yaxg: init at 2018-07-20

* yaxg: replaced makeWrapper with wrapProgram

* yaxg: Fixed version number and some formatting
---
 maintainers/maintainer-list.nix      |  5 ++++
 pkgs/tools/graphics/yaxg/default.nix | 38 ++++++++++++++++++++++++++++
 pkgs/top-level/all-packages.nix      |  2 ++
 3 files changed, 45 insertions(+)
 create mode 100644 pkgs/tools/graphics/yaxg/default.nix

diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index a51183e727d..5a13e97b685 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -2737,6 +2737,11 @@
     github = "neeasade";
     name = "Nathan Isom";
   };
+  neonfuz = {
+    email = "neonfuz@gmail.com";
+    github = "neonfuz";
+    name = "Sage Raflik";
+  };
   nequissimus = {
     email = "tim@nequissimus.com";
     github = "nequissimus";
diff --git a/pkgs/tools/graphics/yaxg/default.nix b/pkgs/tools/graphics/yaxg/default.nix
new file mode 100644
index 00000000000..8fbc09a6d82
--- /dev/null
+++ b/pkgs/tools/graphics/yaxg/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, makeWrapper,
+  maim, slop, ffmpeg, byzanz, libnotify, xdpyinfo }:
+
+stdenv.mkDerivation rec {
+  name = "yaxg-${version}";
+  version = "unstable-2018-05-03";
+
+  src = fetchFromGitHub {
+    owner = "DanielFGray";
+    repo = "yaxg";
+    rev = "9d6af75da2ec25dba4b8d784e431064033d67ad2";
+    sha256 = "01p6ghp1vfrlnrm78bgbl9ppqwsdxh761g0qa172dpvsqg91l1p6";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ maim slop ffmpeg byzanz libnotify xdpyinfo ];
+
+  installPhase = ''
+    mkdir -p $out/bin/
+    mv yaxg $out/bin/
+    chmod +x $out/bin/yaxg
+    wrapProgram $out/bin/yaxg --prefix PATH : ${ stdenv.lib.makeBinPath [ maim slop ffmpeg byzanz libnotify xdpyinfo ]}
+  '';
+
+  meta = with stdenv.lib; {
+    inherit (src.meta) homepage;
+    description = "Yet Another X Grabber script";
+    longDescription = ''
+      Capture and record your screen with callbacks. Wraps maim, slop, ffmpeg,
+      and byzanz to enable still image, video, or gif recording of part or all
+      of your screen. Similar command-line interface to scrot but is overall
+      more flexible and less buggy.
+    '';
+    platforms = platforms.all;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ neonfuz ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index fae84d49120..97f6fff299d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -21825,6 +21825,8 @@ with pkgs;
 
   yara = callPackage ../tools/security/yara { };
 
+  yaxg = callPackage ../tools/graphics/yaxg {};
+
   zap = callPackage ../tools/networking/zap { };
 
   zdfmediathk = callPackage ../applications/video/zdfmediathk { };

From 8fb92a733e447fdc785bb43061d6f3ef3110a32b Mon Sep 17 00:00:00 2001
From: "Wael M. Nasreddine" <wael.nasreddine@gmail.com>
Date: Tue, 24 Jul 2018 12:43:26 -0700
Subject: [PATCH 17/34] kubetail: init at 1.6.1

---
 .../networking/cluster/kubetail/default.nix   | 30 +++++++++++++++++++
 pkgs/top-level/all-packages.nix               |  2 ++
 2 files changed, 32 insertions(+)
 create mode 100644 pkgs/applications/networking/cluster/kubetail/default.nix

diff --git a/pkgs/applications/networking/cluster/kubetail/default.nix b/pkgs/applications/networking/cluster/kubetail/default.nix
new file mode 100644
index 00000000000..201e3e8b30d
--- /dev/null
+++ b/pkgs/applications/networking/cluster/kubetail/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchFromGitHub, lib, ... }:
+
+stdenv.mkDerivation rec {
+  name = "kubetail-${version}";
+  version = "1.6.1";
+
+  src = fetchFromGitHub {
+    owner = "johanhaleby";
+    repo = "kubetail";
+    rev = "${version}";
+    sha256 = "10ql1kdsmyrk73jb6f5saf2q38znm0vdihscj3c9n0qhyhk9blpl";
+  };
+
+  installPhase = ''
+    install -Dm755 kubetail $out/bin/kubetail
+  '';
+
+  meta = with lib; {
+    description = "Bash script to tail Kubernetes logs from multiple pods at the same time";
+    longDescription = ''
+      Bash script that enables you to aggregate (tail/follow) logs from
+      multiple pods into one stream. This is the same as running "kubectl logs
+      -f " but for multiple pods.
+    '';
+    homepage = https://github.com/johanhaleby/kubetail;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ kalbasit ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 97f6fff299d..3605640430b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16969,6 +16969,8 @@ with pkgs;
 
   kubernetes-helm = callPackage ../applications/networking/cluster/helm { };
 
+  kubetail = callPackage ../applications/networking/cluster/kubetail { } ;
+
   kupfer = callPackage ../applications/misc/kupfer { };
 
   lame = callPackage ../development/libraries/lame { };

From 059c2312be70ce5734ffa7c4bf3f1973a8d25236 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Domen=20Ko=C5=BEar?= <domen@dev.si>
Date: Wed, 25 Jul 2018 15:17:39 +0100
Subject: [PATCH 18/34] haskell: move yaml overrides to configuration-nix

---
 pkgs/development/haskell-modules/configuration-common.nix | 3 ---
 pkgs/development/haskell-modules/configuration-nix.nix    | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index b1e2a3da3fd..1ec0adafef8 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -829,9 +829,6 @@ self: super: {
   # https://github.com/fizruk/http-api-data/issues/49
   http-api-data = dontCheck super.http-api-data;
 
-  # https://github.com/snoyberg/yaml/issues/106
-  yaml = disableCabalFlag super.yaml "system-libyaml";
-
   # https://github.com/diagrams/diagrams-lib/issues/288
   diagrams-lib = overrideCabal super.diagrams-lib (drv: { doCheck = !pkgs.stdenv.isi686; });
 
diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix
index 3e4b18d86b9..a6cfef6f45f 100644
--- a/pkgs/development/haskell-modules/configuration-nix.nix
+++ b/pkgs/development/haskell-modules/configuration-nix.nix
@@ -309,6 +309,9 @@ self: super: builtins.intersectAttrs super {
   # https://github.com/bos/pcap/issues/5
   pcap = addExtraLibrary super.pcap pkgs.libpcap;
 
+  # https://github.com/snoyberg/yaml/issues/106
+  yaml = disableCabalFlag super.yaml "system-libyaml";
+
   # The cabal files for these libraries do not list the required system dependencies.
   miniball = overrideCabal super.miniball (drv: {
     librarySystemDepends = [ pkgs.miniball ];

From a8f54972f4047a72c6d4e91ec5a6f62bdbd15da2 Mon Sep 17 00:00:00 2001
From: Erik Arvstedt <erik.arvstedt@gmail.com>
Date: Wed, 25 Jul 2018 16:34:49 +0200
Subject: [PATCH 19/34] python docs: improve overlay example

The `pythonPackages` definition is redundant
---
 doc/languages-frameworks/python.section.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md
index 298920ce166..dcb0ea0600b 100644
--- a/doc/languages-frameworks/python.section.md
+++ b/doc/languages-frameworks/python.section.md
@@ -1032,7 +1032,7 @@ self: super:
 {
   python = super.python.override {
     packageOverrides = python-self: python-super: {
-      bepasty-server = python-super.bepasty-server.overrideAttrs ( oldAttrs: {
+      bepasty-server = python-super.bepasty-server.overrideAttrs (oldAttrs: {
         src = self.pkgs.fetchgit {
           url = "https://github.com/bepasty/bepasty-server";
           sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
@@ -1041,7 +1041,6 @@ self: super:
       });
     };
   };
-  pythonPackages = self.python.pkgs;
 }
 ```
 

From a0383ffec82244cef7f72d71759c674f5bb30d97 Mon Sep 17 00:00:00 2001
From: WilliButz <wbutz@cyberfnord.de>
Date: Wed, 25 Jul 2018 17:05:57 +0200
Subject: [PATCH 20/34] grafana: 5.2.1 -> 5.2.2

---
 pkgs/servers/monitoring/grafana/default.nix | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkgs/servers/monitoring/grafana/default.nix b/pkgs/servers/monitoring/grafana/default.nix
index 217ac3f6d91..4385a4e020c 100644
--- a/pkgs/servers/monitoring/grafana/default.nix
+++ b/pkgs/servers/monitoring/grafana/default.nix
@@ -1,7 +1,7 @@
 { lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
 
 buildGoPackage rec {
-  version = "5.2.1";
+  version = "5.2.2";
   name = "grafana-${version}";
   goPackagePath = "github.com/grafana/grafana";
 
@@ -9,12 +9,12 @@ buildGoPackage rec {
     rev = "v${version}";
     owner = "grafana";
     repo = "grafana";
-    sha256 = "0gv7g6ddcmdkjd1xp9dg2kq7askzaw1vkmcii21glqb74k2jfg74";
+    sha256 = "17w8ljq4p1sxcdpsiz4221gwhi3ykggpisnx1wdw22g2160q9sdj";
   };
 
   srcStatic = fetchurl {
     url = "https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${version}.linux-amd64.tar.gz";
-    sha256 = "0j69a9cjvkknq19aa2l634b48zy1lwmv2p676hzc856zgq3h6m9m";
+    sha256 = "1frbk13sww3sw09mpkijii1kf7m19hqg58ps8gvs4dvxg12bbv3l";
   };
 
   postPatch = ''

From a2833a06b926bb88175ce3fe4b2d16df8a1dfba9 Mon Sep 17 00:00:00 2001
From: Tim Steinbach <tim@nequissimus.com>
Date: Wed, 25 Jul 2018 14:20:55 -0400
Subject: [PATCH 21/34] linux: 4.4.143 -> 4.4.144

---
 pkgs/os-specific/linux/kernel/linux-4.4.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix
index f654853eca4..d4a2c56a894 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.4.nix
@@ -1,11 +1,11 @@
 { stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 buildLinux (args // rec {
-  version = "4.4.143";
+  version = "4.4.144";
   extraMeta.branch = "4.4";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "0n737jdk9ms7v7zkhf45nfdg2jcyap4qpzxm162f4q9zz3sh0dif";
+    sha256 = "11lsf62qd9qm6n6ilxwx0zag3phvfmfjpbdc24j4p2c9gfgqpyss";
   };
 } // (args.argsOverride or {}))

From 0fde78112e24cdf839acb708583816df011232f0 Mon Sep 17 00:00:00 2001
From: Tim Steinbach <tim@nequissimus.com>
Date: Wed, 25 Jul 2018 14:21:03 -0400
Subject: [PATCH 22/34] linux: 4.9.114 -> 4.9.115

---
 pkgs/os-specific/linux/kernel/linux-4.9.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix
index aff61de93be..3fe55b2a6f3 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.9.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix
@@ -1,11 +1,11 @@
 { stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 buildLinux (args // rec {
-  version = "4.9.114";
+  version = "4.9.115";
   extraMeta.branch = "4.9";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1c3j82rcnj03bk5s2i11mhksv5l09hmkfs3rpbj5msnrn123ds76";
+    sha256 = "0fddhw9v5l8k2j31zlfikd2g397ngyynfbwg92z17vp510fxjf20";
   };
 } // (args.argsOverride or {}))

From 6cd6eb051368001cd7e87ce63c4852642209cc24 Mon Sep 17 00:00:00 2001
From: Tim Steinbach <tim@nequissimus.com>
Date: Wed, 25 Jul 2018 14:21:12 -0400
Subject: [PATCH 23/34] linux: 4.14.57 -> 4.14.58

---
 pkgs/os-specific/linux/kernel/linux-4.14.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/os-specific/linux/kernel/linux-4.14.nix b/pkgs/os-specific/linux/kernel/linux-4.14.nix
index 4a364a824d9..2bff43c93de 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.14.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.14.nix
@@ -3,7 +3,7 @@
 with stdenv.lib;
 
 buildLinux (args // rec {
-  version = "4.14.57";
+  version = "4.14.58";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "046qvgf44sn51g979whzvc6qrbz31gwxwm9xkka93vmqavr415aa";
+    sha256 = "1zfyrcfsx9410gnjk1hrjs5d4p93qm6k2r9q24i5c1nhfhzf0rgz";
   };
 } // (args.argsOverride or {}))

From 202e270bbfe65baf16e585caa57a91affbdd48a0 Mon Sep 17 00:00:00 2001
From: Tim Steinbach <tim@nequissimus.com>
Date: Wed, 25 Jul 2018 14:21:20 -0400
Subject: [PATCH 24/34] linux: 4.17.9 -> 4.17.10

---
 pkgs/os-specific/linux/kernel/linux-4.17.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/os-specific/linux/kernel/linux-4.17.nix b/pkgs/os-specific/linux/kernel/linux-4.17.nix
index 9de96398e3e..2ac619232d4 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.17.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.17.nix
@@ -3,7 +3,7 @@
 with stdenv.lib;
 
 buildLinux (args // rec {
-  version = "4.17.9";
+  version = "4.17.10";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1frsg1qli4922w172mx96n0l7yzhiw6kirzzw4svsq3qsfnxq57x";
+    sha256 = "1s0vzzdcixy2m3ybd9z1h5b2wiiz2mgnwn09jxvj1v4rwjix457a";
   };
 } // (args.argsOverride or {}))

From 100349d605688e13e2dc4de1d56819a01c1c96e6 Mon Sep 17 00:00:00 2001
From: Luke Adams <luke.adams@belljar.io>
Date: Tue, 24 Jul 2018 21:52:57 -0500
Subject: [PATCH 25/34] pyserial: fix build on Darwin

---
 pkgs/development/python-modules/pyserial/default.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/development/python-modules/pyserial/default.nix b/pkgs/development/python-modules/pyserial/default.nix
index 508104d3312..c7787a42691 100644
--- a/pkgs/development/python-modules/pyserial/default.nix
+++ b/pkgs/development/python-modules/pyserial/default.nix
@@ -10,7 +10,7 @@ buildPythonPackage rec {
   };
 
   checkPhase = "python -m unittest discover -s test";
-  doInstallCheck = !hostPlatform.isDarwin; # broken on darwin
+  doCheck = !hostPlatform.isDarwin; # broken on darwin
 
   meta = with lib; {
     homepage = "https://github.com/pyserial/pyserial";

From 42e3727aa2bfbac5a13396fef388324fbb3f080c Mon Sep 17 00:00:00 2001
From: Erik Arvstedt <erik.arvstedt@gmail.com>
Date: Wed, 25 Jul 2018 21:29:25 +0200
Subject: [PATCH 26/34] python docs: improve override example

1. Use the same approach like in the overlay example:
   Override `python` instead of `pythonPackages` so that
   `python.pkgs` refers to the new package set like `pythonPackages`.

   This also fixes a bug in the original example where
   `pkgs.fetchgit` was not in scope.

   Add an extra example to illustrate how to override just a
   package set.

2. Fix mix-up between `super` and `self` in the explanation text.
   Also, simplify the explanation.
---
 doc/languages-frameworks/python.section.md | 30 +++++++++++++++-------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md
index dcb0ea0600b..b42d2e67bcf 100644
--- a/doc/languages-frameworks/python.section.md
+++ b/doc/languages-frameworks/python.section.md
@@ -1006,14 +1006,14 @@ folder and not downloaded again.
 If you need to change a package's attribute(s) from `configuration.nix` you could do:
 
 ```nix
-  nixpkgs.config.packageOverrides = superP: {
-    pythonPackages = superP.pythonPackages.override {
-      overrides = self: super: {
-        bepasty-server = super.bepasty-server.overrideAttrs ( oldAttrs: {
-          src = pkgs.fetchgit {
+  nixpkgs.config.packageOverrides = super: {
+    python = super.python.override {
+      packageOverrides = python-self: python-super: {
+        bepasty-server = python-super.bepasty-server.overrideAttrs (oldAttrs: {
+          src = super.fetchgit {
             url = "https://github.com/bepasty/bepasty-server";
-            sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
             rev = "e2516e8cf4f2afb5185337073607eb9e84a61d2d";
+            sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
           };
         });
       };
@@ -1021,11 +1021,23 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
   };
 ```
 
-If you are using the `bepasty-server` package somewhere, for example in `systemPackages` or indirectly from `services.bepasty`, then a `nixos-rebuild switch` will rebuild the system but with the `bepasty-server` package using a different `src` attribute. This way one can modify `python` based software/libraries easily. Using `self` and `super` one can also alter dependencies (`buildInputs`) between the old state (`self`) and new state (`super`).
+If you are using the `bepasty-server` package somewhere, for example in `systemPackages` or indirectly from `services.bepasty`, then a `nixos-rebuild switch` will rebuild the system but with the `bepasty-server` package using a different `src` attribute. This way one can modify `python` based software/libraries easily.
+Note that `python-super` refers to the old package set and `python-self`
+to the new, overridden version.
+
+To modify only a Python package set instead of a whole Python derivation, use this snippet:
+
+```nix
+  myPythonPackages = pythonPackages.override {
+    overrides = self: super: {
+      bepasty-server = ...;
+    };
+  }
+```
 
 ### How to override a Python package using overlays?
 
-To alter a python package using overlays, you would use the following approach:
+Use the following overlay template:
 
 ```nix
 self: super:
@@ -1035,8 +1047,8 @@ self: super:
       bepasty-server = python-super.bepasty-server.overrideAttrs (oldAttrs: {
         src = self.pkgs.fetchgit {
           url = "https://github.com/bepasty/bepasty-server";
-          sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
           rev = "e2516e8cf4f2afb5185337073607eb9e84a61d2d";
+          sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
         };
       });
     };

From fa01100f4069b1a493e3d100c54a0bc1f69d2be2 Mon Sep 17 00:00:00 2001
From: Erik Arvstedt <erik.arvstedt@gmail.com>
Date: Wed, 25 Jul 2018 21:32:16 +0200
Subject: [PATCH 27/34] python-docs: fix override examples

Use example package `zerobin` instead of `bepasty-server` which
is no longer part of python-packages.
This fixes the examples for current nixpkgs versions.
---
 doc/languages-frameworks/python.section.md | 23 +++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md
index b42d2e67bcf..410c8e20044 100644
--- a/doc/languages-frameworks/python.section.md
+++ b/doc/languages-frameworks/python.section.md
@@ -1009,11 +1009,11 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
   nixpkgs.config.packageOverrides = super: {
     python = super.python.override {
       packageOverrides = python-self: python-super: {
-        bepasty-server = python-super.bepasty-server.overrideAttrs (oldAttrs: {
+        zerobin = python-super.zerobin.overrideAttrs (oldAttrs: {
           src = super.fetchgit {
-            url = "https://github.com/bepasty/bepasty-server";
-            rev = "e2516e8cf4f2afb5185337073607eb9e84a61d2d";
-            sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
+            url = "https://github.com/sametmax/0bin";
+            rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec";
+            sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji";
           };
         });
       };
@@ -1021,7 +1021,8 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
   };
 ```
 
-If you are using the `bepasty-server` package somewhere, for example in `systemPackages` or indirectly from `services.bepasty`, then a `nixos-rebuild switch` will rebuild the system but with the `bepasty-server` package using a different `src` attribute. This way one can modify `python` based software/libraries easily.
+`pythonPackages.zerobin` is now globally overriden. All packages and also the
+`zerobin` NixOS service use the new definition.
 Note that `python-super` refers to the old package set and `python-self`
 to the new, overridden version.
 
@@ -1030,7 +1031,7 @@ To modify only a Python package set instead of a whole Python derivation, use th
 ```nix
   myPythonPackages = pythonPackages.override {
     overrides = self: super: {
-      bepasty-server = ...;
+      zerobin = ...;
     };
   }
 ```
@@ -1044,11 +1045,11 @@ self: super:
 {
   python = super.python.override {
     packageOverrides = python-self: python-super: {
-      bepasty-server = python-super.bepasty-server.overrideAttrs (oldAttrs: {
-        src = self.pkgs.fetchgit {
-          url = "https://github.com/bepasty/bepasty-server";
-          rev = "e2516e8cf4f2afb5185337073607eb9e84a61d2d";
-          sha256 = "9ziqshmsf0rjvdhhca55sm0x8jz76fsf2q4rwh4m6lpcf8wr0nps";
+      zerobin = python-super.zerobin.overrideAttrs (oldAttrs: {
+        src = super.fetchgit {
+          url = "https://github.com/sametmax/0bin";
+          rev = "a344dbb18fe7a855d0742b9a1cede7ce423b34ec";
+          sha256 = "16d769kmnrpbdr0ph0whyf4yff5df6zi4kmwx7sz1d3r6c8p6xji";
         };
       });
     };

From 7ca34b2bdd37584ae33b7685ef199873ddac19d6 Mon Sep 17 00:00:00 2001
From: Ryan Trinkle <ryan.trinkle@gmail.com>
Date: Wed, 25 Jul 2018 16:27:12 -0400
Subject: [PATCH 28/34] azure-cli: delete empty nix file

---
 pkgs/tools/admin/azure-cli/default.nix | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 pkgs/tools/admin/azure-cli/default.nix

diff --git a/pkgs/tools/admin/azure-cli/default.nix b/pkgs/tools/admin/azure-cli/default.nix
deleted file mode 100644
index e69de29bb2d..00000000000

From 46cd782b43416969b1f11232ecf5b80e798a92a2 Mon Sep 17 00:00:00 2001
From: Michael Weiss <dev.primeos@gmail.com>
Date: Wed, 25 Jul 2018 23:30:19 +0200
Subject: [PATCH 29/34] fuse3: 3.2.4 -> 3.2.5 (security, CVE-2018-10906)

Upstream changelog:
- SECURITY UPDATE: In previous versions of libfuse it was possible to
  for unprivileged users to specify the allow_other option even when
  this was forbidden in /etc/fuse.conf. The vulnerability is present
  only on systems where SELinux is active (including in permissive
  mode).
- The fusermount binary has been hardened in several ways to reduce
  potential attack surface. Most importantly, mountpoints and mount
  options must now match a hard-coded whitelist. It is expected that
  this whitelist covers all regular use-cases.
- Added a test of seekdir to test_syscalls.
- Fixed readdir bug when non-zero offsets are given to filler and the
  filesystem client, after reading a whole directory, re-reads it from a
  non-zero offset e. g. by calling seekdir followed by readdir.
---
 pkgs/os-specific/linux/fuse/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/os-specific/linux/fuse/default.nix b/pkgs/os-specific/linux/fuse/default.nix
index 594f966c2f4..4c750dafcf7 100644
--- a/pkgs/os-specific/linux/fuse/default.nix
+++ b/pkgs/os-specific/linux/fuse/default.nix
@@ -11,7 +11,7 @@ in {
   };
 
   fuse_3 = mkFuse {
-    version = "3.2.4";
-    sha256Hash = "1ybgd4s7naiyvaris7j6fzp604cgi5mgrn715x8l4kn5k9d840im";
+    version = "3.2.5";
+    sha256Hash = "0ibf2isbkm8p1gfaqpqblwsg0lm4s1rmcipv1qcg0wc4wwsbnqpx";
   };
 }

From ec1082c58fec2f0739855d4dc01df6fdd335e0a3 Mon Sep 17 00:00:00 2001
From: Michael Weiss <dev.primeos@gmail.com>
Date: Wed, 25 Jul 2018 23:48:13 +0200
Subject: [PATCH 30/34] fuse: 2.9.7 -> 2.9.8 (security, CVE-2018-10906)

Upstream changelog:
- SECURITY UPDATE: In previous versions of libfuse it was possible to
  for unprivileged users to specify the allow_other option even when
  this was forbidden in /etc/fuse.conf. The vulnerability is present
  only on systems where SELinux is active (including in permissive
  mode).
- libfuse no longer segfaults when fuse_interrupted() is called outside
  the event loop.
- The fusermount binary has been hardened in several ways to reduce
  potential attack surface. Most importantly, mountpoints and mount
  options must now match a hard-coded whitelist. It is expected that
  this whitelist covers all regular use-cases.
- Fixed rename deadlock on FreeBSD.
---
 pkgs/os-specific/linux/fuse/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/os-specific/linux/fuse/default.nix b/pkgs/os-specific/linux/fuse/default.nix
index 4c750dafcf7..64484113167 100644
--- a/pkgs/os-specific/linux/fuse/default.nix
+++ b/pkgs/os-specific/linux/fuse/default.nix
@@ -6,8 +6,8 @@ let
   };
 in {
   fuse_2 = mkFuse {
-    version = "2.9.7";
-    sha256Hash = "1wyjjfb7p4jrkk15zryzv33096a5fmsdyr2p4b00dd819wnly2n2";
+    version = "2.9.8";
+    sha256Hash = "0s04ln4k9zvvbjih8ybaa19fxg8xv7dcsz2yrlbk35psnf3l67af";
   };
 
   fuse_3 = mkFuse {

From 4758fe7c564bd5cb55c351930201fcafcca1bd4a Mon Sep 17 00:00:00 2001
From: Carlos D <carlos.dagostino@gmail.com>
Date: Thu, 26 Jul 2018 12:56:44 +1000
Subject: [PATCH 31/34] kustomize: init at 1.0.4

---
 pkgs/development/tools/kustomize/default.nix | 28 ++++++++++++++++++++
 pkgs/top-level/all-packages.nix              |  2 ++
 2 files changed, 30 insertions(+)
 create mode 100644 pkgs/development/tools/kustomize/default.nix

diff --git a/pkgs/development/tools/kustomize/default.nix b/pkgs/development/tools/kustomize/default.nix
new file mode 100644
index 00000000000..4f9512b2213
--- /dev/null
+++ b/pkgs/development/tools/kustomize/default.nix
@@ -0,0 +1,28 @@
+# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "kustomize-${version}";
+  version = "1.0.4";
+
+  goPackagePath = "github.com/kubernetes-sigs/kustomize";
+
+  src = fetchFromGitHub {
+    sha256 = "0lbf94wz34axaf8ps7h79qbj4dpihrpvnqa12zrawcmmgqallwhm";
+    rev = "v${version}";
+    repo = "kustomize";
+    owner = "kubernetes-sigs";
+  };
+
+  meta = with lib; {
+    description = "Customization of kubernetes YAML configurations";
+    longDescription = ''
+      kustomize lets you customize raw, template-free YAML files for
+      multiple purposes, leaving the original YAML untouched and usable
+      as is.
+    '';
+    homepage = https://github.com/kubernetes-sigs/kustomize;
+    license = licenses.asl20;
+    maintainers = [ maintainers.carlosdagos ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 83803d3788c..0801a5cec07 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8288,6 +8288,8 @@ with pkgs;
 
   kube-aws = callPackage ../development/tools/kube-aws { };
 
+  kustomize = callPackage ../development/tools/kustomize { };
+
   Literate = callPackage ../development/tools/literate-programming/Literate {};
 
   lcov = callPackage ../development/tools/analysis/lcov { };

From 7b1632c84138a0c232ed46dcd5f31e5d9a240627 Mon Sep 17 00:00:00 2001
From: Roman Volosatovs <rvolosatovs@riseup.net>
Date: Thu, 26 Jul 2018 10:01:42 +0200
Subject: [PATCH 32/34] dep: 0.4.1 -> 0.5.0

---
 pkgs/development/tools/dep/default.nix | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkgs/development/tools/dep/default.nix b/pkgs/development/tools/dep/default.nix
index 0d4f72fad80..283193a485c 100644
--- a/pkgs/development/tools/dep/default.nix
+++ b/pkgs/development/tools/dep/default.nix
@@ -2,7 +2,7 @@
 
 buildGoPackage rec {
   name = "dep-${version}";
-  version = "0.4.1";
+  version = "0.5.0";
   rev = "v${version}";
 
   goPackagePath = "github.com/golang/dep";
@@ -12,7 +12,7 @@ buildGoPackage rec {
     inherit rev;
     owner = "golang";
     repo = "dep";
-    sha256 = "0183xq5l4sinnclynv6xi85vmk69mqpy5wjfsgh8bxwziq3vkd7y";
+    sha256 = "1p35995w2f8rp4cxhcwnhdv26ajx6gxx9pm2ijb5sjy2pwhw5c6j";
   };
 
   buildFlagsArray = ("-ldflags=-s -w -X main.commitHash=${rev} -X main.version=${version}");
@@ -22,6 +22,6 @@ buildGoPackage rec {
     description = "Go dependency management tool";
     license = licenses.bsd3;
     platforms = platforms.all;
-    maintainers = [ maintainers.carlsverre ];
+    maintainers = with maintainers; [ carlsverre rvolosatovs ];
   };
 }

From 75e71ad2166e00c8e0f9edb947c834618fe4c6c4 Mon Sep 17 00:00:00 2001
From: Johan Thomsen <jth@dbc.dk>
Date: Thu, 26 Jul 2018 11:20:36 +0200
Subject: [PATCH 33/34] cfssl: 20170527 -> 1.3.2

---
 pkgs/tools/security/cfssl/default.nix | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkgs/tools/security/cfssl/default.nix b/pkgs/tools/security/cfssl/default.nix
index b3c256ae59b..cce3370aeda 100644
--- a/pkgs/tools/security/cfssl/default.nix
+++ b/pkgs/tools/security/cfssl/default.nix
@@ -2,15 +2,15 @@
 
 buildGoPackage rec {
   name = "cfssl-${version}";
-  version = "20170527";
+  version = "1.3.2";
 
   goPackagePath = "github.com/cloudflare/cfssl";
 
   src = fetchFromGitHub {
     owner = "cloudflare";
     repo = "cfssl";
-    rev = "114dc9691ec7bf3dac49d5953eccf7d91a0e0904";
-    sha256 = "1ijq43mrzrf1gkgj5ssxq7sgy6sd4rl706dzqkq9krqv5f6kwhj1";
+    rev = version;
+    sha256 = "0j2gz2vl2pf7ir7sc7jrwmjnr67hk4qhxw09cjx132jbk337jc9x";
   };
 
   meta = with stdenv.lib; {

From ae9932e4312991cc3d3d611f541bab7d6567f392 Mon Sep 17 00:00:00 2001
From: Frederik Rietdijk <fridh@fridh.nl>
Date: Sat, 21 Jul 2018 17:41:48 +0200
Subject: [PATCH 34/34] php: get rid of composableDerivation

Some bugs may have creeped in during the conversion.
One flag I had trouble with and so removed was:

    "--enable-embedded-mysqli"
---
 .../setup-hooks/remove-pytest-cache.sh        |   1 +
 pkgs/development/interpreters/php/default.nix | 411 ++++++------------
 .../python-modules/wxPython/4.0.nix           |  41 ++
 3 files changed, 186 insertions(+), 267 deletions(-)
 create mode 100644 pkgs/build-support/setup-hooks/remove-pytest-cache.sh
 create mode 100644 pkgs/development/python-modules/wxPython/4.0.nix

diff --git a/pkgs/build-support/setup-hooks/remove-pytest-cache.sh b/pkgs/build-support/setup-hooks/remove-pytest-cache.sh
new file mode 100644
index 00000000000..7f3e08bfa67
--- /dev/null
+++ b/pkgs/build-support/setup-hooks/remove-pytest-cache.sh
@@ -0,0 +1 @@
+postFixupHooks+=
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index 6a7b994ee98..7c866911c59 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -1,21 +1,63 @@
 # pcre functionality is tested in nixos/tests/php-pcre.nix
-
-{ lib, stdenv, fetchurl, composableDerivation, flex, bison
-, mysql, libxml2, readline, zlib, curl, postgresql, gettext, html-tidy
+{ lib, stdenv, fetchurl, flex, bison
+, mysql, libxml2, readline, zlib, curl, postgresql, gettext
 , openssl, pcre, pkgconfig, sqlite, config, libjpeg, libpng, freetype
 , libxslt, libmcrypt, bzip2, icu, openldap, cyrus_sasl, libmhash, freetds
-, uwimap, pam, gmp, apacheHttpd, libiconv, systemd, libsodium }:
+, uwimap, pam, gmp, apacheHttpd, libiconv, systemd, libsodium, html-tidy
+}:
+
+with lib;
 
 let
-
+  php7 = versionAtLeast version "7.0";
   generic =
-    { version, sha256 }:
+  { version
+  , sha256
+  , imapSupport ? config.php.imap or (!stdenv.isDarwin)
+  , ldapSupport ? config.php.ldap or true
+  , mhashSupport ? config.php.mhash or true
+  , mysqlSupport ? (config.php.mysql or true) && (!php7)
+  , mysqlndSupport ? config.php.mysqlnd or false
+  , mysqliSupport ? config.php.mysqli or true
+  , pdo_mysqlSupport ? config.php.pdo_mysql or true
+  , libxml2Support ? config.php.libxml2 or true
+  , apxs2Support ? config.php.apxs2 or (!stdenv.isDarwin)
+  , embedSupport ? config.php.embed or false
+  , bcmathSupport ? config.php.bcmath or true
+  , socketsSupport ? config.php.sockets or true
+  , curlSupport ? config.php.curl or true
+  , curlWrappersSupport ? (config.php.curlWrappers or true) && (!php7)
+  , gettextSupport ? config.php.gettext or true
+  , pcntlSupport ? config.php.pcntl or true
+  , postgresqlSupport ? config.php.postgresql or true
+  , pdo_pgsqlSupport ? config.php.pdo_pgsql or true
+  , readlineSupport ? config.php.readline or true
+  , sqliteSupport ? config.php.sqlite or true
+  , soapSupport ? config.php.soap or true
+  , zlibSupport ? config.php.zlib or true
+  , opensslSupport ? config.php.openssl or true
+  , mbstringSupport ? config.php.mbstring or true
+  , gdSupport ? config.php.gd or true
+  , intlSupport ? config.php.intl or true
+  , exifSupport ? config.php.exif or true
+  , xslSupport ? config.php.xsl or false
+  , mcryptSupport ? config.php.mcrypt or true
+  , bz2Support ? config.php.bz2 or false
+  , zipSupport ? config.php.zip or true
+  , ftpSupport ? config.php.ftp or true
+  , fpmSupport ? config.php.fpm or true
+  , gmpSupport ? config.php.gmp or true
+  , mssqlSupport ? (config.php.mssql or (!stdenv.isDarwin)) && (!php7)
+  , ztsSupport ? config.php.zts or false
+  , calendarSupport ? config.php.calendar or true
+  , sodiumSupport ? (config.php.sodium or true) && (versionAtLeast version "7.2")
+  , tidySupport ? false
+  }:
 
-    let php7 = lib.versionAtLeast version "7.0";
-        mysqlndSupport = config.php.mysqlnd or false;
-        mysqlBuildInputs = lib.optional (!mysqlndSupport) mysql.connector-c;
-
-    in composableDerivation.composableDerivation {} (fixed: {
+    let
+      mysqlBuildInputs = optional (!mysqlndSupport) mysql.connector-c;
+      libmcrypt' = libmcrypt.override { disablePosixThreads = true; };
+    in stdenv.mkDerivation {
 
       inherit version;
 
@@ -25,258 +67,99 @@ let
 
       nativeBuildInputs = [ pkgconfig ];
       buildInputs = [ flex bison pcre ]
-        ++ lib.optional stdenv.isLinux systemd;
+        ++ optional stdenv.isLinux systemd
+        ++ optionals imapSupport [ uwimap openssl pam ]
+        ++ optionals curlSupport [ curl openssl ]
+        ++ optionals ldapSupport [ openldap openssl ]
+        ++ optionals gdSupport [ libpng libjpeg freetype ]
+        ++ optionals opensslSupport [ openssl openssl.dev ]
+        ++ optional apxs2Support apacheHttpd
+        ++ optional (ldapSupport && stdenv.isLinux) cyrus_sasl
+        ++ optional mhashSupport libmhash
+        ++ optional zlibSupport zlib
+        ++ optional libxml2Support libxml2
+        ++ optional readlineSupport readline
+        ++ optional sqliteSupport sqlite
+        ++ optional postgresqlSupport postgresql
+        ++ optional pdo_pgsqlSupport postgresql
+        ++ optional pdo_mysqlSupport mysqlBuildInputs
+        ++ optional mysqlSupport mysqlBuildInputs
+        ++ optional mysqliSupport mysqlBuildInputs
+        ++ optional gmpSupport gmp
+        ++ optional gettextSupport gettext
+        ++ optional intlSupport icu
+        ++ optional xslSupport libxslt
+        ++ optional mcryptSupport libmcrypt'
+        ++ optional bz2Support bzip2
+        ++ optional (mssqlSupport && !stdenv.isDarwin) freetds
+        ++ optional sodiumSupport libsodium
+        ++ optional tidySupport html-tidy;
 
-      CXXFLAGS = lib.optional stdenv.cc.isClang "-std=c++11";
+      CXXFLAGS = optional stdenv.cc.isClang "-std=c++11";
 
-      flags = {
 
-        # much left to do here...
+      configureFlags = [
+        "--with-config-file-scan-dir=/etc/php.d"
+        "--with-pcre-regex=${pcre.dev} PCRE_LIBDIR=${pcre}"
+      ]
+      ++ optional stdenv.isDarwin "--with-iconv=${libiconv}"
+      ++ optional stdenv.isLinux  "--with-fpm-systemd"
+      ++ optionals imapSupport [
+        "--with-imap=${uwimap}"
+        "--with-imap-ssl"
+      ]
+      ++ optionals ldapSupport [
+        "--with-ldap=/invalid/path"
+        "LDAP_DIR=${openldap.dev}"
+        "LDAP_INCDIR=${openldap.dev}/include"
+        "LDAP_LIBDIR=${openldap.out}/lib"
+      ]
+      ++ optional (ldapSupport && stdenv.isLinux)   "--with-ldap-sasl=${cyrus_sasl.dev}"
+      ++ optional apxs2Support "--with-apxs2=${apacheHttpd.dev}/bin/apxs"
+      ++ optional embedSupport "--enable-embed"
+      ++ optional mhashSupport "--with-mhash"
+      ++ optional curlSupport "--with-curl=${curl.dev}"
+      ++ optional curlWrappersSupport "--with-curlwrappers"
+      ++ optional zlibSupport "--with-zlib=${zlib.dev}"
+      ++ optional libxml2Support "--with-libxml-dir=${libxml2.dev}"
+      ++ optional pcntlSupport "--enable-pcntl"
+      ++ optional readlineSupport "--with-readline=${readline.dev}"
+      ++ optional sqliteSupport "--with-pdo-sqlite=${sqlite.dev}"
+      ++ optional postgresqlSupport "--with-pgsql=${postgresql}"
+      ++ optional pdo_pgsqlSupport "--with-pdo-pgsql=${postgresql}"
+      ++ optional pdo_mysqlSupport "--with-pdo-mysql=${if mysqlndSupport then "mysqlnd" else mysql.connector-c}"
+      ++ optional mysqlSupport "--with-mysql${if mysqlndSupport then "=mysqlnd" else ""}"
+      ++ optionals mysqliSupport [
+        "--with-mysqli=${if mysqlndSupport then "mysqlnd" else "${mysql.connector-c}/bin/mysql_config"}"
+      ]
+      ++ optional bcmathSupport "--enable-bcmath"
+      # FIXME: Our own gd package doesn't work, see https://bugs.php.net/bug.php?id=60108.
+      ++ optionals gdSupport [
+        "--with-gd"
+        "--with-freetype-dir=${freetype.dev}"
+        "--with-png-dir=${libpng.dev}"
+        "--with-jpeg-dir=${libjpeg.dev}"
+      ]
+      ++ optional gmpSupport "--with-gmp=${gmp.dev}"
+      ++ optional soapSupport "--enable-soap"
+      ++ optional socketsSupport "--enable-sockets"
+      ++ optional opensslSupport "--with-openssl"
+      ++ optional mbstringSupport "--enable-mbstring"
+      ++ optional gettextSupport "--with-gettext=${gettext}"
+      ++ optional intlSupport "--enable-intl"
+      ++ optional exifSupport "--enable-exif"
+      ++ optional xslSupport "--with-xsl=${libxslt.dev}"
+      ++ optional mcryptSupport "--with-mcrypt=${libmcrypt'}"
+      ++ optional bz2Support "--with-bz2=${bzip2.dev}"
+      ++ optional zipSupport "--enable-zip"
+      ++ optional ftpSupport "--enable-ftp"
+      ++ optional fpmSupport "--enable-fpm"
+      ++ optional (mssqlSupport && !stdenv.isDarwin) "--with-mssql=${freetds}"
+      ++ optional ztsSupport "--enable-maintainer-zts"
+      ++ optional calendarSupport "--enable-calendar"
+      ++ optional sodiumSupport "--with-sodium=${libsodium.dev}"
+      ++ optional tidySupport "--with-tidy=${html-tidy}";
 
-        # SAPI modules:
-
-        apxs2 = {
-          configureFlags = ["--with-apxs2=${apacheHttpd.dev}/bin/apxs"];
-          buildInputs = [apacheHttpd];
-        };
-
-        embed = {
-          configureFlags = ["--enable-embed"];
-        };
-
-        # Extensions
-        imap = {
-          configureFlags = [
-            "--with-imap=${uwimap}"
-            "--with-imap-ssl"
-            ];
-          buildInputs = [ uwimap openssl pam ];
-        };
-
-        ldap = {
-          configureFlags = [
-            "--with-ldap=/invalid/path"
-            "LDAP_DIR=${openldap.dev}"
-            "LDAP_INCDIR=${openldap.dev}/include"
-            "LDAP_LIBDIR=${openldap.out}/lib"
-            (lib.optional stdenv.isLinux "--with-ldap-sasl=${cyrus_sasl.dev}")
-            ];
-          buildInputs = [openldap openssl] ++ lib.optional stdenv.isLinux cyrus_sasl;
-        };
-
-        mhash = {
-          configureFlags = ["--with-mhash"];
-          buildInputs = [libmhash];
-        };
-
-        curl = {
-          configureFlags = ["--with-curl=${curl.dev}"];
-          buildInputs = [curl openssl];
-        };
-
-        curlWrappers = {
-          configureFlags = ["--with-curlwrappers"];
-        };
-
-        zlib = {
-          configureFlags = ["--with-zlib=${zlib.dev}"];
-          buildInputs = [zlib];
-        };
-
-        libxml2 = {
-          configureFlags = [
-            "--with-libxml-dir=${libxml2.dev}"
-            ];
-          buildInputs = [ libxml2 ];
-        };
-
-        pcntl = {
-          configureFlags = [ "--enable-pcntl" ];
-        };
-
-        readline = {
-          configureFlags = ["--with-readline=${readline.dev}"];
-          buildInputs = [ readline ];
-        };
-
-        sqlite = {
-          configureFlags = ["--with-pdo-sqlite=${sqlite.dev}"];
-          buildInputs = [ sqlite ];
-        };
-
-        postgresql = {
-          configureFlags = ["--with-pgsql=${postgresql}"];
-          buildInputs = [ postgresql ];
-        };
-
-        pdo_pgsql = {
-          configureFlags = ["--with-pdo-pgsql=${postgresql}"];
-          buildInputs = [ postgresql ];
-        };
-
-        mysql = {
-          configureFlags = ["--with-mysql${if mysqlndSupport then "=mysqlnd" else ""}"];
-          buildInputs = mysqlBuildInputs;
-        };
-
-        mysqli = {
-          configureFlags = ["--with-mysqli=${if mysqlndSupport then "mysqlnd" else "${mysql.connector-c}/bin/mysql_config"}"];
-          buildInputs = mysqlBuildInputs;
-        };
-
-        mysqli_embedded = {
-          configureFlags = ["--enable-embedded-mysqli"];
-          depends = "mysqli";
-          assertion = fixed.mysqliSupport;
-        };
-
-        pdo_mysql = {
-          configureFlags = ["--with-pdo-mysql=${if mysqlndSupport then "mysqlnd" else mysql.connector-c}"];
-          buildInputs = mysqlBuildInputs;
-        };
-
-        bcmath = {
-          configureFlags = ["--enable-bcmath"];
-        };
-
-        gd = {
-          # FIXME: Our own gd package doesn't work, see https://bugs.php.net/bug.php?id=60108.
-          configureFlags = [
-            "--with-gd"
-            "--with-freetype-dir=${freetype.dev}"
-            "--with-png-dir=${libpng.dev}"
-            "--with-jpeg-dir=${libjpeg.dev}"
-          ];
-          buildInputs = [ libpng libjpeg freetype ];
-        };
-
-        gmp = {
-          configureFlags = ["--with-gmp=${gmp.dev}"];
-          buildInputs = [ gmp ];
-        };
-
-        soap = {
-          configureFlags = ["--enable-soap"];
-        };
-
-        sockets = {
-          configureFlags = ["--enable-sockets"];
-        };
-
-        openssl = {
-          configureFlags = ["--with-openssl"];
-          buildInputs = [openssl openssl.dev];
-        };
-
-        mbstring = {
-          configureFlags = ["--enable-mbstring"];
-        };
-
-        gettext = {
-          configureFlags = ["--with-gettext=${gettext}"];
-          buildInputs = [gettext];
-        };
-
-        intl = {
-          configureFlags = ["--enable-intl"];
-          buildInputs = [icu];
-        };
-
-        exif = {
-          configureFlags = ["--enable-exif"];
-        };
-
-        xsl = {
-          configureFlags = ["--with-xsl=${libxslt.dev}"];
-          buildInputs = [libxslt];
-        };
-
-        mcrypt = let libmcrypt' = libmcrypt.override { disablePosixThreads = true; }; in {
-          configureFlags = ["--with-mcrypt=${libmcrypt'}"];
-          buildInputs = [libmcrypt'];
-        };
-
-        bz2 = {
-          configureFlags = ["--with-bz2=${bzip2.dev}"];
-          buildInputs = [bzip2];
-        };
-
-        zip = {
-          configureFlags = ["--enable-zip"];
-        };
-
-        ftp = {
-          configureFlags = ["--enable-ftp"];
-        };
-
-        fpm = {
-          configureFlags = ["--enable-fpm"];
-        };
-
-        mssql = stdenv.lib.optionalAttrs (!stdenv.isDarwin) {
-          configureFlags = ["--with-mssql=${freetds}"];
-          buildInputs = [freetds];
-        };
-
-        zts = {
-          configureFlags = ["--enable-maintainer-zts"];
-        };
-
-        calendar = {
-          configureFlags = ["--enable-calendar"];
-        };
-
-        sodium = {
-          configureFlags = ["--with-sodium=${libsodium.dev}"];
-          buildInputs = [libsodium];
-        };
-
-        tidy = {
-          configureFlags = [ "--with-tidy=${html-tidy}" ];
-          buildInputs = [ html-tidy ];
-        };
-      };
-
-      cfg = {
-        imapSupport = config.php.imap or (!stdenv.isDarwin);
-        ldapSupport = config.php.ldap or true;
-        mhashSupport = config.php.mhash or true;
-        mysqlSupport = (!php7) && (config.php.mysql or true);
-        mysqliSupport = config.php.mysqli or true;
-        pdo_mysqlSupport = config.php.pdo_mysql or true;
-        libxml2Support = config.php.libxml2 or true;
-        apxs2Support = config.php.apxs2 or (!stdenv.isDarwin);
-        embedSupport = config.php.embed or false;
-        bcmathSupport = config.php.bcmath or true;
-        socketsSupport = config.php.sockets or true;
-        curlSupport = config.php.curl or true;
-        curlWrappersSupport = (!php7) && (config.php.curlWrappers or true);
-        gettextSupport = config.php.gettext or true;
-        pcntlSupport = config.php.pcntl or true;
-        postgresqlSupport = config.php.postgresql or true;
-        pdo_pgsqlSupport = config.php.pdo_pgsql or true;
-        readlineSupport = config.php.readline or true;
-        sqliteSupport = config.php.sqlite or true;
-        soapSupport = config.php.soap or true;
-        zlibSupport = config.php.zlib or true;
-        opensslSupport = config.php.openssl or true;
-        mbstringSupport = config.php.mbstring or true;
-        gdSupport = config.php.gd or true;
-        intlSupport = config.php.intl or true;
-        exifSupport = config.php.exif or true;
-        xslSupport = config.php.xsl or false;
-        mcryptSupport = config.php.mcrypt or true;
-        bz2Support = config.php.bz2 or false;
-        zipSupport = config.php.zip or true;
-        ftpSupport = config.php.ftp or true;
-        fpmSupport = config.php.fpm or true;
-        gmpSupport = config.php.gmp or true;
-        mssqlSupport = (!php7) && (config.php.mssql or (!stdenv.isDarwin));
-        ztsSupport = config.php.zts or false;
-        calendarSupport = config.php.calendar or true;
-        sodiumSupport = (lib.versionAtLeast version "7.2") && config.php.sodium or true;
-        tidySupport = php7 && config.php.tidy or true;
-      };
 
       hardeningDisable = [ "bindnow" ];
 
@@ -298,12 +181,6 @@ let
           --includedir=$dev/include)
       '';
 
-      configureFlags = [
-        "--with-config-file-scan-dir=/etc/php.d"
-        "--with-pcre-regex=${pcre.dev} PCRE_LIBDIR=${pcre}"
-      ] ++ lib.optional stdenv.isDarwin "--with-iconv=${libiconv}"
-        ++ lib.optional stdenv.isLinux  "--with-fpm-systemd";
-
       postInstall = ''
         cp php.ini-production $out/etc/php.ini
       '';
@@ -332,7 +209,7 @@ let
 
       patches = if !php7 then [ ./fix-paths.patch ] else [ ./fix-paths-php7.patch ];
 
-      postPatch = lib.optional stdenv.isDarwin ''
+      postPatch = optional stdenv.isDarwin ''
         substituteInPlace configure --replace "-lstdc++" "-lc++"
       '';
 
@@ -340,7 +217,7 @@ let
 
       outputs = [ "out" "dev" ];
 
-    });
+    };
 
 in {
   php56 = generic {
diff --git a/pkgs/development/python-modules/wxPython/4.0.nix b/pkgs/development/python-modules/wxPython/4.0.nix
new file mode 100644
index 00000000000..39e3d7fb3fa
--- /dev/null
+++ b/pkgs/development/python-modules/wxPython/4.0.nix
@@ -0,0 +1,41 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pkgconfig
+, gtk3
+, libjpeg
+, libtiff
+, SDL
+, gst-plugins-base
+, libnotify
+, freeglut
+, xorg
+, which
+}:
+
+buildPythonPackage rec {
+  pname = "wxPython";
+  version = "4.0.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "8d0dfc0146c24749ce00d575e35cc2826372e809d5bc4a57bde6c89031b59e75";
+  };
+
+  nativeBuildInputs = [
+    pkgconfig
+  ];
+
+  buildInputs = [
+    gtk3 libjpeg libtiff SDL gst-plugins-base libnotify freeglut xorg.libSM
+    which
+  ];
+
+
+  meta = {
+    description = "Cross platform GUI toolkit for Python, Phoenix version";
+    homepage = http://wxpython.org/;
+    license = lib.licenses.wxWindows;
+  };
+
+}
\ No newline at end of file