summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/systems/parse.nix4
-rw-r--r--maintainers/maintainer-list.nix10
-rw-r--r--nixos/modules/config/pulseaudio.nix2
-rw-r--r--nixos/modules/installer/cd-dvd/channel.nix2
-rw-r--r--nixos/modules/installer/tools/nixos-generate-config.pl1
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/programs/bash/bash.nix2
-rw-r--r--nixos/modules/services/editors/emacs.nix21
-rw-r--r--nixos/modules/services/hardware/trezord.nix2
-rw-r--r--nixos/modules/services/monitoring/grafana.nix2
-rw-r--r--nixos/modules/services/networking/dnscache.nix31
-rw-r--r--nixos/modules/services/networking/prosody.nix26
-rw-r--r--nixos/modules/services/networking/shadowsocks.nix112
-rw-r--r--nixos/modules/services/torrent/transmission.nix1
-rw-r--r--nixos/modules/tasks/filesystems/exfat.nix2
-rw-r--r--nixos/modules/tasks/filesystems/zfs.nix2
-rw-r--r--nixos/modules/virtualisation/lxc.nix5
-rw-r--r--nixos/modules/virtualisation/lxd.nix60
-rw-r--r--nixos/release.nix9
-rw-r--r--nixos/tests/docker-tools-overlay.nix32
-rw-r--r--nixos/tests/docker-tools.nix6
-rw-r--r--nixos/tests/kernel-copperhead.nix4
-rw-r--r--pkgs/applications/audio/asunder/default.nix4
-rw-r--r--pkgs/applications/audio/caps/default.nix6
-rw-r--r--pkgs/applications/audio/eq10q/default.nix11
-rw-r--r--pkgs/applications/audio/ncmpcpp/default.nix4
-rw-r--r--pkgs/applications/audio/spotify/default.nix4
-rw-r--r--pkgs/applications/editors/ghostwriter/default.nix4
-rw-r--r--pkgs/applications/editors/sublime/3/packages.nix8
-rw-r--r--pkgs/applications/editors/vscode/default.nix8
-rw-r--r--pkgs/applications/gis/grass/default.nix5
-rw-r--r--pkgs/applications/gis/qgis/default.nix6
-rw-r--r--pkgs/applications/graphics/dosage/default.nix28
-rw-r--r--pkgs/applications/graphics/k3d/default.nix19
-rw-r--r--pkgs/applications/graphics/paraview/default.nix24
-rw-r--r--pkgs/applications/graphics/shotwell/default.nix4
-rw-r--r--pkgs/applications/kde/default.nix1
-rw-r--r--pkgs/applications/kde/kalarm.nix37
-rw-r--r--pkgs/applications/misc/alacritty/default.nix2
-rw-r--r--pkgs/applications/misc/cbatticon/default.nix4
-rw-r--r--pkgs/applications/misc/guake/default.nix78
-rw-r--r--pkgs/applications/misc/masterpdfeditor/default.nix4
-rw-r--r--pkgs/applications/misc/slic3r-prusa3d/default.nix3
-rw-r--r--pkgs/applications/misc/terminator/default.nix16
-rw-r--r--pkgs/applications/misc/xtermcontrol/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/firefox-bin/default.nix2
-rw-r--r--pkgs/applications/networking/c14/default.nix9
-rw-r--r--pkgs/applications/networking/cluster/heptio-ark/default.nix25
-rw-r--r--pkgs/applications/networking/instant-messengers/hipchat/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/nheko/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-discord/default.nix31
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-hangouts/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/riot/riot-web.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/signal-desktop/default.nix4
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/default.nix4
-rw-r--r--pkgs/applications/networking/sync/backintime/qt4.nix5
-rw-r--r--pkgs/applications/networking/testssl/default.nix35
-rw-r--r--pkgs/applications/networking/testssl/testssl.patch10
-rw-r--r--pkgs/applications/office/libreoffice/still.nix7
-rw-r--r--pkgs/applications/office/libreoffice/wrapper.sh15
-rw-r--r--pkgs/applications/office/marp/default.nix4
-rw-r--r--pkgs/applications/science/astronomy/celestia/default.nix12
-rw-r--r--pkgs/applications/science/logic/elan/default.nix4
-rw-r--r--pkgs/applications/science/math/maxima/default.nix50
-rw-r--r--pkgs/applications/science/math/singular/default.nix73
-rw-r--r--pkgs/applications/version-management/cvs/default.nix6
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix4
-rw-r--r--pkgs/applications/version-management/sit/default.nix8
-rw-r--r--pkgs/applications/version-management/vcsh/default.nix27
-rw-r--r--pkgs/applications/video/avidemux/default.nix12
-rw-r--r--pkgs/applications/video/handbrake/default.nix10
-rw-r--r--pkgs/applications/video/kazam/bug_1190693.patch14
-rw-r--r--pkgs/applications/video/kazam/datadir.patch11
-rw-r--r--pkgs/applications/video/kazam/default.nix57
-rw-r--r--pkgs/applications/video/kazam/fix-paths.patch22
-rw-r--r--pkgs/applications/virtualization/xen/4.8.nix9
-rw-r--r--pkgs/applications/window-managers/sway/default.nix4
-rw-r--r--pkgs/build-support/bintools-wrapper/macos-sierra-reexport-hack.bash312
-rw-r--r--pkgs/build-support/build-setupcfg/default.nix8
-rw-r--r--pkgs/build-support/kernel/modules-closure.sh14
-rw-r--r--pkgs/build-support/trivial-builders.nix1
-rw-r--r--pkgs/data/icons/papirus-icon-theme/default.nix4
-rw-r--r--pkgs/desktops/gnome-2/platform/gtkglext/default.nix19
-rw-r--r--pkgs/desktops/gnome-3/apps/bijiben/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/apps/evolution/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/apps/gedit/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/apps/glade/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/apps/gnome-boxes/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/apps/gnome-calendar/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/apps/gnome-getting-started-docs/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/apps/gnome-maps/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/apps/gnome-music/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/eog/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/epiphany/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/evince/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/evolution-data-server/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gdm/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gjs/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-calculator/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-contacts/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-control-center/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-desktop/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-disk-utility/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-session/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-software/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-system-monitor/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-terminal/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-user-docs/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-user-share/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/nautilus/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/simple-scan/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/vte/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/yelp/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/zenity/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/devtools/devhelp/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/games/gnome-chess/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/misc/gnome-tweaks/default.nix4
-rwxr-xr-xpkgs/development/compilers/arm-frc-linux-gnueabi-gcc/default.nix98
-rwxr-xr-xpkgs/development/compilers/arm-frc-linux-gnueabi-gcc/minorSOname.patch49
-rwxr-xr-xpkgs/development/compilers/arm-frc-linux-gnueabi-gcc/no-nested-deprecated-warnings.patch22
-rw-r--r--pkgs/development/compilers/coreclr/default.nix17
-rw-r--r--pkgs/development/compilers/rust/default.nix9
-rw-r--r--pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch12
-rw-r--r--pkgs/development/compilers/rust/rustc.nix11
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix3
-rw-r--r--pkgs/development/haskell-modules/configuration-nix.nix1
-rw-r--r--pkgs/development/interpreters/erlang/R20.nix4
-rwxr-xr-xpkgs/development/libraries/arm-frc-linux-gnueabi-eglibc/default.nix65
-rwxr-xr-xpkgs/development/libraries/arm-frc-linux-gnueabi-linux-api-headers/default.nix43
-rw-r--r--pkgs/development/libraries/babl/default.nix4
-rw-r--r--pkgs/development/libraries/caf/default.nix12
-rw-r--r--pkgs/development/libraries/flint/default.nix3
-rw-r--r--pkgs/development/libraries/fplll/default.nix4
-rw-r--r--pkgs/development/libraries/gvfs/default.nix4
-rw-r--r--pkgs/development/libraries/jemalloc/common.nix35
-rw-r--r--pkgs/development/libraries/jemalloc/default.nix36
-rw-r--r--pkgs/development/libraries/jemalloc/jemalloc450.nix6
-rw-r--r--pkgs/development/libraries/kirigami/default.nix47
-rw-r--r--pkgs/development/libraries/libdazzle/default.nix4
-rw-r--r--pkgs/development/libraries/libqrencode/default.nix4
-rw-r--r--pkgs/development/libraries/libwnck/3.x.nix4
-rw-r--r--pkgs/development/libraries/nix-plugins/default.nix4
-rw-r--r--pkgs/development/libraries/openvdb/default.nix4
-rw-r--r--pkgs/development/libraries/qtstyleplugin-kvantum/default.nix15
-rw-r--r--pkgs/development/libraries/rocksdb/default.nix8
-rw-r--r--pkgs/development/libraries/science/math/cliquer/default.nix38
-rw-r--r--pkgs/development/libraries/science/math/m4ri/default.nix30
-rw-r--r--pkgs/development/libraries/science/math/m4rie/default.nix39
-rw-r--r--pkgs/development/node-packages/default-v6.nix13
-rw-r--r--pkgs/development/perl-modules/Socket6-sv_undef.patch18
-rw-r--r--pkgs/development/python-modules/alot/default.nix10
-rw-r--r--pkgs/development/python-modules/apsw/default.nix18
-rw-r--r--pkgs/development/python-modules/cvxopt/default.nix69
-rw-r--r--pkgs/development/python-modules/cysignals/default.nix41
-rw-r--r--pkgs/development/python-modules/digitalocean/default.nix6
-rw-r--r--pkgs/development/python-modules/envs/default.nix24
-rw-r--r--pkgs/development/python-modules/fpylll/default.nix55
-rw-r--r--pkgs/development/python-modules/python-docx/default.nix33
-rw-r--r--pkgs/development/python-modules/rlp/default.nix21
-rw-r--r--pkgs/development/python-modules/rpy2/default.nix54
-rw-r--r--pkgs/development/python-modules/trezor/default.nix4
-rw-r--r--pkgs/development/python-modules/warrant/default.nix36
-rw-r--r--pkgs/development/ruby-modules/bundled-common/default.nix2
-rw-r--r--pkgs/development/ruby-modules/bundler-app/default.nix3
-rw-r--r--pkgs/development/tools/analysis/radare2-cutter/default.nix22
-rw-r--r--pkgs/development/tools/analysis/radare2/default.nix28
-rw-r--r--pkgs/development/tools/build-managers/gnumake/3.82/default.nix3
-rwxr-xr-xpkgs/development/tools/misc/arm-frc-linux-gnueabi-binutils/default.nix50
-rw-r--r--pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix4
-rw-r--r--pkgs/development/tools/parsing/antlr/2.7.7.nix2
-rw-r--r--pkgs/development/tools/rust/bindgen/default.nix6
-rw-r--r--pkgs/development/tools/xcbuild/platform.nix21
-rw-r--r--pkgs/development/tools/xcbuild/setup-hook.sh2
-rw-r--r--pkgs/development/tools/xcbuild/wrapper.nix3
-rw-r--r--pkgs/games/openclonk/default.nix32
-rw-r--r--pkgs/games/quake2/yquake2/default.nix93
-rw-r--r--pkgs/games/quake2/yquake2/games.nix59
-rw-r--r--pkgs/games/quake2/yquake2/wrapper.nix31
-rw-r--r--pkgs/games/sgt-puzzles/default.nix4
-rw-r--r--pkgs/games/wesnoth/dev.nix8
-rw-r--r--pkgs/misc/drivers/gutenprint/default.nix4
-rw-r--r--pkgs/misc/emulators/wine/sources.nix1
-rw-r--r--pkgs/misc/screensavers/i3lock-pixeled/default.nix4
-rw-r--r--pkgs/misc/themes/numix-solarized/default.nix (renamed from pkgs/misc/themes/gtk3/numix-solarized-gtk-theme/default.nix)30
-rw-r--r--pkgs/misc/vim-plugins/default.nix23
-rw-r--r--pkgs/misc/vim-plugins/vim-plugin-names2
-rw-r--r--pkgs/os-specific/darwin/CoreSymbolication/default.nix19
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/SmartCardServices/default.nix41
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix4
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix2
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/default.nix15
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix2
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix32
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/dtrace/xcode.nix45
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix2
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_x509_tp/GNUmakefile1
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libsecurity_codesigning/default.nix38
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix3
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix10
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix2
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/security_systemkeychain/default.nix31
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/shell_cmds/default.nix2
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix25
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/top/default.nix15
-rw-r--r--pkgs/os-specific/darwin/cctools/port.nix14
-rw-r--r--pkgs/os-specific/darwin/darling/default.nix34
-rw-r--r--pkgs/os-specific/darwin/maloader/default.nix1
-rw-r--r--pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix (renamed from pkgs/os-specific/darwin/swift-corefoundation/default.nix)0
-rw-r--r--pkgs/os-specific/darwin/swift-corelibs/default.nix8
-rw-r--r--pkgs/os-specific/darwin/swift-corelibs/libdispatch.nix12
-rw-r--r--pkgs/os-specific/linux/autofs/default.nix4
-rw-r--r--pkgs/os-specific/linux/bluez/bluez5_28.nix82
-rw-r--r--pkgs/os-specific/linux/ipset/default.nix4
-rw-r--r--pkgs/os-specific/linux/iputils/default.nix9
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.14.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.15.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.16.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix11
-rw-r--r--pkgs/os-specific/linux/kmod/aggregator.nix6
-rw-r--r--pkgs/os-specific/linux/rtkit/default.nix6
-rw-r--r--pkgs/os-specific/linux/spl/default.nix1
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix2
-rw-r--r--pkgs/servers/dns/knot-dns/default.nix4
-rw-r--r--pkgs/servers/home-assistant/component-packages.nix12
-rw-r--r--pkgs/servers/home-assistant/default.nix8
-rw-r--r--pkgs/servers/http/jetty/default.nix7
-rw-r--r--pkgs/servers/oauth2_proxy/default.nix20
-rw-r--r--pkgs/servers/oauth2_proxy/deps.nix106
-rw-r--r--pkgs/servers/sql/postgresql/jdbc/default.nix25
-rw-r--r--pkgs/servers/trezord/default.nix65
-rw-r--r--pkgs/servers/trezord/dynamic-link.patch18
-rw-r--r--pkgs/shells/oh-my-zsh/default.nix6
-rw-r--r--pkgs/tools/admin/acme.sh/default.nix28
-rw-r--r--pkgs/tools/admin/fastlane/Gemfile.lock35
-rw-r--r--pkgs/tools/admin/fastlane/gemset.nix63
-rw-r--r--pkgs/tools/admin/iamy/default.nix22
-rw-r--r--pkgs/tools/admin/lxd/default.nix38
-rw-r--r--pkgs/tools/admin/lxd/deps.nix165
-rw-r--r--pkgs/tools/admin/salt/default.nix7
-rw-r--r--pkgs/tools/compression/pbzx/default.nix27
-rw-r--r--pkgs/tools/filesystems/extundelete/default.nix8
-rw-r--r--pkgs/tools/filesystems/mergerfs/default.nix27
-rw-r--r--pkgs/tools/misc/contacts/default.nix2
-rw-r--r--pkgs/tools/misc/linuxquota/default.nix (renamed from pkgs/tools/misc/quota/default.nix)0
-rw-r--r--pkgs/tools/misc/lolcat/Gemfile.lock4
-rw-r--r--pkgs/tools/misc/lolcat/gemset.nix14
-rw-r--r--pkgs/tools/misc/ostree/default.nix8
-rw-r--r--pkgs/tools/misc/peruse/default.nix27
-rw-r--r--pkgs/tools/misc/pick/default.nix4
-rw-r--r--pkgs/tools/networking/mailutils/default.nix3
-rw-r--r--pkgs/tools/networking/miniupnpd/default.nix4
-rw-r--r--pkgs/tools/networking/shadowsocks-libev/default.nix59
-rw-r--r--pkgs/tools/security/pinentry-mac/default.nix4
-rw-r--r--pkgs/tools/security/scallion/default.nix36
-rw-r--r--pkgs/tools/system/efivar/default.nix4
-rw-r--r--pkgs/tools/system/gotop/default.nix23
-rw-r--r--pkgs/tools/typesetting/asciidoctor/Gemfile2
-rw-r--r--pkgs/tools/typesetting/asciidoctor/Gemfile.lock81
-rw-r--r--pkgs/tools/typesetting/asciidoctor/default.nix35
-rw-r--r--pkgs/tools/typesetting/asciidoctor/gemset.nix152
-rw-r--r--pkgs/top-level/all-packages.nix100
-rw-r--r--pkgs/top-level/darwin-packages.nix8
-rw-r--r--pkgs/top-level/lua-packages.nix2
-rw-r--r--pkgs/top-level/perl-packages.nix1
-rw-r--r--pkgs/top-level/python-packages.nix97
-rw-r--r--pkgs/top-level/unix-tools.nix34
268 files changed, 3135 insertions, 1844 deletions
diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix
index 641a7f5d758..f7c84bd41cc 100644
--- a/lib/systems/parse.nix
+++ b/lib/systems/parse.nix
@@ -34,7 +34,7 @@ rec {
 
   ################################################################################
 
-  types.openSignifiantByte = mkOptionType {
+  types.openSignificantByte = mkOptionType {
     name = "significant-byte";
     description = "Endianness";
     merge = mergeOneOption;
@@ -42,7 +42,7 @@ rec {
 
   types.significantByte = enum (attrValues significantBytes);
 
-  significantBytes = setTypes types.openSignifiantByte {
+  significantBytes = setTypes types.openSignificantByte {
     bigEndian = {};
     littleEndian = {};
   };
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 5f47c859a8e..839458dbfc9 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -305,6 +305,11 @@
     github = "akru";
     name = "Alexander Krupenkin ";
   };
+  alexchapman = {
+    name = "Alex Chapman";
+    email = "alex@farfromthere.net";
+    github = "AJChapman";
+  };
   alexvorobiev = {
     email = "alexander.vorobiev@gmail.com";
     github = "alexvorobiev";
@@ -3406,6 +3411,11 @@
     github = "grwlf";
     name = "Sergey Mironov";
   };
+  sna = {
+    email = "abouzahra.9@wright.edu";
+    github = "s-na";
+    name = "S. Nordin Abouzahra";
+  };
   snyh = {
     email = "snyh@snyh.org";
     github = "snyh";
diff --git a/nixos/modules/config/pulseaudio.nix b/nixos/modules/config/pulseaudio.nix
index a9c5fc75660..90cea47b70a 100644
--- a/nixos/modules/config/pulseaudio.nix
+++ b/nixos/modules/config/pulseaudio.nix
@@ -214,6 +214,8 @@ in {
     (mkIf cfg.enable {
       environment.systemPackages = [ overriddenPackage ];
 
+      sound.enable = true;
+
       environment.etc = [
         { target = "asound.conf";
           source = alsaConf; }
diff --git a/nixos/modules/installer/cd-dvd/channel.nix b/nixos/modules/installer/cd-dvd/channel.nix
index 4a198316795..01cfe8a02e1 100644
--- a/nixos/modules/installer/cd-dvd/channel.nix
+++ b/nixos/modules/installer/cd-dvd/channel.nix
@@ -21,7 +21,9 @@ let
       if [ ! -e $out/nixos/nixpkgs ]; then
         ln -s . $out/nixos/nixpkgs
       fi
+      echo -n ${config.system.nixos.revision} > $out/nixos/.git-revision
       echo -n ${config.system.nixos.versionSuffix} > $out/nixos/.version-suffix
+      echo ${config.system.nixos.versionSuffix} | sed -e s/pre// > $out/nixos/svn-revision
     '';
 
 in
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl
index 0e0744a52e4..14c611e18bc 100644
--- a/nixos/modules/installer/tools/nixos-generate-config.pl
+++ b/nixos/modules/installer/tools/nixos-generate-config.pl
@@ -585,7 +585,6 @@ $bootLoaderConfig
 
   # Some programs need SUID wrappers, can be configured further or are
   # started in user sessions.
-  # programs.bash.enableCompletion = true;
   # programs.mtr.enable = true;
   # programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
 
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 3a9a2bf8661..0bbb1d2e534 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -547,6 +547,7 @@
   ./services/networking/searx.nix
   ./services/networking/seeks.nix
   ./services/networking/skydns.nix
+  ./services/networking/shadowsocks.nix
   ./services/networking/shairport-sync.nix
   ./services/networking/shout.nix
   ./services/networking/sniproxy.nix
diff --git a/nixos/modules/programs/bash/bash.nix b/nixos/modules/programs/bash/bash.nix
index c0967316c0c..69a1a482d07 100644
--- a/nixos/modules/programs/bash/bash.nix
+++ b/nixos/modules/programs/bash/bash.nix
@@ -110,7 +110,7 @@ in
       };
 
       enableCompletion = mkOption {
-        default = false;
+        default = true;
         description = ''
           Enable Bash completion for all interactive bash shells.
         '';
diff --git a/nixos/modules/services/editors/emacs.nix b/nixos/modules/services/editors/emacs.nix
index bbc9bcf3dae..ba7ec967919 100644
--- a/nixos/modules/services/editors/emacs.nix
+++ b/nixos/modules/services/editors/emacs.nix
@@ -15,6 +15,25 @@ let
     fi
   '';
 
+desktopApplicationFile = pkgs.writeTextFile {
+  name = "emacsclient.desktop";
+  destination = "/share/applications/emacsclient.desktop";
+  text = ''
+[Desktop Entry]
+Name=Emacsclient
+GenericName=Text Editor
+Comment=Edit text
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
+Exec=emacseditor %F
+Icon=emacs
+Type=Application
+Terminal=false
+Categories=Development;TextEditor;
+StartupWMClass=Emacs
+Keywords=Text;Editor;
+'';
+};
+
 in {
 
   options.services.emacs = {
@@ -74,7 +93,7 @@ in {
       };
     } // optionalAttrs cfg.enable { wantedBy = [ "default.target" ]; };
 
-    environment.systemPackages = [ cfg.package editorScript ];
+    environment.systemPackages = [ cfg.package editorScript desktopApplicationFile ];
 
     environment.variables = {
       # This is required so that GTK applications launched from Emacs
diff --git a/nixos/modules/services/hardware/trezord.nix b/nixos/modules/services/hardware/trezord.nix
index 38d0a3a1d75..fa049611468 100644
--- a/nixos/modules/services/hardware/trezord.nix
+++ b/nixos/modules/services/hardware/trezord.nix
@@ -38,7 +38,7 @@ in {
       path = [];
       serviceConfig = {
         Type = "simple";
-        ExecStart = "${pkgs.trezord}/bin/trezord -f";
+        ExecStart = "${pkgs.trezord}/bin/trezord-go";
         User = "trezord";
       };
     };
diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix
index a5b6dbab157..eceb91525db 100644
--- a/nixos/modules/services/monitoring/grafana.nix
+++ b/nixos/modules/services/monitoring/grafana.nix
@@ -50,7 +50,7 @@ in {
     protocol = mkOption {
       description = "Which protocol to listen.";
       default = "http";
-      type = types.enum ["http" "https"];
+      type = types.enum ["http" "https" "socket"];
     };
 
     addr = mkOption {
diff --git a/nixos/modules/services/networking/dnscache.nix b/nixos/modules/services/networking/dnscache.nix
index 379203cd1ab..ba5c8e2d5e5 100644
--- a/nixos/modules/services/networking/dnscache.nix
+++ b/nixos/modules/services/networking/dnscache.nix
@@ -9,12 +9,12 @@ let
     mkdir -p $out/{servers,ip}
 
     ${concatMapStrings (ip: ''
-      echo > "$out/ip/"${lib.escapeShellArg ip}
+      touch "$out/ip/"${lib.escapeShellArg ip}
     '') cfg.clientIps}
 
     ${concatStrings (mapAttrsToList (host: ips: ''
       ${concatMapStrings (ip: ''
-        echo ${lib.escapeShellArg ip} > "$out/servers/"${lib.escapeShellArg host}
+        echo ${lib.escapeShellArg ip} >> "$out/servers/"${lib.escapeShellArg host}
       '') ips}
     '') cfg.domainServers)}
 
@@ -34,33 +34,49 @@ in {
 
   options = {
     services.dnscache = {
+
       enable = mkOption {
         default = false;
         type = types.bool;
-        description = "Whether to run the dnscache caching dns server";
+        description = "Whether to run the dnscache caching dns server.";
       };
 
       ip = mkOption {
         default = "0.0.0.0";
         type = types.str;
-        description = "IP address on which to listen for connections";
+        description = "IP address on which to listen for connections.";
       };
 
       clientIps = mkOption {
         default = [ "127.0.0.1" ];
         type = types.listOf types.str;
-        description = "client IP addresses (or prefixes) from which to accept connections";
+        description = "Client IP addresses (or prefixes) from which to accept connections.";
         example = ["192.168" "172.23.75.82"];
       };
 
       domainServers = mkOption {
         default = { };
         type = types.attrsOf (types.listOf types.str);
-        description = "table of {hostname: server} pairs to use as authoritative servers for hosts (and subhosts)";
+        description = ''
+          Table of {hostname: server} pairs to use as authoritative servers for hosts (and subhosts).
+          If entry for @ is not specified predefined list of root servers is used.
+        '';
         example = {
-          "example.com" = ["8.8.8.8" "8.8.4.4"];
+          "@" = ["8.8.8.8" "8.8.4.4"];
+          "example.com" = ["192.168.100.100"];
         };
       };
+
+      forwardOnly = mkOption {
+        default = false;
+        type = types.bool;
+        description = ''
+          Whether to treat root servers (for @) as caching
+          servers, requesting addresses the same way a client does. This is
+          needed if you want to use e.g. Google DNS as your upstream DNS.
+        '';
+      };
+
     };
   };
 
@@ -82,6 +98,7 @@ in {
       '';
       script = ''
         cd /var/lib/dnscache/
+        ${optionalString cfg.forwardOnly "export FORWARDONLY=1"}
         exec ./run
       '';
     };
diff --git a/nixos/modules/services/networking/prosody.nix b/nixos/modules/services/networking/prosody.nix
index f409962816d..1b4f81f6b56 100644
--- a/nixos/modules/services/networking/prosody.nix
+++ b/nixos/modules/services/networking/prosody.nix
@@ -301,6 +301,18 @@ in
         default = "/var/lib/prosody";
       };
 
+      user = mkOption {
+        type = types.str;
+        default = "prosody";
+        description = "User account under which prosody runs.";
+      };
+
+      group = mkOption {
+        type = types.str;
+        default = "prosody";
+        description = "Group account under which prosody runs.";
+      };
+
       allowRegistration = mkOption {
         type = types.bool;
         default = false;
@@ -427,7 +439,7 @@ in
 
     environment.etc."prosody/prosody.cfg.lua".text = ''
 
-      pidfile = "${cfg.dataDir}/prosody.pid"
+      pidfile = "/run/prosody/prosody.pid"
 
       log = "*syslog"
 
@@ -475,15 +487,15 @@ in
         '') cfg.virtualHosts) }
     '';
 
-    users.extraUsers.prosody = {
+    users.extraUsers.prosody = mkIf (cfg.user == "prosody") {
       uid = config.ids.uids.prosody;
       description = "Prosody user";
       createHome = true;
-      group = "prosody";
+      inherit (cfg) group;
       home = "${cfg.dataDir}";
     };
 
-    users.extraGroups.prosody = {
+    users.extraGroups.prosody = mkIf (cfg.group == "prosody") {
       gid = config.ids.gids.prosody;
     };
 
@@ -494,9 +506,11 @@ in
       wantedBy = [ "multi-user.target" ];
       restartTriggers = [ config.environment.etc."prosody/prosody.cfg.lua".source ];
       serviceConfig = {
-        User = "prosody";
+        User = cfg.user;
+        Group = cfg.group;
         Type = "forking";
-        PIDFile = "${cfg.dataDir}/prosody.pid";
+        RuntimeDirectory = [ "prosody" ];
+        PIDFile = "/run/prosody/prosody.pid";
         ExecStart = "${cfg.package}/bin/prosodyctl start";
       };
     };
diff --git a/nixos/modules/services/networking/shadowsocks.nix b/nixos/modules/services/networking/shadowsocks.nix
new file mode 100644
index 00000000000..fe6d65a5f96
--- /dev/null
+++ b/nixos/modules/services/networking/shadowsocks.nix
@@ -0,0 +1,112 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.shadowsocks;
+
+  opts = {
+    server = cfg.localAddress;
+    server_port = cfg.port;
+    method = cfg.encryptionMethod;
+    mode = cfg.mode;
+    user = "nobody";
+    fast_open = true;
+  } // optionalAttrs (cfg.password != null) { password = cfg.password; };
+
+  configFile = pkgs.writeText "shadowsocks.json" (builtins.toJSON opts);
+
+in
+
+{
+
+  ###### interface
+
+  options = {
+
+    services.shadowsocks = {
+
+      enable = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Whether to run shadowsocks-libev shadowsocks server.
+        '';
+      };
+
+      localAddress = mkOption {
+        type = types.str;
+        default = "0.0.0.0";
+        description = ''
+          Local address to which the server binds.
+        '';
+      };
+
+      port = mkOption {
+        type = types.int;
+        default = 8388;
+        description = ''
+          Port which the server uses.
+        '';
+      };
+
+      password = mkOption {
+        type = types.nullOr types.str;
+        default = null;
+        description = ''
+          Password for connecting clients.
+        '';
+      };
+
+      passwordFile = mkOption {
+        type = types.nullOr types.path;
+        default = null;
+        description = ''
+          Password file with a password for connecting clients.
+        '';
+      };
+
+      mode = mkOption {
+        type = types.enum [ "tcp_only" "tcp_and_udp" "udp_only" ];
+        default = "tcp_and_udp";
+        description = ''
+          Relay protocols.
+        '';
+      };
+
+      encryptionMethod = mkOption {
+        type = types.str;
+        default = "chacha20-ietf-poly1305";
+        description = ''
+          Encryption method. See <link xlink:href="https://github.com/shadowsocks/shadowsocks-org/wiki/AEAD-Ciphers"/>.
+        '';
+      };
+
+    };
+
+  };
+
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+    assertions = singleton
+      { assertion = cfg.password == null || cfg.passwordFile == null;
+        message = "Cannot use both password and passwordFile for shadowsocks-libev";
+      };
+
+    systemd.services.shadowsocks-libev = {
+      description = "shadowsocks-libev Daemon";
+      after = [ "network.target" ];
+      wantedBy = [ "multi-user.target" ];
+      path = [ pkgs.shadowsocks-libev ] ++ optional (cfg.passwordFile != null) pkgs.jq;
+      serviceConfig.PrivateTmp = true;
+      script = ''
+        ${optionalString (cfg.passwordFile != null) ''
+          cat ${configFile} | jq --arg password "$(cat "${cfg.passwordFile}")" '. + { password: $password }' > /tmp/shadowsocks.json
+        ''}
+        exec ss-server -c ${if cfg.passwordFile != null then "/tmp/shadowsocks.json" else configFile}
+      '';
+    };
+  };
+}
diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix
index 0998d5a7107..3564afd77f4 100644
--- a/nixos/modules/services/torrent/transmission.nix
+++ b/nixos/modules/services/torrent/transmission.nix
@@ -147,6 +147,7 @@ in
           ${getLib pkgs.libcap}/lib/libcap*.so*            mr,
           ${getLib pkgs.attr}/lib/libattr*.so*             mr,
           ${getLib pkgs.lz4}/lib/liblz4*.so*               mr,
+          ${getLib pkgs.libkrb5}/lib/lib*.so*              mr,
 
           @{PROC}/sys/kernel/random/uuid   r,
           @{PROC}/sys/vm/overcommit_memory r,
diff --git a/nixos/modules/tasks/filesystems/exfat.nix b/nixos/modules/tasks/filesystems/exfat.nix
index 963bc940b4f..1527f993fdd 100644
--- a/nixos/modules/tasks/filesystems/exfat.nix
+++ b/nixos/modules/tasks/filesystems/exfat.nix
@@ -5,7 +5,7 @@ with lib;
 {
   config = mkIf (any (fs: fs == "exfat") config.boot.supportedFilesystems) {
 
-    system.fsPackages = [ pkgs.exfat-utils pkgs.fuse_exfat ];
+    system.fsPackages = [ pkgs.exfat ];
 
   };
 }
diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix
index 50cf30cc48d..c3bf897d51f 100644
--- a/nixos/modules/tasks/filesystems/zfs.nix
+++ b/nixos/modules/tasks/filesystems/zfs.nix
@@ -305,6 +305,8 @@ in
         }
       ];
 
+      virtualisation.lxd.zfsSupport = true;
+
       boot = {
         kernelModules = [ "spl" "zfs" ] ;
         extraModulePackages = with packages; [ spl zfs ];
diff --git a/nixos/modules/virtualisation/lxc.nix b/nixos/modules/virtualisation/lxc.nix
index 2310fe98432..9b5adaf0824 100644
--- a/nixos/modules/virtualisation/lxc.nix
+++ b/nixos/modules/virtualisation/lxc.nix
@@ -74,6 +74,9 @@ in
     systemd.tmpfiles.rules = [ "d /var/lib/lxc/rootfs 0755 root root -" ];
 
     security.apparmor.packages = [ pkgs.lxc ];
-    security.apparmor.profiles = [ "${pkgs.lxc}/etc/apparmor.d/lxc-containers" ];
+    security.apparmor.profiles = [
+      "${pkgs.lxc}/etc/apparmor.d/lxc-containers"
+      "${pkgs.lxc}/etc/apparmor.d/usr.bin.lxc-start"
+    ];
   };
 }
diff --git a/nixos/modules/virtualisation/lxd.nix b/nixos/modules/virtualisation/lxd.nix
index 4988886baf6..3e76cdacfc4 100644
--- a/nixos/modules/virtualisation/lxd.nix
+++ b/nixos/modules/virtualisation/lxd.nix
@@ -15,28 +15,34 @@ in
 
   options = {
 
-    virtualisation.lxd.enable =
-      mkOption {
+    virtualisation.lxd = {
+      enable = mkOption {
         type = types.bool;
         default = false;
-        description =
-          ''
-            This option enables lxd, a daemon that manages
-            containers. Users in the "lxd" group can interact with
-            the daemon (e.g. to start or stop containers) using the
-            <command>lxc</command> command line tool, among others.
-          '';
+        description = ''
+          This option enables lxd, a daemon that manages
+          containers. Users in the "lxd" group can interact with
+          the daemon (e.g. to start or stop containers) using the
+          <command>lxc</command> command line tool, among others.
+        '';
       };
-
+      zfsSupport = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          enables lxd to use zfs as a storage for containers.
+          This option is enabled by default if a zfs pool is configured
+          with nixos.
+        '';
+      };
+    };
   };
 
-
   ###### implementation
 
   config = mkIf cfg.enable {
 
-    environment.systemPackages =
-      [ pkgs.lxd ];
+    environment.systemPackages = [ pkgs.lxd ];
 
     security.apparmor = {
       enable = true;
@@ -47,31 +53,31 @@ in
       packages = [ pkgs.lxc ];
     };
 
-    systemd.services.lxd =
-      { description = "LXD Container Management Daemon";
+    systemd.services.lxd = {
+      description = "LXD Container Management Daemon";
 
-        wantedBy = [ "multi-user.target" ];
-        after = [ "systemd-udev-settle.service" ];
+      wantedBy = [ "multi-user.target" ];
+      after = [ "systemd-udev-settle.service" ];
 
-        # TODO(wkennington): Add lvm2 and thin-provisioning-tools
-        path = with pkgs; [ acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables ];
+      path = lib.optional cfg.zfsSupport pkgs.zfs;
 
-        preStart = ''
-          mkdir -m 0755 -p /var/lib/lxc/rootfs
-        '';
+      preStart = ''
+        mkdir -m 0755 -p /var/lib/lxc/rootfs
+      '';
 
-        serviceConfig.ExecStart = "@${pkgs.lxd.bin}/bin/lxd lxd --syslog --group lxd";
-        serviceConfig.Type = "simple";
-        serviceConfig.KillMode = "process"; # when stopping, leave the containers alone
+      serviceConfig = {
+        ExecStart = "@${pkgs.lxd.bin}/bin/lxd lxd --group lxd";
+        Type = "simple";
+        KillMode = "process"; # when stopping, leave the containers alone
       };
 
+    };
+
     users.extraGroups.lxd.gid = config.ids.gids.lxd;
 
     users.extraUsers.root = {
       subUidRanges = [ { startUid = 1000000; count = 65536; } ];
       subGidRanges = [ { startGid = 1000000; count = 65536; } ];
     };
-
   };
-
 }
diff --git a/nixos/release.nix b/nixos/release.nix
index 4fd77e6471c..7c066f8ee9e 100644
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -166,8 +166,12 @@ in rec {
     inherit system;
   });
 
-  sd_image = forMatchingSystems [ "aarch64-linux" ] (system: makeSdImage {
-    module = ./modules/installer/cd-dvd/sd-image-aarch64.nix;
+  sd_image = forMatchingSystems [ "armv6l-linux" "armv7l-linux" "aarch64-linux" ] (system: makeSdImage {
+    module = {
+        armv6l-linux = ./modules/installer/cd-dvd/sd-image-raspberrypi.nix;
+        armv7l-linux = ./modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix;
+        aarch64-linux = ./modules/installer/cd-dvd/sd-image-aarch64.nix;
+      }.${system};
     inherit system;
   });
 
@@ -266,6 +270,7 @@ in rec {
   tests.couchdb = callTest tests/couchdb.nix {};
   tests.docker = callTestOnMatchingSystems ["x86_64-linux"] tests/docker.nix {};
   tests.docker-tools = callTestOnMatchingSystems ["x86_64-linux"] tests/docker-tools.nix {};
+  tests.docker-tools-overlay = callTestOnMatchingSystems ["x86_64-linux"] tests/docker-tools-overlay.nix {};
   tests.docker-edge = callTestOnMatchingSystems ["x86_64-linux"] tests/docker-edge.nix {};
   tests.dovecot = callTest tests/dovecot.nix {};
   tests.dnscrypt-proxy = callTestOnMatchingSystems ["x86_64-linux"] tests/dnscrypt-proxy.nix {};
diff --git a/nixos/tests/docker-tools-overlay.nix b/nixos/tests/docker-tools-overlay.nix
new file mode 100644
index 00000000000..9d7fa3e7a8c
--- /dev/null
+++ b/nixos/tests/docker-tools-overlay.nix
@@ -0,0 +1,32 @@
+# this test creates a simple GNU image with docker tools and sees if it executes
+
+import ./make-test.nix ({ pkgs, ... }:
+{
+  name = "docker-tools-overlay";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ lnl7 ];
+  };
+
+  nodes = {
+    docker =
+      { config, pkgs, ... }:
+      {
+        virtualisation.docker.enable = true;
+        virtualisation.docker.storageDriver = "overlay";  # defaults to overlay2
+      };
+  };
+
+  testScript =
+    ''
+      $docker->waitForUnit("sockets.target");
+
+      $docker->succeed("docker load --input='${pkgs.dockerTools.examples.bash}'");
+      $docker->succeed("docker run --rm ${pkgs.dockerTools.examples.bash.imageName} bash --version");
+
+      # Check if the nix store has correct user permissions depending on what
+      # storage driver is used, incorrectly built images can show up as readonly.
+      # drw-------  3 0 0   3 Apr 14 11:36 /nix
+      # drw------- 99 0 0 100 Apr 14 11:36 /nix/store
+      $docker->succeed("docker run --rm -u 1000:1000 ${pkgs.dockerTools.examples.bash.imageName} bash --version");
+    '';
+})
diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix
index 9135bca0f4f..4466081d01e 100644
--- a/nixos/tests/docker-tools.nix
+++ b/nixos/tests/docker-tools.nix
@@ -3,7 +3,7 @@
 import ./make-test.nix ({ pkgs, ... }: {
   name = "docker-tools";
   meta = with pkgs.stdenv.lib.maintainers; {
-    maintainers = [ ];
+    maintainers = [ lnl7 ];
   };
 
   nodes = {
@@ -21,12 +21,12 @@ import ./make-test.nix ({ pkgs, ... }: {
       $docker->waitForUnit("sockets.target");
 
       $docker->succeed("docker load --input='${pkgs.dockerTools.examples.bash}'");
-      $docker->succeed("docker run --rm ${pkgs.dockerTools.examples.bash.imageName} /bin/bash --version");
+      $docker->succeed("docker run --rm ${pkgs.dockerTools.examples.bash.imageName} bash --version");
       $docker->succeed("docker rmi ${pkgs.dockerTools.examples.bash.imageName}");
 
       # Check if the nix store is correctly initialized by listing dependencies of the installed Nix binary
       $docker->succeed("docker load --input='${pkgs.dockerTools.examples.nix}'");
-      $docker->succeed("docker run --rm ${pkgs.dockerTools.examples.nix.imageName} /bin/nix-store -qR ${pkgs.nix}");
+      $docker->succeed("docker run --rm ${pkgs.dockerTools.examples.nix.imageName} nix-store -qR ${pkgs.nix}");
       $docker->succeed("docker rmi ${pkgs.dockerTools.examples.nix.imageName}");
 
       # To test the pullImage tool
diff --git a/nixos/tests/kernel-copperhead.nix b/nixos/tests/kernel-copperhead.nix
index 07427d7f2a8..0af978f1851 100644
--- a/nixos/tests/kernel-copperhead.nix
+++ b/nixos/tests/kernel-copperhead.nix
@@ -6,14 +6,14 @@ import ./make-test.nix ({ pkgs, ...} : {
 
   machine = { config, lib, pkgs, ... }:
     {
-      boot.kernelPackages = pkgs.linuxPackages_hardened_copperhead;
+      boot.kernelPackages = pkgs.linuxPackages_copperhead_hardened;
     };
 
   testScript =
     ''
       $machine->succeed("uname -a");
       $machine->succeed("uname -s | grep 'Linux'");
-      $machine->succeed("uname -a | grep '${pkgs.linuxPackages_hardened_copperhead.kernel.modDirVersion}'");
+      $machine->succeed("uname -a | grep '${pkgs.linuxPackages_copperhead_hardened.kernel.modDirVersion}'");
       $machine->succeed("uname -a | grep 'hardened'");
     '';
 })
diff --git a/pkgs/applications/audio/asunder/default.nix b/pkgs/applications/audio/asunder/default.nix
index bb0615df25b..9c42c98ba5e 100644
--- a/pkgs/applications/audio/asunder/default.nix
+++ b/pkgs/applications/audio/asunder/default.nix
@@ -12,11 +12,11 @@
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  version = "2.9.2";
+  version = "2.9.3";
   name = "asunder-${version}";
   src = fetchurl {
     url = "http://littlesvr.ca/asunder/releases/${name}.tar.bz2";
-    sha256 = "0vjbxrrjih4c673sc39wj5whp81xp9kmnwqxwzfnmhkky970rg5r";
+    sha256 = "1630i1df06y840v3fgdf75jxw1s8kwbfn5bhi0686viah0scccw5";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/applications/audio/caps/default.nix b/pkgs/applications/audio/caps/default.nix
index 27724bc28e9..2d90599346f 100644
--- a/pkgs/applications/audio/caps/default.nix
+++ b/pkgs/applications/audio/caps/default.nix
@@ -9,9 +9,13 @@ stdenv.mkDerivation rec {
 
   patches = [
     (fetchurl {
-      url = "https://anonscm.debian.org/cgit/pkg-multimedia/caps.git/plain/debian/patches/0001-Avoid-ambiguity-in-div-invocation.patch";
+      url = "https://salsa.debian.org/multimedia-team/caps/raw/9a99c225/debian/patches/0001-Avoid-ambiguity-in-div-invocation.patch";
       sha256 = "1b1pb5yfskiw8zi1lkj572l2ajpirh4amq538vggwvlpv1fqfway";
     })
+    (fetchurl {
+      url = "https://salsa.debian.org/multimedia-team/caps/raw/a411203d/debian/patches/0002-Use-standard-exp10f-instead-of-pow10f.patch";
+      sha256 = "18ciklnscabr77l8b89xmbagkk79w4iqfpzr2yhn2ywv2jp8akx9";
+    })
   ];
 
   configurePhase = ''
diff --git a/pkgs/applications/audio/eq10q/default.nix b/pkgs/applications/audio/eq10q/default.nix
index 3faeeb12d4c..651604c71a1 100644
--- a/pkgs/applications/audio/eq10q/default.nix
+++ b/pkgs/applications/audio/eq10q/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, cmake, fftw, gtkmm2, libxcb, lv2, pkgconfig, xorg }:
+{ stdenv, fetchurl, fetchpatch, cmake, fftw, gtkmm2, libxcb, lv2, pkgconfig
+, xorg }:
 stdenv.mkDerivation rec {
   name = "eq10q-${version}";
   version = "2.2";
@@ -10,6 +11,14 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ cmake fftw gtkmm2 libxcb lv2 xorg.libpthreadstubs xorg.libXdmcp xorg.libxshmfence ];
 
+  patches = [
+    (fetchpatch {
+      # glibc 2.27 compatibility
+      url = https://sources.debian.org/data/main/e/eq10q/2.2~repack0-2.1/debian/patches/05-pow10.patch;
+      sha256 = "07b0wf6k4xqgigv4h095bzfaw8r218wa36r9w1817jcys13r6c5r";
+    })
+  ];
+
   installFlags = ''
     DESTDIR=$(out)
   '';
diff --git a/pkgs/applications/audio/ncmpcpp/default.nix b/pkgs/applications/audio/ncmpcpp/default.nix
index 10c3bb2a195..87f5f94bb30 100644
--- a/pkgs/applications/audio/ncmpcpp/default.nix
+++ b/pkgs/applications/audio/ncmpcpp/default.nix
@@ -12,11 +12,11 @@ assert taglibSupport -> (taglib != null);
 with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "ncmpcpp-${version}";
-  version = "0.8.1";
+  version = "0.8.2";
 
   src = fetchurl {
     url = "https://ncmpcpp.rybczak.net/stable/${name}.tar.bz2";
-    sha256 = "1zw8d07b2bkssbsybg6jnmpq001w525viajrnz4jvfml3l55gyad";
+    sha256 = "0m0mjb049sl62vx13h9waavysa30mk0rphacksnvf94n13la62v5";
   };
 
   configureFlags = [ "BOOST_LIB_SUFFIX=" ]
diff --git a/pkgs/applications/audio/spotify/default.nix b/pkgs/applications/audio/spotify/default.nix
index 7b78ceddda2..87bf440ed4f 100644
--- a/pkgs/applications/audio/spotify/default.nix
+++ b/pkgs/applications/audio/spotify/default.nix
@@ -9,7 +9,7 @@ let
   # Latest version number can be found at:
   # http://repository-origin.spotify.com/pool/non-free/s/spotify-client/
   # Be careful not to pick the testing version.
-  version = "1.0.72.117.g6bd7cc73-35";
+  version = "1.0.77.338.g758ebd78-41";
 
   deps = [
     alsaLib
@@ -54,7 +54,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://repository-origin.spotify.com/pool/non-free/s/spotify-client/spotify-client_${version}_amd64.deb";
-    sha256 = "0yicwvg6jx8r657ff53326akq3g4ayiinlracjw5jrcs8x9whjap";
+    sha256 = "1971jc0431pl8yixpl37ryl2l0pqdf0xjvkg59nqdwj3vbdx5606";
   };
 
   buildInputs = [ dpkg makeWrapper ];
diff --git a/pkgs/applications/editors/ghostwriter/default.nix b/pkgs/applications/editors/ghostwriter/default.nix
index aeae711c1c0..7a0399ea0f8 100644
--- a/pkgs/applications/editors/ghostwriter/default.nix
+++ b/pkgs/applications/editors/ghostwriter/default.nix
@@ -2,14 +2,14 @@
 
 stdenv.mkDerivation rec {
   pname = "ghostwriter";
-  version = "1.6.1";
+  version = "1.6.2";
   name = "${pname}-${version}";
 
   src = fetchFromGitHub {
     owner = "wereturtle";
     repo = pname;
     rev = "v${version}";
-    sha256 = "1ihdr4xk0j83q83xknbikxb7yf9qhlkgvc89w33lhj090cv376gd";
+    sha256 = "0251563zy0q69fzfacvalpx43y15cshb0bhshyd4w37061gh1c12";
   };
 
   nativeBuildInputs = [ qmake pkgconfig ];
diff --git a/pkgs/applications/editors/sublime/3/packages.nix b/pkgs/applications/editors/sublime/3/packages.nix
index 84394e85c88..01445ade473 100644
--- a/pkgs/applications/editors/sublime/3/packages.nix
+++ b/pkgs/applications/editors/sublime/3/packages.nix
@@ -5,14 +5,14 @@ let
 in
   rec {
     sublime3-dev = common {
-      buildVersion = "3161";
-      x32sha256 = "0qrm2qmfsj71lr83c8zas2n3xk8hk9k4w8ygnasjhggmyjm3wy0q";
-      x64sha256 = "0cgadylm68s2jly10r038q1fvmbzmpc2nvqy86vlyq9avgqbm5pc";
+      buildVersion = "3162";
+      x32sha256 = "190il02hqvv64w17w7xc1fz2wkbhk5a5y96jb25dvafmslm46d4i";
+      x64sha256 = "1nsjhjs6zajhx7m3dk7i450krg6pb03zffm1n3m1v0xb9zr37xz3";
     } {};
 
     sublime3 = common {
       buildVersion = "3143";
       x32sha256 = "0dgpx4wij2m77f478p746qadavab172166bghxmj7fb61nvw9v5i";
-      x64sha256 = "06b554d2cvpxc976rvh89ix3kqc7klnngvk070xrs8wbyb221qcw";    
+      x64sha256 = "06b554d2cvpxc976rvh89ix3kqc7klnngvk070xrs8wbyb221qcw";
     } {};
   }
diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix
index 7a6fa1961e2..5c10f6fb3bb 100644
--- a/pkgs/applications/editors/vscode/default.nix
+++ b/pkgs/applications/editors/vscode/default.nix
@@ -2,7 +2,7 @@
   makeWrapper, libXScrnSaver, libxkbfile, libsecret }:
 
 let
-  version = "1.22.1";
+  version = "1.22.2";
   channel = "stable";
 
   plat = {
@@ -12,9 +12,9 @@ let
   }.${stdenv.system};
 
   sha256 = {
-    "i686-linux" = "1w1ywf21vcwmfq5ngag1y076nxbdqg3qav90ilxgd3dkv5j6fkjr";
-    "x86_64-linux" = "14phpsrkkv09dgr7phqhgjzfhm3zzbh3w2yhyng0cj3vwzysikcs";
-    "x86_64-darwin" = "0fqsr4ramanl7v1damf01zkmg75s9nlfkj6298h9sjvhc93pfcll";
+    "i686-linux" = "17iqqg6vdccbl1k4k2ks3kkgg7619j6qdvca4k27pjfqm17mvw5n";
+    "x86_64-linux" = "1ng2jhhaghsf7a2dmrimazh817jh0ag88whija179ywgrg3i6xam";
+    "x86_64-darwin" = "083hizigzxm45hcy6yqwznj9ibqdaxg2xv8rsyas4ig9x55irrcj";
   }.${stdenv.system};
 
   archive_fmt = if stdenv.system == "x86_64-darwin" then "zip" else "tar.gz";
diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix
index 8353bce1b84..d4e2043eaa7 100644
--- a/pkgs/applications/gis/grass/default.nix
+++ b/pkgs/applications/gis/grass/default.nix
@@ -35,6 +35,9 @@ stdenv.mkDerivation {
     "--with-blas"
   ];
 
+  # Otherwise a very confusing "Can't load GDAL library" error
+  makeFlags = stdenv.lib.optional stdenv.isDarwin "GDAL_DYNAMIC=";
+
   /* Ensures that the python script run at build time are actually executable;
    * otherwise, patchShebangs ignores them.  */
   postConfigure = ''
@@ -73,6 +76,7 @@ stdenv.mkDerivation {
     --set GRASS_PYTHON ${python2Packages.python}/bin/${python2Packages.python.executable} \
     --suffix LD_LIBRARY_PATH ':' '${gdal}/lib'
     ln -s $out/grass-*/lib $out/lib
+    ln -s $out/grass-*/include $out/include
   '';
 
   enableParallelBuilding = true;
@@ -82,5 +86,6 @@ stdenv.mkDerivation {
     description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization";
     license = stdenv.lib.licenses.gpl2Plus;
     platforms = stdenv.lib.platforms.all;
+    maintainers = with stdenv.lib.maintainers; [mpickering];
   };
 }
diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix
index 75f980c6781..896387b1f7f 100644
--- a/pkgs/applications/gis/qgis/default.nix
+++ b/pkgs/applications/gis/qgis/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, fetchpatch, gdal, cmake, qt4, flex, bison, proj, geos, xlibsWrapper, sqlite, gsl
 , qwt, fcgi, python2Packages, libspatialindex, libspatialite, qscintilla, postgresql, makeWrapper
 , qjson, qca2, txt2tags, openssl, darwin, pkgconfig
-, withGrass ? false, grass, IOKit, ApplicationServices
+, withGrass ? true, grass, IOKit, ApplicationServices
 }:
 
 stdenv.mkDerivation rec {
@@ -58,11 +58,13 @@ stdenv.mkDerivation rec {
           '') +
     (stdenv.lib.optionalString stdenv.isDarwin ''
       # Necessary for QGIS to find the correct default GRASS path
+      # Plugins look for gdal tools like deminfo on the PATH
       ${stdenv.lib.optionalString withGrass "ln -sf ${grass} $out/QGIS.app/Contents/MacOS/grass"}
       for file in $(find $out -type f -name "QGIS"); do
         wrapProgram "$file" \
           --prefix DYLD_LIBRARY_PATH : "${qwt}/lib" \
           --prefix DYLD_LIBRARY_PATH : "${qscintilla}/lib" \
+          --prefix PATH : "${gdal}/bin" \
           ${stdenv.lib.optionalString withGrass "--prefix PATH : ${grass}/bin"} \
           --set PYTHONPATH $PYTHONPATH
       done
@@ -75,6 +77,6 @@ stdenv.mkDerivation rec {
     homepage = http://www.qgis.org;
     license = stdenv.lib.licenses.gpl2Plus;
     platforms = with stdenv.lib.platforms; unix;
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with stdenv.lib.maintainers; [viric mpickering];
   };
 }
diff --git a/pkgs/applications/graphics/dosage/default.nix b/pkgs/applications/graphics/dosage/default.nix
new file mode 100644
index 00000000000..f95370e39e7
--- /dev/null
+++ b/pkgs/applications/graphics/dosage/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, pythonPackages, fetchFromGitHub }:
+
+pythonPackages.buildPythonApplication rec {
+  name = "${pname}-${version}";
+  pname = "dosage";
+  version = "2018.04.08";
+  PBR_VERSION = version;
+
+  src = fetchFromGitHub {
+    owner = "webcomics";
+    repo = "dosage";
+    rev = "b2fdc13feb65b93762928f7e99bac7b1b7b31591";
+    sha256 = "1p6vllqaf9s6crj47xqp97hkglch1kd4y8y4lxvzx3g2shhhk9hh";
+  };
+  buildInputs = with pythonPackages; [ pytest responses ];
+  propagatedBuildInputs = with pythonPackages; [ colorama lxml requests pbr ];
+
+  disabled = pythonPackages.pythonOlder "3.3";
+
+  checkPhase = ''
+    py.test tests/
+  '';
+
+  meta = {
+    description = "A comic strip downloader and archiver";
+    homepage = http://dosage.rocks/;
+  };
+}
diff --git a/pkgs/applications/graphics/k3d/default.nix b/pkgs/applications/graphics/k3d/default.nix
index eb59b6ff6d6..996d495d87c 100644
--- a/pkgs/applications/graphics/k3d/default.nix
+++ b/pkgs/applications/graphics/k3d/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, fetchpatch, unzip, ftgl, glew, asciidoc
-, cmake, libGLU_combined, zlib, python, expat, libxml2, libsigcxx, libuuid, freetype
+, cmake, ninja, libGLU_combined, zlib, python, expat, libxml2, libsigcxx, libuuid, freetype
 , libpng, boost, doxygen, cairomm, pkgconfig, imagemagick, libjpeg, libtiff
 , gettext, intltool, perl, gtkmm2, glibmm, gtkglext, pangox_compat, libXmu }:
 
@@ -20,24 +20,25 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  cmakeFlags = "-DK3D_BUILD_DOCS=false -DK3D_BUILD_GUIDE=false";
+  cmakeFlags = [
+    "-DK3D_BUILD_DOCS=false"
+    "-DK3D_BUILD_GUIDE=false"
+  ];
 
   preConfigure = ''
     export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/build/lib"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE  -I$(echo ${gtkglext}/include/gtkglext-*) -I$(echo ${gtkglext}/lib/gtkglext-*/include)"
   '';
 
+  nativeBuildInputs = [ cmake ninja gettext intltool doxygen pkgconfig perl asciidoc ];
+
   buildInputs = [
-     cmake libGLU_combined zlib python expat libxml2 libsigcxx libuuid freetype libpng
-     boost doxygen cairomm pkgconfig imagemagick libjpeg libtiff
-     gettext intltool perl unzip ftgl glew asciidoc
-     gtkmm2 glibmm gtkglext pangox_compat libXmu
+     libGLU_combined zlib python expat libxml2 libsigcxx libuuid freetype libpng
+     boost cairomm imagemagick libjpeg libtiff
+     ftgl glew gtkmm2 glibmm gtkglext pangox_compat libXmu
     ];
 
   #doCheck = false;
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "A 3D editor with support for procedural editing";
     homepage = http://www.k-3d.org/;
diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix
index 42b69e24926..e5385c75280 100644
--- a/pkgs/applications/graphics/paraview/default.nix
+++ b/pkgs/applications/graphics/paraview/default.nix
@@ -1,5 +1,5 @@
 {
-stdenv, fetchFromGitHub, cmake
+stdenv, fetchFromGitHub, cmake, makeWrapper
 ,qtbase, qttools, python, libGLU_combined
 ,libXt, qtx11extras, qtxmlpatterns
 }:
@@ -18,11 +18,11 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-   cmakeFlags = [
-     "-DPARAVIEW_ENABLE_PYTHON=ON"
-     "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
-     "-DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION=OFF"
-   ];
+  cmakeFlags = [
+    "-DPARAVIEW_ENABLE_PYTHON=ON"
+    "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
+    "-DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION=OFF"
+  ];
 
   # During build, binaries are called that rely on freshly built
   # libraries.  These reside in build/lib, and are not found by
@@ -35,10 +35,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     cmake
+    makeWrapper
   ];
 
   buildInputs = [
     python
+    python.pkgs.numpy
     libGLU_combined
     libXt
     qtbase
@@ -47,6 +49,16 @@ stdenv.mkDerivation rec {
     qtxmlpatterns
   ];
 
+  # Paraview links into the Python library, resolving symbolic links on the way,
+  # so we need to put the correct sitePackages (with numpy) back on the path
+  postInstall = ''
+    wrapProgram $out/bin/paraview \
+      --set PYTHONPATH "${python.pkgs.numpy}/${python.sitePackages}"
+    wrapProgram $out/bin/pvbatch \
+      --set PYTHONPATH "${python.pkgs.numpy}/${python.sitePackages}"
+    wrapProgram $out/bin/pvpython \
+      --set PYTHONPATH "${python.pkgs.numpy}/${python.sitePackages}"
+  '';
 
   meta = {
     homepage = http://www.paraview.org/;
diff --git a/pkgs/applications/graphics/shotwell/default.nix b/pkgs/applications/graphics/shotwell/default.nix
index c214fa58bc9..1ebc2f88ec5 100644
--- a/pkgs/applications/graphics/shotwell/default.nix
+++ b/pkgs/applications/graphics/shotwell/default.nix
@@ -7,13 +7,13 @@
 
 let
   pname = "shotwell";
-  version = "0.28.1";
+  version = "0.28.2";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1ywikm5kdsr7q8hklh146x28rzvqkqfjs8kdpw7zcc15ri0dkzya";
+    sha256 = "0pa7lb33i4hdnz7hr7x938d48ilrnj47jzb99la79rmm08yyin8n";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/kde/default.nix b/pkgs/applications/kde/default.nix
index 0c080753f05..36dd1773b39 100644
--- a/pkgs/applications/kde/default.nix
+++ b/pkgs/applications/kde/default.nix
@@ -84,6 +84,7 @@ let
       incidenceeditor = callPackage ./incidenceeditor.nix {};
       k3b = callPackage ./k3b.nix {};
       kaddressbook = callPackage ./kaddressbook.nix {};
+      kalarm = callPackage ./kalarm.nix {};
       kalarmcal = callPackage ./kalarmcal.nix {};
       kate = callPackage ./kate.nix {};
       kcachegrind = callPackage ./kcachegrind.nix {};
diff --git a/pkgs/applications/kde/kalarm.nix b/pkgs/applications/kde/kalarm.nix
new file mode 100644
index 00000000000..9978e7ff667
--- /dev/null
+++ b/pkgs/applications/kde/kalarm.nix
@@ -0,0 +1,37 @@
+{
+  mkDerivation, lib,
+  extra-cmake-modules,
+
+  kauth, kcodecs, kcompletion, kconfig, kconfigwidgets, kdbusaddons, kdoctools,
+  kguiaddons, ki18n, kiconthemes, kjobwidgets, kcmutils, kdelibs4support, kio,
+  knotifications, kservice, kwidgetsaddons, kwindowsystem, kxmlgui, phonon,
+
+  kimap, akonadi, akonadi-contacts, akonadi-mime, kalarmcal, kcalcore, kcalutils,
+  kholidays, kidentitymanagement, libkdepim, mailcommon, kmailtransport, kmime,
+  pimcommon, kpimtextedit, kdepim-apps-libs, messagelib,
+
+  qtx11extras,
+
+  kdepim-runtime
+}:
+
+mkDerivation {
+  name = "kalarm";
+  meta = {
+    license = with lib.licenses; [ gpl2 ];
+    maintainers = [ lib.maintainers.rittelle ];
+  };
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [
+    kauth kcodecs kcompletion kconfig kconfigwidgets kdbusaddons kdoctools
+    kguiaddons ki18n kiconthemes kjobwidgets kcmutils kdelibs4support kio
+    knotifications kservice kwidgetsaddons kwindowsystem kxmlgui phonon
+
+    kimap akonadi akonadi-contacts akonadi-mime kalarmcal kcalcore kcalutils
+    kholidays kidentitymanagement libkdepim mailcommon kmailtransport kmime
+    pimcommon kpimtextedit kdepim-apps-libs messagelib
+
+    qtx11extras
+  ];
+  propagatedUserEnvPkgs = [ kdepim-runtime ];
+}
diff --git a/pkgs/applications/misc/alacritty/default.nix b/pkgs/applications/misc/alacritty/default.nix
index 6907ce87764..a5db33a0bb5 100644
--- a/pkgs/applications/misc/alacritty/default.nix
+++ b/pkgs/applications/misc/alacritty/default.nix
@@ -13,6 +13,7 @@
   libXxf86vm,
   libXi,
   libXrandr,
+  libGL,
   xclip }:
 
 with rustPlatform;
@@ -26,6 +27,7 @@ let
     libXcursor
     libXxf86vm
     libXrandr
+    libGL
     libXi
   ];
 in buildRustPackage rec {
diff --git a/pkgs/applications/misc/cbatticon/default.nix b/pkgs/applications/misc/cbatticon/default.nix
index 0c71b3ffb0a..01511b41b08 100644
--- a/pkgs/applications/misc/cbatticon/default.nix
+++ b/pkgs/applications/misc/cbatticon/default.nix
@@ -3,13 +3,13 @@
 stdenv.mkDerivation rec {
 
   name = "cbatticon-${version}";
-  version = "1.6.7";
+  version = "1.6.8";
 
   src = fetchFromGitHub {
     owner = "valr";
     repo = "cbatticon";
     rev = version;
-    sha256 = "0rm1rpq81cxjwd4f11c3ivg5hwsd08qm47vdn16yr1cmm2cw4r2d";
+    sha256 = "16g26vin1693dbdr9qsnw36fdchx394lp79gvp7gcbw0w1ny9av6";
   };
 
   makeFlags = "PREFIX=$(out)";
diff --git a/pkgs/applications/misc/guake/default.nix b/pkgs/applications/misc/guake/default.nix
index 0a2a17fc8fa..17837c6c254 100644
--- a/pkgs/applications/misc/guake/default.nix
+++ b/pkgs/applications/misc/guake/default.nix
@@ -1,76 +1,38 @@
-/* Beware!
-After starting Guake it will give the error message "Guake can not init! Gconf Error. Have you installed guake.schemas properly?",
-which will have to be resolved manually, because I have not found a way to automate this, without being impure.
-
-If you have Guake installed, you can use `nix-build -A gnome3.guake` to get the path to the build directory in the nix store,
-which then can be used in the following command to install the schemas file of Guake:
-gconftool-2 --install-schema-file /path/returned/by/nix-build/share/gconf/schemas/guake.schemas
-
-It can be removed again by the following command:
-gconftool-2 --recursive-unset /apps/guake
-*/
-{ stdenv, fetchurl, lib
-, pkgconfig, libtool, intltool, makeWrapper
-, dbus, gtk2, gconf, python2Packages, libutempter, vte, keybinder, gnome2, gnome3 }:
-
-with lib;
+{ stdenv, fetchFromGitHub, python3, gettext, gobjectIntrospection, wrapGAppsHook, glibcLocales
+, gtk3, keybinder3, libnotify, libutempter, vte }:
 
 let
-  inherit (python2Packages) python;
-  inputs = [ dbus gtk2 gconf python libutempter vte keybinder gnome3.gnome-common ];
-  pyPath = makeSearchPathOutput "lib" python.sitePackages (attrVals [ "dbus-python" "notify" "pyGtkGlade" "pyxdg" ] python2Packages ++ [ gnome2.gnome_python ]);
- in stdenv.mkDerivation rec {
+  version = "3.2.0";
+in python3.pkgs.buildPythonApplication rec {
   name = "guake-${version}";
-  version = "0.8.3";
+  format = "other";
 
-  src = fetchurl {
-    url = "https://github.com/Guake/guake/archive/${version}.tar.gz";
-    sha256 = "1lbmdz3i9a97840h8239s360hd37nmhy3hs6kancxbzl1512ak1y";
+  src = fetchFromGitHub {
+    owner = "Guake";
+    repo = "guake";
+    rev = version;
+    sha256 = "1qghapg9sslj9fdrl2mnbi10lgqgqa36gdag74wn7as9wak4qc3d";
   };
 
-  nativeBuildInputs = [ pkgconfig libtool intltool makeWrapper ];
-
-  buildInputs = inputs ++ (with python2Packages; [ pyGtkGlade pyxdg ]);
+  nativeBuildInputs = [ gettext gobjectIntrospection wrapGAppsHook python3.pkgs.pip glibcLocales ];
 
-  propagatedUserEnvPkgs = [ gconf.out ];
+  buildInputs = [ gtk3 keybinder3 libnotify python3 vte ];
 
-  patchPhase = ''
-    patchShebangs .
-  '';
+  propagatedBuildInputs = with python3.pkgs; [ dbus-python pbr pycairo pygobject3 ];
 
-  configureScript = "./autogen.sh";
+  LC_ALL = "en_US.UTF-8"; # fixes weird encoding error, see https://github.com/NixOS/nixpkgs/pull/38642#issuecomment-379727699
 
-  configureFlags = [
-    "--sysconfdir=/etc"
-    "--localstatedir=/var"
-    "--disable-schemas-install"
-  ];
+  PBR_VERSION = version; # pbr needs either .git directory, sdist, or env var
 
-  installFlags = [
-    # Configuring the installation to not install gconf schemas is not always supported,
-    # therefore gconftool-2 has this variable, which will make gconftool-2 not update any of the databases.
-    "GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1"
-    "sysconfdir=\${out}/etc"
-    "localstatedir=\${TMPDIR}"
+  makeFlags = [
+    "prefix=$(out)"
   ];
 
-  postInstall = ''
-    mkdir -p $out/share/gconf/schemas
-    cp data/guake.schemas $out/share/gconf/schemas
-  '';
-
-  postFixup = ''
-    for bin in $out/bin/{guake,guake-prefs}; do
-      substituteInPlace $bin \
-        --replace '/usr/bin/env python2' ${python.interpreter}
-      wrapProgram $bin \
-        --prefix XDG_DATA_DIRS : "$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
-        --prefix LD_LIBRARY_PATH : ${makeLibraryPath inputs} \
-        --prefix PYTHONPATH : "$out/${python.sitePackages}:${pyPath}:$PYTHONPATH"
-    done
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ libutempter ]}")
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Drop-down terminal for GNOME";
     homepage = http://guake-project.org;
     license = licenses.gpl2;
diff --git a/pkgs/applications/misc/masterpdfeditor/default.nix b/pkgs/applications/misc/masterpdfeditor/default.nix
index 19a45e7d17b..5ea49f28afd 100644
--- a/pkgs/applications/misc/masterpdfeditor/default.nix
+++ b/pkgs/applications/misc/masterpdfeditor/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, glibc, sane-backends, qtbase, qtsvg, libXext, libX11, libXdmcp, libXau, libxcb }:
   let
-    version = "4.3.82";
+    version = "4.3.89";
   in
     stdenv.mkDerivation {
       name = "masterpdfeditor-${version}";
       src = fetchurl {
         url = "http://get.code-industry.net/public/master-pdf-editor-${version}_qt5.amd64.tar.gz";
-        sha256 = "0bfqnpg2p5jxygcahqqljyb0gd2z28hj5n1j9g1x7px8f7wwiwl4";
+        sha256 = "0k5bzlhqglskiiq86nmy18mnh5bf2w3mr9cq3pibrwn5pisxnxxc";
       };
       libPath = stdenv.lib.makeLibraryPath [
         stdenv.cc.cc
diff --git a/pkgs/applications/misc/slic3r-prusa3d/default.nix b/pkgs/applications/misc/slic3r-prusa3d/default.nix
index 3a55ea6205e..1ee2bfab94c 100644
--- a/pkgs/applications/misc/slic3r-prusa3d/default.nix
+++ b/pkgs/applications/misc/slic3r-prusa3d/default.nix
@@ -52,6 +52,7 @@ stdenv.mkDerivation rec {
     ClassXSAccessor
     EncodeLocale
     ExtUtilsMakeMaker
+    ExtUtilsTypemapsDefault
     ExtUtilsXSpp
     GrowlGNTP
     ImportInto
@@ -62,7 +63,7 @@ stdenv.mkDerivation rec {
     MathConvexHullMonotoneChain
     MathGeometryVoronoi
     MathPlanePath
-    ModuleBuild
+    ModuleBuildWithXSpp
     Moo
     NetDBus
     OpenGL
diff --git a/pkgs/applications/misc/terminator/default.nix b/pkgs/applications/misc/terminator/default.nix
index 59ea70e3da2..2fef852ace9 100644
--- a/pkgs/applications/misc/terminator/default.nix
+++ b/pkgs/applications/misc/terminator/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, pythonPackages, keybinder, vte, gettext, intltool, file, gtk3, gobjectIntrospection, cairo
-, wrapGAppsHook, gnome3
+{ stdenv, fetchurl, python2, keybinder3, intltool, file, gtk3, gobjectIntrospection
+, libnotify, wrapGAppsHook, gnome3
 }:
 
-pythonPackages.buildPythonApplication rec {
+python2.pkgs.buildPythonApplication rec {
   name = "terminator-${version}";
   version = "1.91";
 
@@ -11,13 +11,9 @@ pythonPackages.buildPythonApplication rec {
     sha256 = "95f76e3c0253956d19ceab2f8da709a496f1b9cf9b1c5b8d3cd0b6da3cc7be69";
   };
 
-  nativeBuildInputs = [ file intltool wrapGAppsHook ];
-  buildInputs = [ gtk3 gnome3.vte gobjectIntrospection cairo ];
-
-  pythonPath = with pythonPackages; [
-    pygobject3 vte keybinder notify gettext psutil
-    pycairo
-  ];
+  nativeBuildInputs = [ file intltool wrapGAppsHook gobjectIntrospection ];
+  buildInputs = [ gtk3 gnome3.vte libnotify keybinder3 ];
+  propagatedBuildInputs = with python2.pkgs; [ pygobject3 psutil pycairo ];
 
   postPatch = ''
     patchShebangs .
diff --git a/pkgs/applications/misc/xtermcontrol/default.nix b/pkgs/applications/misc/xtermcontrol/default.nix
index eae5240129a..ae31ebd1ca7 100644
--- a/pkgs/applications/misc/xtermcontrol/default.nix
+++ b/pkgs/applications/misc/xtermcontrol/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  version = "3.3";
+  version = "3.4";
   name = "xtermcontrol-${version}";
 
   src = fetchurl {
     url = "http://thrysoee.dk/xtermcontrol/xtermcontrol-${version}.tar.gz";
-    sha256 = "1v2c1cnx43apmspga7icssh5ndbhzy5h82y6vm8fda40flq9mxj5";
+    sha256 = "1g81v9gfn08gjn1269j0qx12x36s9j6x39gl91ycay391flgzr5l";
   };
 
   meta = {
diff --git a/pkgs/applications/networking/browsers/firefox-bin/default.nix b/pkgs/applications/networking/browsers/firefox-bin/default.nix
index 3a6dd626ac6..5b01daeef51 100644
--- a/pkgs/applications/networking/browsers/firefox-bin/default.nix
+++ b/pkgs/applications/networking/browsers/firefox-bin/default.nix
@@ -174,6 +174,8 @@ stdenv.mkDerivation {
 
   passthru.ffmpegSupport = true;
   passthru.gssSupport = true;
+  # update with:
+  # $ nix-shell maintainers/scripts/update.nix --argstr package firefox-bin-unwrapped
   passthru.updateScript = import ./update.nix {
     inherit name channel writeScript xidel coreutils gnused gnugrep gnupg curl;
     baseUrl =
diff --git a/pkgs/applications/networking/c14/default.nix b/pkgs/applications/networking/c14/default.nix
index 33a1e8a5c08..242abc2ece7 100644
--- a/pkgs/applications/networking/c14/default.nix
+++ b/pkgs/applications/networking/c14/default.nix
@@ -1,17 +1,16 @@
 { stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
-  name = "c14-cli-unstable-${version}";
-  version = "2017-05-15";
-  rev = "97f437ef5133f73edd551c883db3076c76cb1f6b";
+  name = "c14-cli-${version}";
+  version = "0.3";
 
   goPackagePath = "github.com/online-net/c14-cli";
 
   src = fetchFromGitHub {
     owner = "online-net";
     repo = "c14-cli";
-    inherit rev;
-    sha256 = "1b44bh0zhh6rhw4d3nprnnxhjgaskl9kzp2cvwwyli5svhjxrfdj";
+    rev = "${version}";
+    sha256 = "0b1piviy6vvdbak8y8bc24rk3c1fi67vv3352pmnzvrhsar2r5yf";
   };
 
   goDeps = ./deps.nix;
diff --git a/pkgs/applications/networking/cluster/heptio-ark/default.nix b/pkgs/applications/networking/cluster/heptio-ark/default.nix
new file mode 100644
index 00000000000..d24c307fcce
--- /dev/null
+++ b/pkgs/applications/networking/cluster/heptio-ark/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "heptio-ark-${version}";
+  version = "0.7.1";
+
+  goPackagePath = "github.com/heptio/ark";
+
+  src = fetchFromGitHub {
+    rev = "v${version}";
+    owner = "heptio";
+    repo = "ark";
+    sha256 = "0j3x9zxcffxhlw0fxq2cw9ph37bqw90cbmf9xshmnj8yl9rbxp7y";
+  };
+
+  postInstall = "rm $bin/bin/generate";
+
+  meta = with stdenv.lib; {
+    description = "A utility for managing disaster recovery, specifically for your Kubernetes cluster resources and persistent volumes";
+    homepage = https://heptio.github.io/ark/;
+    license = licenses.asl20;
+    maintainers = [maintainers.mbode];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/hipchat/default.nix b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
index e24ea5e6fb3..dd1ce2264d5 100644
--- a/pkgs/applications/networking/instant-messengers/hipchat/default.nix
+++ b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
@@ -4,7 +4,7 @@
 
 let
 
-  version = "4.30.3.1670";
+  version = "4.30.4.1672";
 
   rpath = stdenv.lib.makeLibraryPath [
     xdg_utils
@@ -44,7 +44,7 @@ let
     if stdenv.system == "x86_64-linux" then
       fetchurl {
         url = "https://atlassian.artifactoryonline.com/atlassian/hipchat-apt-client/pool/HipChat4-${version}-Linux.deb";
-        sha256 = "0alqzay6bvi7ybrrdk5r0xkg4sx6qjsqbgmr16bkqxncxhb215ay";
+        sha256 = "1xrwndhbyhcmjcg8h1ib8lp1g51f7jxdhc6p7776zmhlfw94n3rx";
       }
     else
       throw "HipChat is not supported on ${stdenv.system}";
diff --git a/pkgs/applications/networking/instant-messengers/nheko/default.nix b/pkgs/applications/networking/instant-messengers/nheko/default.nix
index 90a546154d1..8405769582f 100644
--- a/pkgs/applications/networking/instant-messengers/nheko/default.nix
+++ b/pkgs/applications/networking/instant-messengers/nheko/default.nix
@@ -47,13 +47,13 @@ let
 in
 stdenv.mkDerivation rec {
   name = "nheko-${version}";
-  version = "0.3.0";
+  version = "0.3.1";
 
   src = fetchFromGitHub {
     owner = "mujx";
     repo = "nheko";
     rev = "v${version}";
-    sha256 = "178z64vkl7nmr1amgsgvdcwipj8czp7vbvidxllxiwal21yvqpky";
+    sha256 = "1dqd698p6wicz0x1lb6mzlwcp68sjkivanb9lwz3yy1mlmy8i3jn";
   };
 
   # This patch is likely not strictly speaking needed, but will help detect when
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-discord/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-discord/default.nix
new file mode 100644
index 00000000000..e41aea497a8
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-discord/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, pkgconfig, pidgin, json_glib }:
+
+stdenv.mkDerivation rec {
+  name = "purple-discord-${version}";
+  version = "unstable-2018-04-10";
+
+  src = fetchFromGitHub {
+    owner = "EionRobb";
+    repo = "purple-discord";
+    rev = "9a97886d15a1f028de54b5e6fc54e784531063b0";
+    sha256 = "0dc344zh1v4yh9c8javcw5ylzwc1wpx0ih8bww8p8cjmhr8kcl32";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ pidgin json_glib ];
+
+  makeFlags = [
+    "DESTDIR=$(out)"
+  ];
+
+  PKG_CONFIG_PURPLE_PLUGINDIR = "/lib/purple-2";
+  PKG_CONFIG_PURPLE_DATADIR = "/share";
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/EionRobb/purple-discord;
+    description = "Discord plugin for Pidgin";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ sna ];
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-hangouts/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-hangouts/default.nix
index 460143e3549..e304c139eea 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-hangouts/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-hangouts/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "purple-hangouts-hg-${version}";
-  version = "2017-10-08";
+  version = "2018-03-28";
 
   src = fetchhg {
     url = "https://bitbucket.org/EionRobb/purple-hangouts/";
-    rev = "5e769791d282a6e5ae4d94dc66a1ff9d6904ec9c";
-    sha256 = "0cs7dcd44lkc2anradyddjvmfvnl46ixw4idaf1m9fd7j35mg7b1";
+    rev = "0e137e6bf9e95c5a0bd282f3ad4a5bd00a6968ab";
+    sha256 = "04vjgz6qyd9ilv1c6n08r45vc683vxs1rgfwhh65pag6q4rbzlb9";
   };
 
   buildInputs = [ pidgin glib json-glib protobuf protobufc ];
diff --git a/pkgs/applications/networking/instant-messengers/riot/riot-web.nix b/pkgs/applications/networking/instant-messengers/riot/riot-web.nix
index b47280d3b15..0d3342e6668 100644
--- a/pkgs/applications/networking/instant-messengers/riot/riot-web.nix
+++ b/pkgs/applications/networking/instant-messengers/riot/riot-web.nix
@@ -3,11 +3,11 @@
 let configFile = writeText "riot-config.json" conf; in
 stdenv.mkDerivation rec {
   name= "riot-web-${version}";
-  version = "0.13.5";
+  version = "0.14.0";
 
   src = fetchurl {
     url = "https://github.com/vector-im/riot-web/releases/download/v${version}/riot-v${version}.tar.gz";
-    sha256 = "1ap62ksi3dg7qijxxysjpnlmngzgh2jdldvb8s1jx14avanccch6";
+    sha256 = "0san8d3dghjkqqv0ypampgl7837mxk9w64ci6fzy1k5d5dmdgvsi";
   };
 
   installPhase = ''
diff --git a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
index 74f784a1ba1..d524be287cd 100644
--- a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
+++ b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
@@ -40,13 +40,13 @@ in
   stdenv.mkDerivation rec {
     name = "signal-desktop-${version}";
 
-    version = "1.6.1";
+    version = "1.7.1";
 
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
           url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
-          sha256 = "0q2qzl84ifnhcn1qbq38fdpj8ry748h6dlzp2mdpkslsh8mc46as";
+          sha256 = "02zx8ynbvvs260mrvqbsg0fi561da4ni3i9f4bjh53vqn92vhvvq";
         }
       else
         throw "Signal for Desktop is not currently supported on ${stdenv.system}";
diff --git a/pkgs/applications/networking/mailreaders/mutt/default.nix b/pkgs/applications/networking/mailreaders/mutt/default.nix
index 03bfc711c43..bbd56b188df 100644
--- a/pkgs/applications/networking/mailreaders/mutt/default.nix
+++ b/pkgs/applications/networking/mailreaders/mutt/default.nix
@@ -27,11 +27,11 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "mutt-${version}";
-  version = "1.9.4";
+  version = "1.9.5";
 
   src = fetchurl {
     url = "http://ftp.mutt.org/pub/mutt/${name}.tar.gz";
-    sha256 = "1pxmw5yyizb9bqbai6lihv6zxmw0znjfb60zaldwh6hc6lkbzlgl";
+    sha256 = "0lsp72lm3cw490x7lhzia7h8f591bab2mr7qpscaj22fmrj7wqdz";
   };
 
   patches = optional smimeSupport (fetchpatch {
diff --git a/pkgs/applications/networking/sync/backintime/qt4.nix b/pkgs/applications/networking/sync/backintime/qt4.nix
index ef8f0282749..b8f388c63eb 100644
--- a/pkgs/applications/networking/sync/backintime/qt4.nix
+++ b/pkgs/applications/networking/sync/backintime/qt4.nix
@@ -1,7 +1,7 @@
 {stdenv, fetchurl, makeWrapper, gettext, pkgconfig, libtool, backintime-common, python3, python3Packages }:
 
 stdenv.mkDerivation rec {
-  inherit (backintime-common) version src installFlags meta;
+  inherit (backintime-common) version src installFlags;
 
   name = "backintime-qt4-${version}";
 
@@ -22,4 +22,7 @@ stdenv.mkDerivation rec {
         --prefix PATH : "${backintime-common}/bin:$PATH"
     '';
 
+  meta = with stdenv.lib; {
+    broken = true;
+  };
 }
diff --git a/pkgs/applications/networking/testssl/default.nix b/pkgs/applications/networking/testssl/default.nix
index 97c05dfafdb..5a548d5ff65 100644
--- a/pkgs/applications/networking/testssl/default.nix
+++ b/pkgs/applications/networking/testssl/default.nix
@@ -1,9 +1,8 @@
-{ stdenv, fetchFromGitHub, pkgs }:
+{ stdenv, fetchFromGitHub, makeWrapper, lib
+, dnsutils, coreutils, openssl, nettools, utillinux, procps }:
 
 let
-  version = "2.9.5-4";
-  pwdBinPath = "${stdenv.lib.makeBinPath (with pkgs; [ coreutils ])}/pwd";
-  opensslBinPath = "${stdenv.lib.makeBinPath (with pkgs; [ openssl ])}/openssl";
+  version = "2.9.5-5";
 
 in stdenv.mkDerivation rec {
   name = "testssl.sh-${version}";
@@ -12,22 +11,32 @@ in stdenv.mkDerivation rec {
     owner = "drwetter";
     repo = "testssl.sh";
     rev = "v${version}";
-    sha256 = "0pfp7r4jhvkh06vawqlvq7vp4imwp6dpq6jx8m0k3j85ywwp45pd";
+    sha256 = "0zgj9vhd8fv3a1cn8dxqmjd8qmgryc867gq7zbvbr41lkqc06a1r";
   };
 
-  patches = [ ./testssl.patch ];
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [
+    coreutils # for pwd and printf
+    dnsutils  # for dig
+    nettools  # for hostname
+    openssl   # for openssl
+    procps    # for ps
+    utillinux # for hexdump
+  ];
 
   postPatch = ''
     substituteInPlace testssl.sh                                               \
-      --replace /bin/pwd                    ${pwdBinPath}                      \
-      --replace TESTSSL_INSTALL_DIR:-\"\"   TESTSSL_INSTALL_DIR:-\"$out\"      \
-      --replace @@openssl-path@@            ${opensslBinPath}
+      --replace /bin/pwd                    pwd                                \
+      --replace TESTSSL_INSTALL_DIR:-\"\"   TESTSSL_INSTALL_DIR:-\"$out\"
   '';
 
   installPhase = ''
-    mkdir -p $out/bin $out/etc
-    cp -r etc/ $out/
-    cp testssl.sh $out/bin/testssl.sh
+    install -Dt $out/bin testssl.sh
+
+    wrapProgram $out/bin/testssl.sh                                            \
+      --prefix PATH ':' ${lib.makeBinPath buildInputs}
+
+    cp -r etc $out
   '';
 
   meta = with stdenv.lib; {
@@ -38,6 +47,6 @@ in stdenv.mkDerivation rec {
     '';
     homepage = https://testssl.sh/;
     license = licenses.gpl2;
-    maintainers = [ maintainers.etu ];
+    maintainers = with maintainers; [ etu ];
   };
 }
diff --git a/pkgs/applications/networking/testssl/testssl.patch b/pkgs/applications/networking/testssl/testssl.patch
deleted file mode 100644
index ffc9e4b1c16..00000000000
--- a/pkgs/applications/networking/testssl/testssl.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- testssl/testssl.sh	2017-09-24 16:53:29.395263437 +0200
-+++ testssl-new/testssl.sh	2017-09-24 16:53:41.221154492 +0200
-@@ -165,6 +165,7 @@
- # following variables make use of $ENV, e.g. OPENSSL=<myprivate_path_to_openssl> ./testssl.sh <host>
- # 0 means (normally) true here. Some of the variables are also accessible with a command line switch, see --help
- declare -x OPENSSL OPENSSL_TIMEOUT
-+OPENSSL=${OPENSSL:-"@@openssl-path@@"}
- FAST_SOCKET=${FAST_SOCKET:-false}       # EXPERIMENTAL feature to accelerate sockets -- DO NOT USE it for production
- COLOR=${COLOR:-2}                       # 2: Full color, 1: b/w+positioning, 0: no ESC at all
- COLORBLIND=${COLORBLIND:-false}         # if true, swap blue and green in the output
diff --git a/pkgs/applications/office/libreoffice/still.nix b/pkgs/applications/office/libreoffice/still.nix
index d1e80724aaf..b4139d54af5 100644
--- a/pkgs/applications/office/libreoffice/still.nix
+++ b/pkgs/applications/office/libreoffice/still.nix
@@ -2,7 +2,7 @@
 , CompressZlib, zlib, libjpeg, expat, pkgconfigUpstream, freetype, libwpd
 , libxml2, db, sablotron, curl, fontconfig, libsndfile, neon
 , bison, flex, zip, unzip, gtk3, gtk2, libmspack, getopt, file, cairo, which
-, icu, boost, jdk, ant, cups, xorg, libcmis
+, icu, boost, jdk, ant, cups, xorg, libcmis, carlito
 , openssl, gperf, cppunit, GConf, ORBit2, poppler
 , librsvg, gnome_vfs, libGLU_combined, bsh, CoinMP, libwps, libabw
 , autoconf, automake, openldap, bash, hunspell, librdf_redland, nss, nspr
@@ -106,6 +106,11 @@ in stdenv.mkDerivation rec {
 
     # BLFS patch for Glibc 2.23 renaming isnan
     sed -ire "s@isnan@std::&@g" xmloff/source/draw/ximp3dscene.cxx
+
+    # This is required as some cppunittests require fontconfig configured
+    cp "${fontsConf}" fonts.conf
+    sed -e '/include/i<include>${carlito}/etc/fonts/conf.d</include>' -i fonts.conf
+    export FONTCONFIG_FILE="$PWD/fonts.conf"
   '';
 
   # fetch_Download_item tries to interpret the name as a variable name
diff --git a/pkgs/applications/office/libreoffice/wrapper.sh b/pkgs/applications/office/libreoffice/wrapper.sh
index 591b4251506..52cd91e8030 100644
--- a/pkgs/applications/office/libreoffice/wrapper.sh
+++ b/pkgs/applications/office/libreoffice/wrapper.sh
@@ -3,21 +3,12 @@ export JAVA_HOME="${JAVA_HOME:-@jdk@}"
 export SAL_USE_VCLPLUGIN="${SAL_USE_VCLPLUGIN:-gen}"
 
 if uname | grep Linux > /dev/null && 
-       ! ( test -n "$DBUS_SESSION_BUS_ADDRESS" && 
-         test -n "$DBUS_SYSTEM_BUS_ADDRESS" ); then
+       ! ( test -n "$DBUS_SESSION_BUS_ADDRESS" ); then
     dbus_tmp_dir="/run/user/$(id -u)/libreoffice-dbus"
     mkdir "$dbus_tmp_dir"
     dbus_socket_dir="$(mktemp -d -p "$dbus_tmp_dir")"
-    cat "@dbus@/share/dbus-1/system.conf" |
-        grep -v '[<]user[>]messagebus' > "$dbus_socket_dir/system.conf"
-    if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
-        "@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "@dbus@"/share/dbus-1/session.conf --address "unix:path=$dbus_socket_dir/session"  >&2 &
-        export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"
-    fi
-    if test -z "$DBUS_SYSTEM_BUS_ADDRESS"; then
-        "@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "$dbus_socket_dir/system.conf" --address "unix:path=$dbus_socket_dir/system" >&2 &
-        export DBUS_SYSTEM_BUS_ADDRESS="unix:path=$dbus_socket_dir/system"
-    fi
+    "@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "@dbus@"/share/dbus-1/session.conf --address "unix:path=$dbus_socket_dir/session"  >&2 &
+    export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"
 fi
 
 "@libreoffice@/bin/$(basename "$0")" "$@"
diff --git a/pkgs/applications/office/marp/default.nix b/pkgs/applications/office/marp/default.nix
index c5dc9198740..7f6d93a11ae 100644
--- a/pkgs/applications/office/marp/default.nix
+++ b/pkgs/applications/office/marp/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "marp-${version}";
-  version = "0.0.11";
+  version = "0.0.12";
 
   src = fetchurl {
     url = "https://github.com/yhatt/marp/releases/download/v${version}/${version}-Marp-linux-x64.tar.gz";
-    sha256 = "06kka6kxrj35w23n34in6ks3vax9arl756jg720jhfy14vavyk0f";
+    sha256 = "0pljjkis9vb819d0akqmqnyakwgnvc3qqyg20yr13xms9a5iqv32";
   };
   sourceRoot = ".";
 
diff --git a/pkgs/applications/science/astronomy/celestia/default.nix b/pkgs/applications/science/astronomy/celestia/default.nix
index 328253c5343..589625cc18f 100644
--- a/pkgs/applications/science/astronomy/celestia/default.nix
+++ b/pkgs/applications/science/astronomy/celestia/default.nix
@@ -56,12 +56,10 @@ stdenv.mkDerivation {
     patch -Np1 -i "${gcc47Patch}"
   '';
 
-  configureFlags = "--with-gtk --with-lua=${lua}";
-  CPPFLAGS = "-DNDEBUG";
-  CFLAGS = "-O2 -fsigned-char";
-  CXXFLAGS = "-O2 -fsigned-char";
-  GTK_CFLAGS = "-I${gtk2.dev}/include/gtk-2.0 -I${gtk2.out}/lib/gtk-2.0/include -I${glib.dev}/include/glib-2.0 -I${glib.out}/lib/glib-2.0/include -I${cairo.dev}/include/cairo -I${pango.dev}/include/pango-1.0 -I${gdk_pixbuf.dev}/include/gdk-pixbuf-2.0 -I${atk.dev}/include/atk-1.0 -I${gtkglext}/include/gtkglext-1.0 -I${gtkglext}/lib/gtkglext-1.0/include";
-  GTK_LIBS = "-lgtk-x11-2.0 -lgtkglext-x11-1.0 -lcairo -lgdk_pixbuf-2.0 -lpango-1.0 -lgobject-2.0";
+  configureFlags = [
+    "--with-gtk"
+    "--with-lua=${lua}"
+  ];
 
   installPhase = ''make MKDIR_P="mkdir -p" install'';
 
@@ -69,7 +67,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Free space simulation";
-    homepage = http://www.shatters.net/celestia/;
+    homepage = https://celestia.space/;
     license = stdenv.lib.licenses.gpl2;
 
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/science/logic/elan/default.nix b/pkgs/applications/science/logic/elan/default.nix
index 72b4ae2049e..a59528b86b0 100644
--- a/pkgs/applications/science/logic/elan/default.nix
+++ b/pkgs/applications/science/logic/elan/default.nix
@@ -2,7 +2,7 @@
 
 rustPlatform.buildRustPackage rec {
   name = "elan-${version}";
-  version = "0.3.0";
+  version = "0.3.2";
 
   cargoSha256 = "01d3s47fjszxx8s5gr3haxq3kz3hswkrkr8x97wx8l4nfhm8ndd2";
 
@@ -10,7 +10,7 @@ rustPlatform.buildRustPackage rec {
     owner = "kha";
     repo = "elan";
     rev = "v${version}";
-    sha256 = "116v9v1v5a6fr6h4dgxzwczpy4pbf96cnx6nss6a5y8vbhx9c1mj";
+    sha256 = "13r110382dh7848lpn3mrhc5bgmj373sbpx1326ryx3wl5kfp8rs";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index d6d3b505e35..c3eeddef669 100644
--- a/pkgs/applications/science/math/maxima/default.nix
+++ b/pkgs/applications/science/math/maxima/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, sbcl, texinfo, perl, python, makeWrapper, rlwrap ? null,
-tk ? null, gnuplot ? null, ecl ? null, ecl-fasl ? false
+{ stdenv, fetchurl, fetchpatch, sbcl, texinfo, perl, python, makeWrapper, rlwrap ? null
+, tk ? null, gnuplot ? null, ecl ? null, ecl-fasl ? false
 }:
 
 let
@@ -11,6 +11,7 @@ let
       (stdenv.lib.filter (x: x != null) [ sbcl ecl rlwrap tk gnuplot ]);
 in
 stdenv.mkDerivation ({
+  inherit version;
   name = "${name}-${version}";
 
   src = fetchurl {
@@ -18,8 +19,9 @@ stdenv.mkDerivation ({
     sha256 = "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s";
   };
 
-  buildInputs = stdenv.lib.filter (x: x != null)
-    [sbcl ecl texinfo perl python makeWrapper];
+  buildInputs = stdenv.lib.filter (x: x != null) [
+    sbcl ecl texinfo perl python makeWrapper
+  ];
 
   postInstall = ''
     # Make sure that maxima can find its runtime dependencies.
@@ -36,6 +38,39 @@ stdenv.mkDerivation ({
    '')
   ;
 
+  patches = [
+    # fix path to info dir (see https://trac.sagemath.org/ticket/11348)
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/infodir.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "09v64n60f7i6frzryrj0zd056lvdpms3ajky4f9p6kankhbiv21x";
+    })
+
+    # fix https://sourceforge.net/p/maxima/bugs/2596/
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/matrixexp.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "06961hn66rhjijfvyym21h39wk98sfxhp051da6gz0n9byhwc6zg";
+    })
+
+    # undo https://sourceforge.net/p/maxima/code/ci/f5e9b0f7eb122c4e48ea9df144dd57221e5ea0ca, see see https://trac.sagemath.org/ticket/13364#comment:93
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/undoing_true_false_printing_patch.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0fvi3rcjv6743sqsbgdzazy9jb6r1p1yq63zyj9fx42wd1hgf7yx";
+    })
+
+    # upstream bug https://sourceforge.net/p/maxima/bugs/2520/ (not fixed)
+    # introduced in https://trac.sagemath.org/ticket/13364
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0xa0b6cr458zp7lc7qi0flv5ar0r3ivsqhjl0c3clv86di2y522d";
+    })
+  ] ++ stdenv.lib.optionals ecl-fasl [
+    # build fasl, needed for ECL support
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/maxima.system.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "18zafig8vflhkr80jq2ivk46k92dkszqlyq8cfmj0b2vcfjwwbar";
+    })
+  ];
+
   # Failures in the regression test suite won't abort the build process. We run
   # the suite only so that potential errors show up in the build log. See also:
   # http://sourceforge.net/tracker/?func=detail&aid=3365831&group_id=4933&atid=104933.
@@ -57,10 +92,5 @@ stdenv.mkDerivation ({
 
     platforms = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.peti ];
-    broken = ecl != null;
   };
-} // (stdenv.lib.optionalAttrs ecl-fasl {
-  preConfigure = ''
-    sed -e '/c::build-program "binary-ecl\/maxima"/i(c::build-fasl "binary-ecl\/maxima.fasl" :lisp-files obj :ld-flags (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*" (find-package "MAXIMA"))))) (if (and x (not (string= x ""))) (list x))))' -i src/maxima.system
-  '';
-}))
+})
diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix
index 8cd9355a0f6..882d481a7f9 100644
--- a/pkgs/applications/science/math/singular/default.nix
+++ b/pkgs/applications/science/math/singular/default.nix
@@ -1,23 +1,52 @@
 { stdenv, fetchurl, gmp, bison, perl, autoconf, ncurses, readline, coreutils, pkgconfig
-, asLibsingular ? false
+, autoreconfHook
+, flint
+, ntl
+, cddlib
+, enableFactory ? true
+, enableGfanlib ? true
 }:
 
 stdenv.mkDerivation rec {
-  name = "singular-${version}";
-  version="3-1-7";
+  name = "singular-${version}${patchVersion}";
+  version = "4.1.1";
+  patchVersion = "p1";
 
+  urlVersion = builtins.replaceStrings [ "." ] [ "-" ] version;
   src = fetchurl {
-    url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${version}/Singular-${version}.tar.gz";
-    sha256 = "1j4mcpnwzdp3h4qspk6ww0m67rmx4s11cy17pvzbpf70lm0jzzh2";
+    url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${urlVersion}/singular-${version}${patchVersion}.tar.gz";
+    sha256 = "0wvgz7l1b7zkpmim0r3mvv4fp8xnhlbz4c7hc90rn30snlansnf1";
   };
 
-  buildInputs = [ gmp perl ncurses readline ];
-  nativeBuildInputs = [ autoconf bison pkgconfig ];
+  configureFlags = stdenv.lib.optionals enableFactory [
+    "--enable-factory"
+  ] ++ stdenv.lib.optionals enableGfanlib [
+    "--enable-gfanlib"
+  ];
+
+  postUnpack = ''
+    patchShebangs .
+  '';
+
+  # For reference (last checked on commit 75f460d):
+  # https://github.com/Singular/Sources/blob/spielwiese/doc/Building-Singular-from-source.md
+  # https://github.com/Singular/Sources/blob/spielwiese/doc/external-packages-dynamic-modules.md
+  buildInputs = [
+    # necessary
+    gmp
+    # by upstream recommended but optional
+    ncurses
+    readline
+    ntl
+    flint
+  ] ++ stdenv.lib.optionals enableGfanlib [
+    cddlib
+  ];
+  nativeBuildInputs = [ autoconf bison perl pkgconfig autoreconfHook ];
 
   preConfigure = ''
     find . -type f -exec sed -e 's@/bin/rm@${coreutils}&@g' -i '{}' ';'
     find . -type f -exec sed -e 's@/bin/uname@${coreutils}&@g' -i '{}' ';'
-    ${stdenv.lib.optionalString asLibsingular ''NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DLIBSINGULAR"''}
   '';
 
   hardeningDisable = stdenv.lib.optional stdenv.isi686 "stackprotector";
@@ -27,17 +56,21 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     mkdir -p "$out"
-    cp -r Singular/LIB "$out/LIB"
-    make install${stdenv.lib.optionalString asLibsingular "-libsingular"}
-
-    binaries="$(find "$out"/* \( -type f -o -type l \) -perm -111 \! -name '*.so' -maxdepth 1)"
-    ln -s "$out"/*/{include,lib} "$out"
-    mkdir -p "$out/bin"
-    for b in $binaries; do
-      bbn="$(basename "$b")"
-      echo -e '#! ${stdenv.shell}\n"'"$b"'" "$@"' > "$out/bin/$bbn"
-      chmod a+x "$out/bin/$bbn"
-    done
+    cp -r Singular/LIB "$out/lib"
+    make install
+
+    # Make sure patchelf picks up the right libraries
+    rm -rf libpolys factory resources omalloc Singular
+  '';
+
+  # simple test to make sure singular starts and finds its libraries
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/Singular -c 'LIB "freegb.lib"; exit;'
+    if [ $? -ne 0 ]; then
+        echo >&2 "Error loading the freegb library in Singular."
+        exit 1
+    fi
   '';
 
   enableParallelBuilding = true;
@@ -47,7 +80,7 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ raskin ];
     platforms = subtractLists platforms.i686 platforms.linux;
     license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
-    homepage = http://www.singular.uni-kl.de/index.php;
+    homepage = http://www.singular.uni-kl.de;
     downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
   };
 }
diff --git a/pkgs/applications/version-management/cvs/default.nix b/pkgs/applications/version-management/cvs/default.nix
index a330db6a8d6..8a729c28da9 100644
--- a/pkgs/applications/version-management/cvs/default.nix
+++ b/pkgs/applications/version-management/cvs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, nano }:
+{ stdenv, fetchurl, fetchpatch, nano }:
 
 stdenv.mkDerivation {
   name = "cvs-1.12.13";
@@ -12,6 +12,10 @@ stdenv.mkDerivation {
     ./getcwd-chroot.patch
     ./CVE-2012-0804.patch
     ./CVE-2017-12836.patch
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/Homebrew/formula-patches/24118ec737c7/cvs/vasnprintf-high-sierra-fix.diff";
+      sha256 = "1ql6aaia7xkfq3vqhlw5bd2z2ywka82zk01njs1b2szn699liymg";
+    })
   ];
 
   hardeningDisable = [ "fortify" "format" ];
diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix
index f75515b1cc0..6669d6d6044 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -13,7 +13,7 @@
 }:
 
 let
-  version = "2.17.0";
+  version = "2.16.3";
   svn = subversionClient.override { perlBindings = true; };
 in
 
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz";
-    sha256 = "1ismz7nsz8dgjmk782xr9s0mr2qh06f72pdcgbxfmnw1bvlya5p9";
+    sha256 = "0j1dwvg5llnj3g0fp8hdgpms4hp90qw9f6509vqw30dhwplrjpfn";
   };
 
   hardeningDisable = [ "format" ];
diff --git a/pkgs/applications/version-management/sit/default.nix b/pkgs/applications/version-management/sit/default.nix
index eae72739ec2..84211543c3b 100644
--- a/pkgs/applications/version-management/sit/default.nix
+++ b/pkgs/applications/version-management/sit/default.nix
@@ -2,19 +2,19 @@
 
 rustPlatform.buildRustPackage rec {
   name = "sit-${version}";
-  version = "0.2.1";
+  version = "0.3.0";
 
   src = fetchFromGitHub {
     owner = "sit-it";
     repo = "sit";
     rev = "v${version}";
-    sha256 = "1gcw5fqaqpxl2xgry0w8750g2msrk884zj1slym6r3nj7s2m9j22";
+    sha256 = "1si4fg02wxi35hpkr58na06h19yjw6qd9c5mbb9xfkkzgz5mnssj";
   };
 
-  cargoSha256 = "0hb82j97m8vw8m6gpb6s3bbi31xxv9nqh3aq7hkbmp1pqc02sg3q";
+  cargoSha256 = "083p7z7blj064840ddgnxvqjmih4bmy92clds3qgv5v7lh63wfmn";
 
   meta = with stdenv.lib; {
-    description = "SCM-agnostic, file-based, offline-first, immutable issue tracker";
+    description = "Serverless Information Tracker";
     homepage = http://sit-it.org/;
     license = with licenses; [ asl20 /* or */ mit ];
     maintainers = with maintainers; [ dywedir ];
diff --git a/pkgs/applications/version-management/vcsh/default.nix b/pkgs/applications/version-management/vcsh/default.nix
index 77663e858ef..0f0eec7ef9c 100644
--- a/pkgs/applications/version-management/vcsh/default.nix
+++ b/pkgs/applications/version-management/vcsh/default.nix
@@ -1,29 +1,22 @@
-{ stdenv, fetchpatch, fetchFromGitHub, which, git, ronn, perl, ShellCommand, TestMost }:
+{ stdenv, fetchFromGitHub, which, git, ronn, perl, ShellCommand
+, TestMost, TestDifferences, TestDeep, TestException, TestWarn
+}:
 
 stdenv.mkDerivation rec {
-  version = "1.20170226";       # date of commit we're pulling
+  version = "1.20170915";       # date of commit we're pulling
   name = "vcsh-${version}";
 
   src = fetchFromGitHub {
     owner = "RichiH";
     repo = "vcsh";
-    rev = "36a7cedf196793a6d99f9d3ba2e69805cfff23ab";
-    sha256 = "16lb28m4k7n796cc1kifyc1ixry4bg69q9wqivjzygdsb77awgln";
+    rev = "eadb8df6aa71a76e5be36492edcadb118bd862ac";
+    sha256 = "1wfzp8167lcq6akdpbi8fikjv0z3h1i5minh3423dljc04q0klm1";
   };
 
-  patches =
-    [
-      (fetchpatch {
-        url = "https://patch-diff.githubusercontent.com/raw/RichiH/vcsh/pull/222.patch";
-        sha256 = "0grdbiwq04x5qj0a1yd9a78g5v28dxhwl6mwxvgvvmzs6k5wnl3k";
-      })
-      (fetchpatch {
-        url = "https://patch-diff.githubusercontent.com/raw/RichiH/vcsh/pull/228.patch";
-        sha256 = "0sdn4mzrhaynw85knia2iw5b6rgy0l1rd6dwh0lwspnh668wqgam";
-      })
-    ];
-
-  buildInputs = [ which git ronn perl ShellCommand TestMost ];
+  buildInputs = [
+    which git ronn perl ShellCommand TestMost TestDifferences TestDeep
+    TestException TestWarn
+  ];
 
   installPhase = "make install PREFIX=$out";
 
diff --git a/pkgs/applications/video/avidemux/default.nix b/pkgs/applications/video/avidemux/default.nix
index 99ed7378745..991842ba0dc 100644
--- a/pkgs/applications/video/avidemux/default.nix
+++ b/pkgs/applications/video/avidemux/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, cmake, pkgconfig, lndir
+{ stdenv, lib, fetchurl, fetchpatch, cmake, pkgconfig, lndir
 , zlib, gettext, libvdpau, libva, libXv, sqlite
 , yasm, freetype, fontconfig, fribidi
 , makeWrapper, libXext, libGLU, qttools, qtbase
@@ -32,7 +32,15 @@ stdenv.mkDerivation rec {
     sha256 = "1bf4l9qwxq3smc1mx5pybydc742a4qqsk17z50j9550d9iwnn7gy";
   };
 
-  patches = [ ./dynamic_install_dir.patch ./bootstrap_logging.patch ];
+  patches = [
+    ./dynamic_install_dir.patch
+    ./bootstrap_logging.patch
+    # glibc 2.27 compat
+    (fetchpatch {
+      url = https://github.com/mean00/avidemux2/commit/afdd9c4b876d77a4974d3fa7d9f25caeffbdf13d.patch;
+      sha256 = "0mf8vpfdqybziqsfyvxwcdm3zsmnp64293icinhvfpq9xp5b6vn6";
+    })
+  ];
 
   nativeBuildInputs = [ yasm cmake pkgconfig ];
   buildInputs = [
diff --git a/pkgs/applications/video/handbrake/default.nix b/pkgs/applications/video/handbrake/default.nix
index 3e796275907..1c97f9531f7 100644
--- a/pkgs/applications/video/handbrake/default.nix
+++ b/pkgs/applications/video/handbrake/default.nix
@@ -13,13 +13,13 @@
   python2, pkgconfig, yasm, harfbuzz, zlib,
   autoconf, automake, cmake, libtool, m4, jansson,
   libass, libiconv, libsamplerate, fribidi, libxml2, bzip2,
-  libogg, libopus, libtheora, libvorbis, libdvdcss, a52dec, fdk_aac,
+  libogg, libopus, libtheora, libvorbis, libdvdcss, a52dec,
   lame, ffmpeg, libdvdread, libdvdnav, libbluray,
   mp4v2, mpeg2dec, x264, x265, libmkv,
   fontconfig, freetype, hicolor-icon-theme,
   glib, gtk3, intltool, libnotify,
   gst_all_1, dbus-glib, udev, libgudev, libvpx,
-  useGtk ? true, wrapGAppsHook ? null, libappindicator-gtk3 ? null
+  useGtk ? true, wrapGAppsHook ? null, libappindicator-gtk3 ? null, useFdk ? false, fdk_aac ? null
 }:
 
 stdenv.mkDerivation rec {
@@ -42,13 +42,13 @@ stdenv.mkDerivation rec {
   buildInputs = [
     fribidi fontconfig freetype jansson zlib
     libass libiconv libsamplerate libxml2 bzip2
-    libogg libopus libtheora libvorbis libdvdcss a52dec libmkv fdk_aac
+    libogg libopus libtheora libvorbis libdvdcss a52dec libmkv
     lame ffmpeg libdvdread libdvdnav libbluray mp4v2 mpeg2dec x264 x265 libvpx
   ] ++ (lib.optionals useGtk [
     glib gtk3 libappindicator-gtk3 libnotify
     gst_all_1.gstreamer gst_all_1.gst-plugins-base dbus-glib udev
     libgudev
-  ]);
+  ]) ++ (lib.optionals useFdk [fdk_aac]);
 
   dontUseCmakeConfigure = true;
 
@@ -75,8 +75,8 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--disable-df-fetch"
     "--disable-df-verify"
-    "--enable-fdk-aac"
     (if useGtk then "--disable-gtk-update-checks" else "--disable-gtk")
+    (if useFdk then "--enable-fdk-aac"            else "")
   ];
 
   NIX_LDFLAGS = [
diff --git a/pkgs/applications/video/kazam/bug_1190693.patch b/pkgs/applications/video/kazam/bug_1190693.patch
deleted file mode 100644
index 9f00c6b6079..00000000000
--- a/pkgs/applications/video/kazam/bug_1190693.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-=== modified file 'kazam/frontend/indicator.py'
---- a/kazam/frontend/indicator.py	2013-01-26 01:53:53 +0000
-+++ b/kazam/frontend/indicator.py	2013-06-13 18:18:37 +0000
-@@ -291,3 +291,9 @@
-         def start_recording(self):
-             logger.debug("Recording started.")
-             self.indicator.set_from_icon_name("kazam-recording")
-+
-+        def hide_it(self):
-+            self.indicator.set_visible(False)
-+
-+        def show_it(self):
-+            self.indicator.set_visible(True)
-
diff --git a/pkgs/applications/video/kazam/datadir.patch b/pkgs/applications/video/kazam/datadir.patch
deleted file mode 100644
index 114d4228be2..00000000000
--- a/pkgs/applications/video/kazam/datadir.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/bin/kazam       2014-02-03 23:11:38.465614061 +0100
-+++ b/bin/kazam-1     2014-02-03 23:12:28.447058700 +0100
-@@ -68,7 +68,7 @@
-         # when base install path is not /usr
-         curpath = os.path.abspath(__file__)
-         curpath = os.path.realpath(curpath)
--        datadir = curpath.split('bin/')[0] + "share/kazam/"
-+        datadir = os.path.realpath(os.path.join(curpath, "./../../", "share/kazam/"))
- 
-     try:
-         import platform
diff --git a/pkgs/applications/video/kazam/default.nix b/pkgs/applications/video/kazam/default.nix
index b67c4a43cf5..9ffd62d068a 100644
--- a/pkgs/applications/video/kazam/default.nix
+++ b/pkgs/applications/video/kazam/default.nix
@@ -1,46 +1,41 @@
-{ stdenv, fetchurl, python3Packages, gst_all_1, makeWrapper, gobjectIntrospection
-, gtk3, libwnck3, keybinder, intltool, libcanberra-gtk2 }:
+{ stdenv, fetchurl, substituteAll, python3, gst_all_1, wrapGAppsHook, gobjectIntrospection
+, gtk3, libwnck3, keybinder3, intltool, libcanberra-gtk3, libappindicator-gtk3, libpulseaudio }:
 
-
-python3Packages.buildPythonApplication rec {
+python3.pkgs.buildPythonApplication rec {
   name = "kazam-${version}";
-  version = "1.4.3";
+  version = "1.4.5";
   namePrefix = "";
 
   src = fetchurl {
     url = "https://launchpad.net/kazam/stable/${version}/+download/kazam-${version}.tar.gz";
-    sha256 = "00bcn0yj9xrv87sf6xd3wpilsjgjpsj15zzpjh351ffpjnr0ica8";
+    sha256 = "1qygnrvm6aqixbyivhssp70hs0llxwk7lh3j7idxa2jbkk06hj4f";
   };
 
-  # TODO: keybinder, appindicator3
-  buildInputs = with python3Packages;
-    [ pygobject3 pyxdg pycairo gst_all_1.gstreamer gst_all_1.gst-plugins-base
-      gst_all_1.gst-plugins-good gobjectIntrospection gtk3 libwnck3 distutils_extra
-      intltool dbus-python ];
-
-  # TODO: figure out why PYTHONPATH is not passed automatically for those programs
-  pythonPath = with python3Packages;
-    [ pygobject3 pyxdg pycairo dbus-python ];
-
-  patches = [ ./datadir.patch ./bug_1190693.patch ];
-  prePatch = ''
-    rm setup.cfg
-    substituteInPlace kazam/backend/grabber.py --replace "/usr/bin/canberra-gtk-play" "${libcanberra-gtk2}/bin/canberra-gtk-play"
-  '';
+  nativeBuildInputs = [ gobjectIntrospection python3.pkgs.distutils_extra intltool wrapGAppsHook ];
+  buildInputs = [
+    gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good gtk3 libwnck3
+    keybinder3 libappindicator-gtk3
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [ pygobject3 pyxdg pycairo dbus-python ];
+
+  patches = [
+    # Fix paths
+    (substituteAll {
+      src = ./fix-paths.patch;
+      libcanberra = libcanberra-gtk3;
+      inherit libpulseaudio;
+    })
+    # Fix compability with Python 3.4
+    (fetchurl {
+      url = https://sources.debian.org/data/main/k/kazam/1.4.5-2/debian/patches/configparser_api_changes.patch;
+      sha256 = "0yvmipnh98s7y07cp1f113l0qqfw65k13an96byq707z3ymv1c2h";
+    })
+  ];
 
   # no tests
   doCheck = false;
 
-  preFixup = ''
-    wrapProgram $out/bin/kazam \
-      --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
-      --prefix LD_LIBRARY_PATH ":" "${stdenv.lib.makeLibraryPath [ gtk3 gst_all_1.gstreamer keybinder ]}" \
-      --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH" \
-      --prefix XDG_DATA_DIRS : "${gtk3.out}/share" \
-      --set GST_REGISTRY "/tmp/kazam.gstreamer.registry";
-  '';
-
-
   meta = with stdenv.lib; {
     description = "A screencasting program created with design in mind";
     homepage = https://code.launchpad.net/kazam;
diff --git a/pkgs/applications/video/kazam/fix-paths.patch b/pkgs/applications/video/kazam/fix-paths.patch
new file mode 100644
index 00000000000..43e360830ab
--- /dev/null
+++ b/pkgs/applications/video/kazam/fix-paths.patch
@@ -0,0 +1,22 @@
+--- a/kazam/backend/grabber.py
++++ b/kazam/backend/grabber.py
+@@ -72,7 +72,7 @@
+         #
+         if prefs.shutter_sound and (not self.god):
+             soundfile = os.path.join(prefs.datadir, 'sounds', prefs.sound_files[prefs.shutter_type])
+-            subprocess.call(['/usr/bin/canberra-gtk-play', '-f', soundfile])
++            subprocess.call(['@libcanberra@/bin/canberra-gtk-play', '-f', soundfile])
+ 
+         if self.xid:
+             if prefs.capture_borders_pic:
+--- a/kazam/pulseaudio/ctypes_pulseaudio.py
++++ b/kazam/pulseaudio/ctypes_pulseaudio.py
+@@ -20,7 +20,7 @@
+ #       MA 02110-1301, USA.
+ 
+ from ctypes import *
+-PA = CDLL('libpulse.so.0')
++PA = CDLL('@libpulseaudio@/lib/libpulse.so.0')
+ 
+ #
+ # Pulse Audio constants and defines
diff --git a/pkgs/applications/virtualization/xen/4.8.nix b/pkgs/applications/virtualization/xen/4.8.nix
index cce91dcd5de..79be1be1190 100644
--- a/pkgs/applications/virtualization/xen/4.8.nix
+++ b/pkgs/applications/virtualization/xen/4.8.nix
@@ -41,6 +41,12 @@ let
     sha256 = "1ki295pymbcfc64sjb9wqfwpv19p8vwgmnxankada3vm4fxg2rhq";
   });
 
+  qemuMemfdBuildFix = fetchpatch {
+    name = "xen-4.8-memfd-build-fix.patch";
+    url = https://github.com/qemu/qemu/commit/75e5b70e6b5dcc4f2219992d7cffa462aa406af0.patch;
+    sha256 = "0gaz93kb33qc0jx6iphvny0yrd17i8zhcl3a9ky5ylc2idz0wiwa";
+  };
+
   qemuDeps = [
     udev pciutils xorg.libX11 SDL pixman acl glusterfs spice-protocol usbredir
     alsaLib
@@ -63,6 +69,9 @@ callPackage (import ./generic.nix (rec {
         rev = "refs/tags/qemu-xen-${version}";
         sha256 = "0lb7zd5nvr6znx47z93nbq4gj8xfb3622s8r2cvmpqmwnmlc3nd4";
       };
+      patches = [
+        qemuMemfdBuildFix
+      ];
       buildInputs = qemuDeps;
       meta.description = "Xen's fork of upstream Qemu";
     };
diff --git a/pkgs/applications/window-managers/sway/default.nix b/pkgs/applications/window-managers/sway/default.nix
index d643e2dd218..89e7b9dd088 100644
--- a/pkgs/applications/window-managers/sway/default.nix
+++ b/pkgs/applications/window-managers/sway/default.nix
@@ -8,13 +8,13 @@
 
 stdenv.mkDerivation rec {
   name = "sway-${version}";
-  version = "0.15.1";
+  version = "0.15.2";
 
   src = fetchFromGitHub {
     owner = "swaywm";
     repo = "sway";
     rev = version;
-    sha256 = "00prns3dnafd19ap774p8v994i3p185ji0dnp2xxbkgh2z7sbwpi";
+    sha256 = "1p9j5gv85lsgj4z28qja07dqyvqk41w6mlaflvvm9yxafx477g5n";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/build-support/bintools-wrapper/macos-sierra-reexport-hack.bash b/pkgs/build-support/bintools-wrapper/macos-sierra-reexport-hack.bash
index a0c4e9edfcd..71b9471cbc8 100644
--- a/pkgs/build-support/bintools-wrapper/macos-sierra-reexport-hack.bash
+++ b/pkgs/build-support/bintools-wrapper/macos-sierra-reexport-hack.bash
@@ -2,107 +2,245 @@
 
 set -eu -o pipefail
 
+# For cmd | while read; do ...; done
+shopt -s lastpipe
+
 path_backup="$PATH"
 if [ -n "@coreutils_bin@" ]; then
   PATH="@coreutils_bin@/bin"
 fi
 
-declare -r recurThreshold=300
-
-declare overflowCount=0
-for ((n=0; n < $#; ++n)); do
-    case "${!n}" in
-        -l*) let overflowCount+=1 ;;
-        -reexport-l*) let overflowCount+=1 ;;
-        *) ;;
+declare -ri recurThreshold=200
+declare -i overflowCount=0
+
+declare -ar origArgs=("$@")
+
+# Throw away what we won't need
+declare -a parentArgs=()
+
+while (( $# )); do
+    case "$1" in
+        -l)
+            echo "cctools LD does not support '-l foo'" >&2
+            exit 1
+            ;;
+        -lazy_library | -reexport_library | -upward_library | -weak_library)
+            overflowCount+=1
+            shift 2
+            ;;
+        -l* | *.so.* | *.dylib | -lazy-l* | -reexport-l* | -upward-l* | -weak-l*)
+            overflowCount+=1
+            shift 1
+            ;;
+        *.a | *.o)
+            shift 1
+            ;;
+        -L | -F)
+            # Evidentally ld doesn't like using the child's RPATH, so it still
+            # needs these.
+            parentArgs+=("$1" "$2")
+            shift 2
+            ;;
+        -L?* | -F?*)
+            parentArgs+=("$1")
+            shift 1
+            ;;
+        -o)
+            outputName="$2"
+            parentArgs+=("$1" "$2")
+            shift 2
+            ;;
+        -install_name | -dylib_install_name | -dynamic-linker | -plugin)
+            parentArgs+=("$1" "$2")
+            shift 2
+            ;;
+        -rpath)
+            # Only an rpath to the child is needed, which we will add
+            shift 2
+            ;;
+        *)
+            if [[ -f "$1" ]]; then
+                # Propabably a non-standard object file like Haskell's
+                # `.dyn_o`. Skip it like other inputs
+                :
+            else
+                parentArgs+=("$1")
+            fi
+            shift 1
+            ;;
     esac
 done
 
-declare -a allArgs=()
+
 
 if (( "$overflowCount" <= "$recurThreshold" )); then
-    allArgs=("$@")
-else
-    declare -a childrenLookup=() childrenLink=()
-
-    while (( $# )); do
-        case "$1" in
-            -L/*)
-                childrenLookup+=("$1")
-                allArgs+=("$1")
-                ;;
-            -L)
-                echo "cctools LD does not support '-L foo' or '-l foo'" >&2
-                exit 1
-                ;;
-            -l)
-                echo "cctools LD does not support '-L foo' or '-l foo'" >&2
-                exit 1
-                ;;
-            -lazy_library | -lazy_framework | -lto_library)
-                # We aren't linking any "azy_library", "to_library", etc.
-                allArgs+=("$1")
-                ;;
-            -lazy-l | -weak-l)    allArgs+=("$1") ;;
-                # We can't so easily prevent header issues from these.
-            -lSystem)             allArgs+=("$1") ;;
-                # Special case as indirection seems like a bad idea for something
-                # so fundamental. Can be removed for simplicity.
-            -l?* | -reexport-l?*) childrenLink+=("$1") ;;
-            *)                    allArgs+=("$1") ;;
-        esac
-
-        shift
-    done
+    if [ -n "${NIX_DEBUG:-}" ]; then
+        echo "ld-wrapper: Only ${overflowCount} inputs counted while ${recurThreshold} is the ceiling, linking normally. " >&2
+    fi
+    PATH="$path_backup"
+    exec @prog@ "${origArgs[@]}"
+fi
+
+
+
+if [ -n "${NIX_DEBUG:-}" ]; then
+    echo "ld-wrapper: ${overflowCount} inputs counted when ${recurThreshold} is the ceiling, inspecting further. " >&2
+fi
+
+# Collect the normalized linker input
+declare -a norm=()
 
-    declare n=0
-    while (( $n < "${#childrenLink[@]}" )); do
-        if [[ "${childrenLink[n]}" = -l* ]]; then
-            childrenLink[n]="-reexport${childrenLink[n]}"
-        fi
-        let ++n
+# Arguments are null-separated
+@prog@ --dump-normalized-lib-args "${origArgs[@]}" |
+    while IFS= read -r -d '' input; do
+        norm+=("$input")
     done
-    unset n
-
-    declare -r outputNameLibless=$(basename $( \
-        if [[ -z "${outputName:+isUndefined}" ]]; then
-            echo unnamed
-        elif [[ "${outputName:0:3}" = lib ]]; then
-            echo "${outputName:3}"
-        else
-            echo "${outputName}"
-        fi))
-    declare -ra children=("$outputNameLibless-reexport-delegate-0" \
-                          "$outputNameLibless-reexport-delegate-1")
-
-    mkdir -p "$out/lib"
-
-    PATH="$PATH:@out@/bin"
-
-    symbolBloatObject=$outputNameLibless-symbol-hack.o
-    if [[ ! -e $symbolBloatObject ]]; then
-        # `-Q` means use GNU Assembler rather than Clang, avoiding an awkward
-        # dependency cycle.
-        printf '.private_extern _______child_hack_foo\nchild_hack_foo:\n' \
-            | @targetPrefix@as -Q -- -o $symbolBloatObject
+
+declare -i leafCount=0
+declare lastLeaf=''
+declare -a childrenInputs=() trailingInputs=()
+while (( "${#norm[@]}" )); do
+    case "${norm[0]}" in
+        -lazy_library | -upward_library)
+            # TODO(@Ericson2314): Don't do that, but intersperse children
+            # between such args.
+            echo "ld-wrapper: Warning: Potentially changing link order" >&2
+            trailingInputs+=("${norm[0]}" "${norm[1]}")
+            norm=("${norm[@]:2}")
+            ;;
+        -reexport_library | -weak_library)
+            childrenInputs+=("${norm[0]}" "${norm[1]}")
+            if [[ "${norm[1]}" != "$lastLeaf" ]]; then
+                leafCount+=1
+                lastLeaf="${norm[1]}"
+            fi
+            norm=("${norm[@]:2}")
+            ;;
+        *.so | *.dylib)
+            childrenInputs+=(-reexport_library "${norm[0]}")
+            if [[ "${norm[0]}" != "$lastLeaf" ]]; then
+                leafCount+=1
+                lastLeaf="${norm[0]}"
+            fi
+            norm=("${norm[@]:1}")
+            ;;
+        *.o | *.a)
+            # Don't delegate object files or static libs
+            parentArgs+=("${norm[0]}")
+            norm=("${norm[@]:1}")
+            ;;
+        *)
+            if [[ -f "${norm[0]}" ]]; then
+                # Propabably a non-standard object file. We'll let it by.
+                parentArgs+=("${norm[0]}")
+                norm=("${norm[@]:1}")
+            else
+                echo "ld-wrapper: Internal Error: Invalid normalized argument" >&2
+                exit -1
+            fi
+            ;;
+    esac
+done
+
+
+
+if (( "$leafCount" <= "$recurThreshold" )); then
+    if [ -n "${NIX_DEBUG:-}" ]; then
+        echo "ld-wrapper: Only ${leafCount} *dynamic* inputs counted while ${recurThreshold} is the ceiling, linking normally. " >&2
+    fi
+    PATH="$path_backup"
+    exec @prog@ "${origArgs[@]}"
+fi
+
+
+
+if [ -n "${NIX_DEBUG:-}" ]; then
+    echo "ld-wrapper: ${leafCount} *dynamic* inputs counted when ${recurThreshold} is the ceiling, delegating to children. " >&2
+fi
+
+declare -r outputNameLibless=$( \
+    if [[ -z "${outputName:+isUndefined}" ]]; then
+        echo unnamed
+        return 0;
     fi
+    baseName=$(basename ${outputName})
+    if [[ "$baseName" = lib* ]]; then
+        baseName="${baseName:3}"
+    fi
+    echo "$baseName")
+
+declare -ra children=(
+    "$outputNameLibless-reexport-delegate-0"
+    "$outputNameLibless-reexport-delegate-1"
+)
+
+mkdir -p "$out/lib"
+
+symbolBloatObject=$outputNameLibless-symbol-hack.o
+if [[ ! -f $symbolBloatObject ]]; then
+    # `-Q` means use GNU Assembler rather than Clang, avoiding an awkward
+    # dependency cycle.
+    printf '.private_extern _______child_hack_foo\nchild_hack_foo:\n' |
+        PATH="$PATH:@out@/bin" @targetPrefix@as -Q -- -o $symbolBloatObject
+fi
+
+# Split inputs between children
+declare -a child0Inputs=() child1Inputs=("${childrenInputs[@]}")
+let "countFirstChild = $leafCount / 2" || true
+lastLeaf=''
+while (( "$countFirstChild" )); do
+    case "${child1Inputs[0]}" in
+        -reexport_library | -weak_library)
+            child0Inputs+=("${child1Inputs[0]}" "${child1Inputs[1]}")
+            if [[ "${child1Inputs[1]}" != "$lastLeaf" ]]; then
+                let countFirstChild-=1 || true
+                lastLeaf="${child1Inputs[1]}"
+            fi
+            child1Inputs=("${child1Inputs[@]:2}")
+            ;;
+        *.so | *.dylib)
+            child0Inputs+=(-reexport_library "${child1Inputs[0]}")
+            if [[ "${child1Inputs[0]}" != "$lastLeaf" ]]; then
+                let countFirstChild-=1 || true
+                lastLeaf="${child1Inputs[1]}"
+            fi
+            child1Inputs=("${child1Inputs[@]:2}")
+            ;;
+        *)
+            echo "ld-wrapper: Internal Error: Invalid delegated input" >&2
+            exit -1
+            ;;
+    esac
+done
+
+
+# First half of libs
+@out@/bin/@targetPrefix@ld \
+  -macosx_version_min $MACOSX_DEPLOYMENT_TARGET -arch x86_64 -dylib \
+  -o "$out/lib/lib${children[0]}.dylib" \
+  -install_name "$out/lib/lib${children[0]}.dylib" \
+  "$symbolBloatObject" "${child0Inputs[@]}" "${trailingInputs[@]}"
+
+# Second half of libs
+@out@/bin/@targetPrefix@ld \
+  -macosx_version_min $MACOSX_DEPLOYMENT_TARGET -arch x86_64 -dylib \
+  -o "$out/lib/lib${children[1]}.dylib" \
+  -install_name "$out/lib/lib${children[1]}.dylib" \
+  "$symbolBloatObject" "${child1Inputs[@]}" "${trailingInputs[@]}"
+
+parentArgs+=("-L$out/lib" -rpath "$out/lib")
+if [[ $outputName != *reexport-delegate* ]]; then
+	parentArgs+=("-l${children[0]}" "-l${children[1]}")
+else
+    parentArgs+=("-reexport-l${children[0]}" "-reexport-l${children[1]}")
+fi
+
+parentArgs+=("${trailingInputs[@]}")
 
-    # first half of libs
-    @targetPrefix@ld -macosx_version_min $MACOSX_DEPLOYMENT_TARGET -arch x86_64 -dylib \
-      -o "$out/lib/lib${children[0]}.dylib" \
-      -install_name "$out/lib/lib${children[0]}.dylib" \
-      "${childrenLookup[@]}" "$symbolBloatObject" \
-      "${childrenLink[@]:0:$((${#childrenLink[@]} / 2 ))}"
-
-    # second half of libs
-    @targetPrefix@ld -macosx_version_min $MACOSX_DEPLOYMENT_TARGET -arch x86_64 -dylib \
-      -o "$out/lib/lib${children[1]}.dylib" \
-      -install_name "$out/lib/lib${children[1]}.dylib" \
-      "${childrenLookup[@]}" "$symbolBloatObject" \
-      "${childrenLink[@]:$((${#childrenLink[@]} / 2 ))}"
-
-    allArgs+=("-L$out/lib" "-l${children[0]}" "-l${children[1]}")
+if [ -n "${NIX_DEBUG:-}" ]; then
+    echo "flags using delegated children to @prog@:" >&2
+    printf "  %q\n" "${parentArgs[@]}" >&2
 fi
 
 PATH="$path_backup"
-exec @prog@ "${allArgs[@]}"
+exec @prog@ "${parentArgs[@]}"
diff --git a/pkgs/build-support/build-setupcfg/default.nix b/pkgs/build-support/build-setupcfg/default.nix
index 62dda59f1d5..bc6482f0a88 100644
--- a/pkgs/build-support/build-setupcfg/default.nix
+++ b/pkgs/build-support/build-setupcfg/default.nix
@@ -5,18 +5,20 @@
 # * meta: Standard nixpkgs metadata.
 # * application: Whether this package is a python library or an
 #   application which happens to be written in python.
-pythonPackages: { src, info, meta ? {}, application ? false }: let
+# * doCheck: Whether to run the test suites.
+pythonPackages:
+{ src, info, meta ? {}, application ? false, doCheck ? true }: let
   build = if application
     then pythonPackages.buildPythonApplication
   else pythonPackages.buildPythonPackage;
 in build {
   inherit (info) pname version;
 
-  inherit src meta;
+  inherit src meta doCheck;
 
   nativeBuildInputs = map (p: pythonPackages.${p}) (
     (info.setup_requires or []) ++
-    (info.tests_require or []));
+    (if doCheck then (info.tests_require or []) else []));
 
   propagatedBuildInputs = map (p: pythonPackages.${p})
     (info.install_requires or []);
diff --git a/pkgs/build-support/kernel/modules-closure.sh b/pkgs/build-support/kernel/modules-closure.sh
index 8287c1672d0..5658094872c 100644
--- a/pkgs/build-support/kernel/modules-closure.sh
+++ b/pkgs/build-support/kernel/modules-closure.sh
@@ -1,5 +1,19 @@
 source $stdenv/setup
 
+# When no modules are built, the $out/lib/modules directory will not
+# exist. Because the rest of the script assumes it does exist, we
+# handle this special case first.
+if ! test -d "$kernel/lib/modules"; then
+    if test -z "$rootModules" || test -n "$allowMissing"; then
+        mkdir -p "$out"
+        exit 0
+    else
+        echo "Required modules: $rootModules"
+        echo "Can not derive a closure of kernel modules because no modules were provided."
+        exit 1
+    fi
+fi
+
 version=$(cd $kernel/lib/modules && ls -d *)
 
 echo "kernel version is $version"
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index 9664abeb465..d092efb556e 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -170,6 +170,7 @@ rec {
         ***
 
         _EOF_
+        exit 1
       '';
     };
 
diff --git a/pkgs/data/icons/papirus-icon-theme/default.nix b/pkgs/data/icons/papirus-icon-theme/default.nix
index df974d8a035..c0f4727f48f 100644
--- a/pkgs/data/icons/papirus-icon-theme/default.nix
+++ b/pkgs/data/icons/papirus-icon-theme/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "papirus-icon-theme-${version}";
-  version = "20180214";
+  version = "20180401";
 
   src = fetchFromGitHub {
     owner = "PapirusDevelopmentTeam";
     repo = "papirus-icon-theme";
     rev = version;
-    sha256 = "0lsp5cmq5wdqw6vyh6hqqrshgpzxfj8dx87l7qdlgrk73dajjmki";
+    sha256 = "1cbzv3igc6j05h0mq2850fwfd8sxxwixzgmhh85mc1k326rvncil";
   };
 
   nativeBuildInputs = [ gtk3 ];
diff --git a/pkgs/desktops/gnome-2/platform/gtkglext/default.nix b/pkgs/desktops/gnome-2/platform/gtkglext/default.nix
index 3a316f71f08..834ec220158 100644
--- a/pkgs/desktops/gnome-2/platform/gtkglext/default.nix
+++ b/pkgs/desktops/gnome-2/platform/gtkglext/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, gtk, libGLU_combined, pango, pangox_compat, xorg }:
+{ stdenv, fetchurl, fetchpatch, pkgconfig, glib, gtk, libGLU_combined, pango, pangox_compat, xorg }:
 
 stdenv.mkDerivation rec {
   name = "gtkglext-1.2.0";
@@ -12,9 +12,20 @@ stdenv.mkDerivation rec {
     [ pkgconfig glib gtk libGLU_combined pango libX11 libXmu ];
   propagatedBuildInputs = [ pangox_compat ];
 
-  # The library uses `GTK_WIDGET_REALIZED', `GTK_WIDGET_TOPLEVEL', and
-  # `GTK_WIDGET_NO_WINDOW', all of which appear to be deprecated nowadays.
-  CPPFLAGS = "-UGTK_DISABLE_DEPRECATED";
+  patches = [
+    # The library uses `GTK_WIDGET_REALIZED', `GTK_WIDGET_TOPLEVEL', and
+    # `GTK_WIDGET_NO_WINDOW', all of which appear to be deprecated nowadays.
+    (fetchpatch {
+      name = "02_fix_gtk-2.20_deprecated_symbols.diff";
+      url = https://git.gnome.org/browse/gtkglext/patch/?id=d8f285d1397f6c41099c67e668288eecc1cdae67;
+      sha256 = "1zxak73plhy3m6psil1q9ssvjh9aqrif7kcbcz69y480qfb4ja08";
+    })
+    # Fix build with glibc ≥ 2.27
+    (fetchurl {
+      url = https://salsa.debian.org/gewo/gtkglext/raw/3b002677c907890c7de002c9f5b4b3ec71d11b31/debian/patches/04_glibc2.27-ftbfs.diff;
+      sha256 = "1l1swkjkai6pnah23xfsfpbq2fgbhp5pzj3l0ybsx6b858cxqzj5";
+    })
+  ];
 
   meta = with stdenv.lib; {
     homepage = https://projects.gnome.org/gtkglext/;
diff --git a/pkgs/desktops/gnome-3/apps/bijiben/default.nix b/pkgs/desktops/gnome-3/apps/bijiben/default.nix
index 91b16bbba96..93a2c41caf3 100644
--- a/pkgs/desktops/gnome-3/apps/bijiben/default.nix
+++ b/pkgs/desktops/gnome-3/apps/bijiben/default.nix
@@ -5,13 +5,13 @@
 , gnome3, libxml2 }:
 
 let
-  version = "3.28.0";
+  version = "3.28.1";
 in stdenv.mkDerivation rec {
   name = "bijiben-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/bijiben/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "047w8kigrdmphd17dma2lldf6r60sgx3zybai9bz9yr0hm601kr6";
+    sha256 = "0ivx3hbpg7qaqzpbbn06lz9w3q285vhwgfr353b14bg0nsidwy17";
   };
 
   doCheck = true;
diff --git a/pkgs/desktops/gnome-3/apps/evolution/default.nix b/pkgs/desktops/gnome-3/apps/evolution/default.nix
index f41262d85b4..d7def6e2709 100644
--- a/pkgs/desktops/gnome-3/apps/evolution/default.nix
+++ b/pkgs/desktops/gnome-3/apps/evolution/default.nix
@@ -5,13 +5,13 @@
 , libcanberra-gtk3, bogofilter, gst_all_1, procps, p11-kit, openldap }:
 
 let
-  version = "3.28.0";
+  version = "3.28.1";
 in stdenv.mkDerivation rec {
   name = "evolution-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/evolution/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0b6yw664jdfc8ppd78akmrl36iximh7ipknf5mlzgga6lr6pl2nf";
+    sha256 = "0sdv5lg2vlz5f4raymz9d8a5jq4j18vbqyigaip6508p3bjnfj8l";
   };
 
   propagatedUserEnvPkgs = [ gnome3.evolution-data-server ];
diff --git a/pkgs/desktops/gnome-3/apps/gedit/default.nix b/pkgs/desktops/gnome-3/apps/gedit/default.nix
index 7c90b16d86a..919ebdd77d1 100644
--- a/pkgs/desktops/gnome-3/apps/gedit/default.nix
+++ b/pkgs/desktops/gnome-3/apps/gedit/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "gedit-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gedit/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0pyam0zi44xq776x20ycqnvmf86l98jns8ldv4m81gnp9wnhmycv";
+    sha256 = "0791r07d3ixmmfk68lvhp3d5i4vnlrnx10csxwgpfqyfb04vwx7i";
   };
 
   nativeBuildInputs = [ pkgconfig wrapGAppsHook intltool itstool libxml2 ];
diff --git a/pkgs/desktops/gnome-3/apps/glade/default.nix b/pkgs/desktops/gnome-3/apps/glade/default.nix
index 577382a4986..a1777137c01 100644
--- a/pkgs/desktops/gnome-3/apps/glade/default.nix
+++ b/pkgs/desktops/gnome-3/apps/glade/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "glade-${version}";
-  version = "3.22.0";
+  version = "3.22.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/glade/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1j7kpy4jisz4nkd3yb5af4vd4bapyqchvp2gvq6ypfw3b0x88rkc";
+    sha256 = "16p38xavpid51qfy0s26n0n21f9ws1w9k5s65bzh1w7ay8p9my6z";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/apps/gnome-boxes/default.nix b/pkgs/desktops/gnome-3/apps/gnome-boxes/default.nix
index 52fa45812fa..8921d70787c 100644
--- a/pkgs/desktops/gnome-3/apps/gnome-boxes/default.nix
+++ b/pkgs/desktops/gnome-3/apps/gnome-boxes/default.nix
@@ -9,13 +9,13 @@
 # TODO: ovirt (optional)
 
 let
-  version = "3.27.92";
+  version = "3.28.2";
 in stdenv.mkDerivation rec {
   name = "gnome-boxes-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-boxes/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1v1br4zh2w3w70np5imi31md6lnqamabiin521f806rdrxsnyggq";
+    sha256 = "0xss6wrs4hkmr0aa9qxr9b6wxbygrkjz4p0c4xnymicq97jnwra1";
   };
 
   doCheck = true;
diff --git a/pkgs/desktops/gnome-3/apps/gnome-calendar/default.nix b/pkgs/desktops/gnome-3/apps/gnome-calendar/default.nix
index 35888b21c2e..b88bad2f649 100644
--- a/pkgs/desktops/gnome-3/apps/gnome-calendar/default.nix
+++ b/pkgs/desktops/gnome-3/apps/gnome-calendar/default.nix
@@ -4,13 +4,13 @@
 
 let
   pname = "gnome-calendar";
-  version = "3.28.0";
+  version = "3.28.1";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1y5d6rgw7j5hy147i3ff73q9kkwj3nbyms7j705nfhri3s1ypqgs";
+    sha256 = "1jacznnjql5jgzvzcp5kh2k0cd0y41cri6qz2bsakpllf7adbrq6";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/apps/gnome-getting-started-docs/default.nix b/pkgs/desktops/gnome-3/apps/gnome-getting-started-docs/default.nix
index 3fc444dbdd4..b3ede702890 100644
--- a/pkgs/desktops/gnome-3/apps/gnome-getting-started-docs/default.nix
+++ b/pkgs/desktops/gnome-3/apps/gnome-getting-started-docs/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-getting-started-docs-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-getting-started-docs/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "09khgzrbvcqvgjkqh8rp609bx818v5c8gzq61nxy5582s8habg8g";
+    sha256 = "0x60aava6ba4xliy4p4i6jm5d2nq8hx9aqgnaw4d34fvmcpcy5w0";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/apps/gnome-maps/default.nix b/pkgs/desktops/gnome-3/apps/gnome-maps/default.nix
index 1c9d243c0c5..b5c8188bd06 100644
--- a/pkgs/desktops/gnome-3/apps/gnome-maps/default.nix
+++ b/pkgs/desktops/gnome-3/apps/gnome-maps/default.nix
@@ -5,13 +5,13 @@
 
 let
   pname = "gnome-maps";
-  version = "3.28.0";
+  version = "3.28.1";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1imcgw67cw1qkfz8m2my0f4qmss11fbqqqi4w7afcfq9p0rplgy0";
+    sha256 = "19xx1v25ycr8ih4jwb1vc662jcx6kynaf7baj4i569ccrcwaj2d5";
   };
 
   doCheck = true;
diff --git a/pkgs/desktops/gnome-3/apps/gnome-music/default.nix b/pkgs/desktops/gnome-3/apps/gnome-music/default.nix
index 982cd9283ff..c2d5045e79e 100644
--- a/pkgs/desktops/gnome-3/apps/gnome-music/default.nix
+++ b/pkgs/desktops/gnome-3/apps/gnome-music/default.nix
@@ -6,13 +6,13 @@
 
 python3.pkgs.buildPythonApplication rec {
   pname = "gnome-music";
-  version = "3.28.0.1";
+  version = "3.28.1";
 
   format = "other";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${pname}-${version}.tar.xz";
-    sha256 = "0yyysmxwmk167n8wghcbmxz73kgl1y1j9js3mgkjjqsmkd9brk65";
+    sha256 = "0xbwndfl72292dx4x99vm0iyrcy8xw2i5fhsch7b073rk4ydbyfx";
   };
 
   nativeBuildInputs = [ meson ninja gettext itstool pkgconfig libxml2 wrapGAppsHook desktop-file-utils appstream-glib gobjectIntrospection ];
diff --git a/pkgs/desktops/gnome-3/core/eog/default.nix b/pkgs/desktops/gnome-3/core/eog/default.nix
index 50248586261..85587d11178 100644
--- a/pkgs/desktops/gnome-3/core/eog/default.nix
+++ b/pkgs/desktops/gnome-3/core/eog/default.nix
@@ -4,13 +4,13 @@
 
 let
   pname = "eog";
-  version = "3.28.0";
+  version = "3.28.1";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0d8fi5ydsh8n7d85dps8svl1bhid1p8jbnlwiqywj2gd2wpxpyjv";
+    sha256 = "1v3s4x4xdmfa488drwvxfps33jiyh3qz9z8v8s3779n1jn92rmbq";
   };
 
   nativeBuildInputs = [ meson ninja pkgconfig gettext itstool wrapGAppsHook libxml2 gobjectIntrospection ];
diff --git a/pkgs/desktops/gnome-3/core/epiphany/default.nix b/pkgs/desktops/gnome-3/core/epiphany/default.nix
index 6877b20df44..3ece64dc163 100644
--- a/pkgs/desktops/gnome-3/core/epiphany/default.nix
+++ b/pkgs/desktops/gnome-3/core/epiphany/default.nix
@@ -6,11 +6,11 @@
 
 stdenv.mkDerivation rec {
   name = "epiphany-${version}";
-  version = "3.28.0.1";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/epiphany/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "023q6xnwsafac38lavxwgph5lcd2igxpiwqb4kr72mv56xlb0m3i";
+    sha256 = "0zvxrwlswxadq4zbr4f73ms141d08j0lhi6rzmj83j1s3gan88md";
   };
 
   # Tests need an X display
diff --git a/pkgs/desktops/gnome-3/core/evince/default.nix b/pkgs/desktops/gnome-3/core/evince/default.nix
index 59a7c6806ef..74f10cc384d 100644
--- a/pkgs/desktops/gnome-3/core/evince/default.nix
+++ b/pkgs/desktops/gnome-3/core/evince/default.nix
@@ -9,11 +9,11 @@
 
 stdenv.mkDerivation rec {
   name = "evince-${version}";
-  version = "3.28.0";
+  version = "3.28.2";
 
   src = fetchurl {
     url = "mirror://gnome/sources/evince/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1a3kcls18dcz1lj8hrx8skcli9xxfyi71c17xjwayh71cm5jc8zs";
+    sha256 = "1qbk1x2c7iacmmfwjzh136v2sdacrkqn9d6bnqid7xn9hlnx4m89";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/evolution-data-server/default.nix b/pkgs/desktops/gnome-3/core/evolution-data-server/default.nix
index 7a01d73ebf4..01891ad8247 100644
--- a/pkgs/desktops/gnome-3/core/evolution-data-server/default.nix
+++ b/pkgs/desktops/gnome-3/core/evolution-data-server/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   name = "evolution-data-server-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/evolution-data-server/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1ybyyy6nls11az8lbri1y9527snz5h7qbhyfqvk0vc6vzvald5gv";
+    sha256 = "12b9lfgwd57rzn9394xrbvl9ym5aqldpz9v7c9a421dsv8dgq13b";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/desktops/gnome-3/core/gdm/default.nix b/pkgs/desktops/gnome-3/core/gdm/default.nix
index 999c3f05748..6b6b23f21b5 100644
--- a/pkgs/desktops/gnome-3/core/gdm/default.nix
+++ b/pkgs/desktops/gnome-3/core/gdm/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "gdm-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gdm/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0i5rzr6fdvlm88gl85gvql1wf1yflkmg90x81dqjf39as3ixs81s";
+    sha256 = "1yxjjyrp0ywrc25cp81bsdhp79zn0c0jag48hlp00b5wfnkqy1kp";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/gjs/default.nix b/pkgs/desktops/gnome-3/core/gjs/default.nix
index 888eb073a46..68b85d9dfe0 100644
--- a/pkgs/desktops/gnome-3/core/gjs/default.nix
+++ b/pkgs/desktops/gnome-3/core/gjs/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "gjs-${version}";
-  version = "1.52.0";
+  version = "1.52.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gjs/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1jm40imin4sxzfcxcbmf4v71apk8y9icccq1a4m4mlz1wm2s092m";
+    sha256 = "1s1m8xv3ixgl0hah3r364ws249d6w8yn56q2ahfn3dg2j54rmz58";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/gnome-calculator/default.nix b/pkgs/desktops/gnome-3/core/gnome-calculator/default.nix
index f30243003cb..03fdf4b14fe 100644
--- a/pkgs/desktops/gnome-3/core/gnome-calculator/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-calculator/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-calculator-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-calculator/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1qnfvmf615v52c8h1f6zxbvpywi3512hnzyf9azvxb8a6q0rx1vn";
+    sha256 = "05zpdp9mkfjz22hs7hfjikkxhzmvy02mxrldrjxsv8ff17w9xvic";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/desktops/gnome-3/core/gnome-contacts/default.nix b/pkgs/desktops/gnome-3/core/gnome-contacts/default.nix
index 9c9b26360aa..c8636cb1dc1 100644
--- a/pkgs/desktops/gnome-3/core/gnome-contacts/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-contacts/default.nix
@@ -5,13 +5,13 @@
 , vala, meson, ninja }:
 
 let
-  version = "3.28.0";
+  version = "3.28.1";
 in stdenv.mkDerivation rec {
   name = "gnome-contacts-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-contacts/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1qqj6k5rvmvg6v6vg4cak98w6rqknpqfsm0vfrwva6l6wbql2v8i";
+    sha256 = "17iinxqf221kk9yppv3yhg0m7jxk5zvwxmdf3hjygf9xgfw7z3zi";
   };
 
   propagatedUserEnvPkgs = [ evolution-data-server ];
diff --git a/pkgs/desktops/gnome-3/core/gnome-control-center/default.nix b/pkgs/desktops/gnome-3/core/gnome-control-center/default.nix
index 5f6ed213e3e..55ac087cfa2 100644
--- a/pkgs/desktops/gnome-3/core/gnome-control-center/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-control-center/default.nix
@@ -9,13 +9,13 @@
 
 let
   pname = "gnome-control-center";
-  version = "3.28.0";
+  version = "3.28.1";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0nyx5nl2rky0249rdcy0hsccnxf3angpya0q859rrbrwaixqnxh3";
+    sha256 = "0f2p91bzbl39q3cb1qj5vi55km7wxb2fibx07vciz39g5va5cpn6";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/desktops/gnome-3/core/gnome-desktop/default.nix b/pkgs/desktops/gnome-3/core/gnome-desktop/default.nix
index dad8d8177de..ed1e59da62c 100644
--- a/pkgs/desktops/gnome-3/core/gnome-desktop/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-desktop/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-desktop-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-desktop/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "17fm5z3kfm1m3420kjpvk1y0pc34p42rqfpmb1npy51jkv1p3pzi";
+    sha256 = "16nbgrp0hihvrsa6kmqk0z8y7ajravyagmkmq1nnwn27psi9g8vq";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/gnome-disk-utility/default.nix b/pkgs/desktops/gnome-3/core/gnome-disk-utility/default.nix
index 0478877acb4..4f9e2dda540 100644
--- a/pkgs/desktops/gnome-3/core/gnome-disk-utility/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-disk-utility/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-disk-utility-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-disk-utility/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0ad98mxyygyzq0y280m6z73anyv3xxr6irpkp6vc803lhdr5b7fc";
+    sha256 = "09dmknfas8iifv6k5jb4a9ag57s8awrn0f26fd1qlg0mbfjlnfd6";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/gnome-session/default.nix b/pkgs/desktops/gnome-3/core/gnome-session/default.nix
index d36e7ce7432..7b407aad506 100644
--- a/pkgs/desktops/gnome-3/core/gnome-session/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-session/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-session-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-session/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1ldcalj9i7qharvw8k8gf7pkcvwb1qwiag2ckffx9x8ic2d3v00b";
+    sha256 = "14nmbirgrp2nm16khbz109saqdlinlbrlhjnbjydpnrlimfgg4xq";
   };
 
   mesonFlags = [ "-Dsystemd=true" ];
diff --git a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix
index 2a59d39e8cf..cfb41c01e6a 100644
--- a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-settings-daemon-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-settings-daemon/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1p3ccf4a4qbz73hqyx9i55hkp6l7c7la5kazqawcndl7bksywgny";
+    sha256 = "0z9dip9p0iav646cmxisii5sbkdr9hmaklc5fzvschpbjkhphksr";
   };
 
   patches = [
diff --git a/pkgs/desktops/gnome-3/core/gnome-software/default.nix b/pkgs/desktops/gnome-3/core/gnome-software/default.nix
index 2c4663b54ec..21a1e1a1c4c 100644
--- a/pkgs/desktops/gnome-3/core/gnome-software/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-software/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-software-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-software/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0zwbgxzl805c4l8kwy5bn3p91s2qxlcn4syzzg4vd4kilc6nnjwk";
+    sha256 = "0j27zygb3g08q9i8ygwpxqf6g0lrivq2vhj7p7g9x0zh9r0vzlbs";
   };
 
   patches = [
diff --git a/pkgs/desktops/gnome-3/core/gnome-system-monitor/default.nix b/pkgs/desktops/gnome-3/core/gnome-system-monitor/default.nix
index 5f707152aed..46a91dda70e 100644
--- a/pkgs/desktops/gnome-3/core/gnome-system-monitor/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-system-monitor/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-system-monitor-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-system-monitor/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1wvgx5p0a29d8yzp7rinpln90pg8vsjagqlvm4cxyhnl5hsdvrvn";
+    sha256 = "0wdpd5mfrm0gwmwjvcj556c3mpxf3pcfnvh7x698i8if53ci0gw7";
   };
 
   doCheck = true;
diff --git a/pkgs/desktops/gnome-3/core/gnome-terminal/default.nix b/pkgs/desktops/gnome-3/core/gnome-terminal/default.nix
index 9e99e84cfd5..6f80fe0c90b 100644
--- a/pkgs/desktops/gnome-3/core/gnome-terminal/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-terminal/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-terminal-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-terminal/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1i5wlcjb0aigm1lbmn16nmh9rkjqfdpzzgf6qw7mcrhgw7pdald5";
+    sha256 = "1hqwh12hiy73mazqgvyrq8jk4c669x2fb4nh8mwby3qbk8ca19pp";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/gnome-user-docs/default.nix b/pkgs/desktops/gnome-3/core/gnome-user-docs/default.nix
index d4ba838bef3..a8efa238447 100644
--- a/pkgs/desktops/gnome-3/core/gnome-user-docs/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-user-docs/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-user-docs-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-user-docs/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0sx46j61kjn8kaf75303vym5sigki239pqzf5q4n72k1hwp7albp";
+    sha256 = "189j78d23c6jr5x5j9nxkbdqxg31xvmwvyblz7f9xi9ncy0qdvfh";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/gnome-user-share/default.nix b/pkgs/desktops/gnome-3/core/gnome-user-share/default.nix
index 36748566880..509c10d7564 100644
--- a/pkgs/desktops/gnome-3/core/gnome-user-share/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-user-share/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-user-share-${version}";
-  version = "3.27.90";
+  version = "3.28.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-user-share/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1wd183cjr1gmzpsq7bqwkwhmcdng0m105f6ymc89r17fz85f4jhy";
+    sha256 = "04wjnrcdlmyszj582nsda32sgi44nwgrw2ksy11xp17nb09d7m09";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/nautilus/default.nix b/pkgs/desktops/gnome-3/core/nautilus/default.nix
index a52ec342675..2daaf2d4326 100644
--- a/pkgs/desktops/gnome-3/core/nautilus/default.nix
+++ b/pkgs/desktops/gnome-3/core/nautilus/default.nix
@@ -4,13 +4,13 @@
 
 let
   pname = "nautilus";
-  version = "3.28.0.1";
+  version = "3.28.1";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1i3li3nd434vncd6j6has73xihbzjx1ab0xyw8wif11mym15ixrh";
+    sha256 = "19dhpa2ylrg8d5274lahy7xqr2p9z3jnq1h4qmsh95czkpy7is4w";
   };
 
   nativeBuildInputs = [ meson ninja pkgconfig libxml2 gettext wrapGAppsHook desktop-file-utils ];
diff --git a/pkgs/desktops/gnome-3/core/simple-scan/default.nix b/pkgs/desktops/gnome-3/core/simple-scan/default.nix
index 3528a9a93d9..e4458b7d0a3 100644
--- a/pkgs/desktops/gnome-3/core/simple-scan/default.nix
+++ b/pkgs/desktops/gnome-3/core/simple-scan/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "simple-scan-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/simple-scan/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0ki95d0v9l0pb5jvk1v8k49vb7snp9j7bnxw3m8q63m00yl33qhz";
+    sha256 = "140vz94vml0vf6kiw3sg436qfvajk21x6q86smvycgf24qfyvk6a";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/vte/default.nix b/pkgs/desktops/gnome-3/core/vte/default.nix
index 73fd244c548..6577ba3ae58 100644
--- a/pkgs/desktops/gnome-3/core/vte/default.nix
+++ b/pkgs/desktops/gnome-3/core/vte/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "vte-${version}";
-  version = "0.52.0";
+  version = "0.52.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/vte/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0rq5gkg7bfrxlsm8mgdh4605hki81wljmjhhz8x4kbspvpfp5bnm";
+    sha256 = "1lva70inb5y8p42rg95fb88z2ybwcz0lybla3ixbgp2sj0s4rzdh";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/core/yelp/default.nix b/pkgs/desktops/gnome-3/core/yelp/default.nix
index 691ec2fdb94..9a47ecd2842 100644
--- a/pkgs/desktops/gnome-3/core/yelp/default.nix
+++ b/pkgs/desktops/gnome-3/core/yelp/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "yelp-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/yelp/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "05qzczxnxk374cp4an166gv60nkbd0jq3pp2fwy7s9rnkm55jz6v";
+    sha256 = "033w5qnhm495pnvscnb3k2dagzgq4fsnzcrh0k2rgr10mw2mv2p8";
   };
 
   nativeBuildInputs = [ pkgconfig intltool itstool wrapGAppsHook ];
diff --git a/pkgs/desktops/gnome-3/core/zenity/default.nix b/pkgs/desktops/gnome-3/core/zenity/default.nix
index 05637e200e3..b9788106342 100644
--- a/pkgs/desktops/gnome-3/core/zenity/default.nix
+++ b/pkgs/desktops/gnome-3/core/zenity/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   name = "zenity-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/zenity/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1y3dha9faqgy5l8wqh3qp354gzdh36fx70q2kc9k1nw7p498yn2y";
+    sha256 = "0swavrkc5ps3fwzy6h6l5mmim0wwy10xrq0qqkay5d0zf9a965yv";
   };
 
   passthru = {
diff --git a/pkgs/desktops/gnome-3/devtools/devhelp/default.nix b/pkgs/desktops/gnome-3/devtools/devhelp/default.nix
index 786eece7194..97a425bccb1 100644
--- a/pkgs/desktops/gnome-3/devtools/devhelp/default.nix
+++ b/pkgs/desktops/gnome-3/devtools/devhelp/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "devhelp-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/devhelp/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1b4l71775p3mps1jsv7pz26v0lhd0qczsp6qr1dwv7hyslmpb5qn";
+    sha256 = "08a8xizjqz68k30zd37r7g516azhan9bbrjsvv10hjd5dg3f476s";
   };
 
   nativeBuildInputs = [ pkgconfig gettext itstool wrapGAppsHook appstream-glib gobjectIntrospection ];
diff --git a/pkgs/desktops/gnome-3/games/gnome-chess/default.nix b/pkgs/desktops/gnome-3/games/gnome-chess/default.nix
index 063b97801b4..aebd72d65df 100644
--- a/pkgs/desktops/gnome-3/games/gnome-chess/default.nix
+++ b/pkgs/desktops/gnome-3/games/gnome-chess/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   name = "gnome-chess-${version}";
-  version = "3.28.0";
+  version = "3.28.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gnome-chess/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1vxgb36njv4v3bgdpwxd89rvr6s6pkbh9d3xislxqry2yp4f03w0";
+    sha256 = "1q8gc0mq8k2b7pjy363g0yjd80czqknw6ssqzbvgqx5b8nkfvmv1";
   };
 
   nativeBuildInputs = [ meson ninja vala pkgconfig gettext itstool libxml2 wrapGAppsHook gobjectIntrospection ];
diff --git a/pkgs/desktops/gnome-3/misc/gnome-tweaks/default.nix b/pkgs/desktops/gnome-3/misc/gnome-tweaks/default.nix
index a690524b45a..a7c69de44eb 100644
--- a/pkgs/desktops/gnome-3/misc/gnome-tweaks/default.nix
+++ b/pkgs/desktops/gnome-3/misc/gnome-tweaks/default.nix
@@ -5,13 +5,13 @@
 
 let
   pname = "gnome-tweaks";
-  version = "3.28.0";
+  version = "3.28.1";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "0d8zxfa8r4n4l6jzyzy6q58padxjlrad3c71mwqidm2ww8nm6i19";
+    sha256 = "1p5xydr0haz4389h6dvvbna6i1mipdzvmlfksnv0jqfvfs9sy6fp";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/compilers/arm-frc-linux-gnueabi-gcc/default.nix b/pkgs/development/compilers/arm-frc-linux-gnueabi-gcc/default.nix
deleted file mode 100755
index 6fa25df5e03..00000000000
--- a/pkgs/development/compilers/arm-frc-linux-gnueabi-gcc/default.nix
+++ /dev/null
@@ -1,98 +0,0 @@
-{stdenv, fetchurl
-, arm-frc-linux-gnueabi-binutils, arm-frc-linux-gnueabi-eglibc, arm-frc-linux-gnueabi-linux-api-headers
-, elfutils
-, libmpc, gmp, mpfr, zlib, isl_0_15, cloog}:
-
-stdenv.mkDerivation rec {
-  _target = "arm-frc-linux-gnueabi";
-
-  version = "4.9.4";
-  name = "${_target}-gcc-${version}";
-
-  src = fetchurl {
-    url = "ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/gcc-${version}.tar.bz2";
-    sha256 = "6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092";
-  };
-
-  patches = [
-    ./minorSOname.patch
-    ./no-nested-deprecated-warnings.patch
-  ];
-
-  hardeningDisable = [ "format" ];
-
-  buildInputs = [
-    arm-frc-linux-gnueabi-binutils
-    arm-frc-linux-gnueabi-eglibc
-    arm-frc-linux-gnueabi-linux-api-headers
-    elfutils
-    libmpc
-    gmp
-    mpfr
-    zlib
-    isl_0_15
-    cloog
-  ];
-
-
-  configurePhase = ''
-    mkdir gcc-build
-    cd gcc-build
-    ../configure \
-      --prefix=$out \
-      --host=$CHOST \
-      --build=$CHOST \
-      --program-prefix=${_target}- \
-      --target=${_target} \
-      --enable-shared \
-      --disable-nls \
-      --enable-threads=posix \
-      --enable-languages=c,c++ \
-      --disable-multilib \
-      --disable-multiarch \
-      --with-sysroot=${arm-frc-linux-gnueabi-eglibc}/${_target} \
-      --with-build-sysroot=${arm-frc-linux-gnueabi-eglibc}/${_target} \
-      --with-as=${arm-frc-linux-gnueabi-binutils}/${_target}/bin/as \
-      --with-ld=${arm-frc-linux-gnueabi-binutils}/${_target}/bin/ld \
-      --with-cpu=cortex-a9 \
-      --with-float=softfp \
-      --with-fpu=vfp \
-      --with-specs='%{save-temps:-fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables}' \
-      --enable-lto \
-      --with-pkgversion='GCC-for-FRC' \
-      --with-cloog \
-      --enable-poison-system-directories \
-      --enable-plugin \
-      --with-system-zlib \
-      --disable-libmudflap \
-      --disable-libsanitizer
-  '';
-
-  makeFlags = [
-    "all-gcc"
-    "all-target-libgcc"
-    "all-target-libstdc++-v3"
-  ];
-
-  installPhase = ''
-    make install-gcc install-target-libgcc install-target-libstdc++-v3
-  '';
-
-  postInstall = ''
-    rm -rf $out/share/{man/man7,info}/ "$out/share/gcc-${version}/python"
-  '';
-
-  meta = with stdenv.lib; {
-    description = "FRC cross compiler";
-    longDescription = ''
-      arm-frc-linux-gnueabi-gcc is a cross compiler for building
-      code for FIRST Robotics Competition. Used as a cross compiler
-      for the NI RoboRio.
-    '';
-    license = licenses.gpl2;
-    maintainers = [ maintainers.colescott ];
-    platforms = platforms.linux;
-
-    priority = 4;
-  };
-}
diff --git a/pkgs/development/compilers/arm-frc-linux-gnueabi-gcc/minorSOname.patch b/pkgs/development/compilers/arm-frc-linux-gnueabi-gcc/minorSOname.patch
deleted file mode 100755
index d97d12bc629..00000000000
--- a/pkgs/development/compilers/arm-frc-linux-gnueabi-gcc/minorSOname.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Description: Make the default SONAME include minor numbers (c++)

- This patch adds .0.20 to the end of the SONAME for libstdc++ to support

- independent side-by-side usage of .17 and .20.

- .

- gcc-armel (4.9.1-0frc2) trusty; urgency=low

- .

-   * Fixing dependency ambiguity yet again...

-Author: Patrick Plenefisch <phplenefisch@wpi.edu>

-

----

-

---- gcc-armel-4.9.1.orig/libstdc++-v3/configure

-+++ gcc-armel-4.9.1/libstdc++-v3/configure

-@@ -10698,7 +10698,7 @@ gnu*)

-   need_lib_prefix=no

-   need_version=no

-   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'

--  soname_spec='${libname}${release}${shared_ext}$major'

-+  soname_spec='${libname}${release}${shared_ext}$versuffix'

-   shlibpath_var=LD_LIBRARY_PATH

-   hardcode_into_libs=yes

-   ;;

-@@ -10824,7 +10824,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)

-   need_lib_prefix=no

-   need_version=no

-   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'

--  soname_spec='${libname}${release}${shared_ext}$major'

-+  soname_spec='${libname}${release}${shared_ext}$versuffix'

-   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'

-   shlibpath_var=LD_LIBRARY_PATH

-   shlibpath_overrides_runpath=no

-@@ -14382,7 +14382,7 @@ gnu*)

-   need_lib_prefix=no

-   need_version=no

-   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'

--  soname_spec='${libname}${release}${shared_ext}$major'

-+  soname_spec='${libname}${release}${shared_ext}$versuffix'

-   shlibpath_var=LD_LIBRARY_PATH

-   hardcode_into_libs=yes

-   ;;

-@@ -14508,7 +14508,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)

-   need_lib_prefix=no

-   need_version=no

-   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'

--  soname_spec='${libname}${release}${shared_ext}$major'

-+  soname_spec='${libname}${release}${shared_ext}$versuffix'

-   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'

-   shlibpath_var=LD_LIBRARY_PATH

-   shlibpath_overrides_runpath=no

diff --git a/pkgs/development/compilers/arm-frc-linux-gnueabi-gcc/no-nested-deprecated-warnings.patch b/pkgs/development/compilers/arm-frc-linux-gnueabi-gcc/no-nested-deprecated-warnings.patch
deleted file mode 100755
index 050a63e92fd..00000000000
--- a/pkgs/development/compilers/arm-frc-linux-gnueabi-gcc/no-nested-deprecated-warnings.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Description: Get rid of recursive deprecated warnings.

- As is, gcc gives warnings when a function with the

- deprecated attribute calls another function with

- the deprecated attribute.

- See http://stackoverflow.com/questions/13459602/how-can-i-get-rid-of-deprecated-warnings-in-deprecated-functions-in-gcc

-

-Author: James Kuszmaul <jbkuszmaul@wpi.edu>

-

---

-

---- gcc-armel-4.9.1.orig/gcc/tree.c

-+++ gcc-armel-4.9.1/gcc/tree.c

-@@ -12063,6 +12063,9 @@ warn_deprecated_use (tree node, tree attr)

-   if (node == 0 || !warn_deprecated_decl)

-     return;

-

-+  if (current_function_decl && TREE_DEPRECATED(current_function_decl))

-+    return;

-+

-   if (!attr)

-     {

-       if (DECL_P (node))

diff --git a/pkgs/development/compilers/coreclr/default.nix b/pkgs/development/compilers/coreclr/default.nix
index 0681e8210a6..3861501d399 100644
--- a/pkgs/development/compilers/coreclr/default.nix
+++ b/pkgs/development/compilers/coreclr/default.nix
@@ -19,13 +19,13 @@
 
 stdenv.mkDerivation rec {
   name = "coreclr-${version}";
-  version = "2.0.0";
+  version = "2.0.7";
 
   src = fetchFromGitHub {
     owner  = "dotnet";
     repo   = "coreclr";
     rev    = "v${version}";
-    sha256 = "16z58ix8kmk8csfy5qsqz8z30czhrap2vb8s8vdflmbcfnq31jcw";
+    sha256 = "0pzkrfgqywhpijbx7j1v4lxa6270h6whymb64jdkp7yj56ipqh2n";
   };
 
   patches = [
@@ -34,12 +34,20 @@ stdenv.mkDerivation rec {
       url = https://github.com/dotnet/coreclr/commit/a8f83b615708c529b112898e7d2fbc3f618b26ee.patch;
       sha256 = "047ph5gip4z2h7liwdxsmpnlaq0sd3hliaw4nyqjp647m80g3ffq";
     })
+    (fetchpatch {
+      # clang 5
+      url = https://github.com/dotnet/coreclr/commit/9b22e1a767dee38f351001c5601f56d78766a43e.patch;
+      sha256 = "1w1lxw5ryvhq8m5m0kv880c4bh6y9xdgypkr76sqbh3v568yghzg";
+    })
   ];
 
-  buildInputs = [
+  nativeBuildInputs = [
     which
     cmake
     clang
+  ];
+
+  buildInputs = [
     llvmPackages.llvm
     llvmPackages.lldb
     libunwind
@@ -68,7 +76,8 @@ stdenv.mkDerivation rec {
 
   buildPhase = ''
     runHook preBuild
-    ./build.sh $BuildArch $BuildType
+    # disable -Werror which can potentially breaks with every compiler upgrade
+    ./build.sh $BuildArch $BuildType cmakeargs "-DCLR_CMAKE_WARNINGS_ARE_ERRORS=OFF"
     runHook postBuild
   '';
 
diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index d9a36273ce1..f47c1f753ee 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -20,11 +20,14 @@ in rec {
 
     configureFlags = [ "--release-channel=stable" ];
 
+    # Upstream is not running tests on aarch64:
+    # see https://github.com/rust-lang/rust/issues/49807#issuecomment-380860567
+    # So we do the same.
+    doCheck = !stdenv.isAarch64;
+
     patches = [
       ./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch
-    ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch
-      # https://github.com/rust-lang/rust/issues/45410
-      ++ stdenv.lib.optional stdenv.isAarch64 ./patches/aarch64-disable-test_loading_cosine.patch;
+    ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
 
   };
 
diff --git a/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch b/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch
deleted file mode 100644
index bafab0e9ef7..00000000000
--- a/pkgs/development/compilers/rust/patches/aarch64-disable-test_loading_cosine.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/librustc_metadata/dynamic_lib.rs b/src/librustc_metadata/dynamic_lib.rs
-index 1b42fa0..92256dc 100644
---- a/src/librustc_metadata/dynamic_lib.rs
-+++ b/src/librustc_metadata/dynamic_lib.rs
-@@ -80,6 +80,7 @@ mod tests {
-     use std::mem;
- 
-     #[test]
-+    #[ignore]
-     fn test_loading_cosine() {
-         if cfg!(windows) {
-             return
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index bb0794aeb84..19c4a590e45 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -53,6 +53,7 @@ stdenv.mkDerivation {
   RUSTFLAGS = "-Ccodegen-units=10";
 
   # We need rust to build rust. If we don't provide it, configure will try to download it.
+  # Reference: https://github.com/rust-lang/rust/blob/master/src/bootstrap/configure.py
   configureFlags = configureFlags
                 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
                 ++ [ "--enable-vendor" ]
@@ -62,6 +63,13 @@ stdenv.mkDerivation {
                 ++ optional (targets != []) "--target=${target}"
                 ++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";
 
+  # The boostrap.py will generated a Makefile that then executes the build.
+  # The BOOTSTRAP_ARGS used by this Makefile must include all flags to pass
+  # to the bootstrap builder.
+  postConfigure = ''
+    substituteInPlace Makefile --replace 'BOOTSTRAP_ARGS :=' 'BOOTSTRAP_ARGS := --jobs $(NIX_BUILD_CORES)'
+  '';
+
   patches = patches ++ targetPatches;
 
   # the rust build system complains that nix alters the checksums
@@ -100,9 +108,6 @@ stdenv.mkDerivation {
 
     # Useful debugging parameter
     # export VERBOSE=1
-  '' + optionalString stdenv.isAarch64 ''
-    # https://github.com/rust-lang/rust/issues/49807
-    rm -vr src/test/debuginfo/by-value-self-argument-in-trait-impl.rs
   '' + optionalString stdenv.isDarwin ''
     # Disable all lldb tests.
     # error: Can't run LLDB test because LLDB's python path is not set
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 7b4425869b1..a3efc1e373b 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -882,9 +882,6 @@ self: super: {
   # Needs QuickCheck <2.10, HUnit <1.6 and base <4.10
   pointfree = doJailbreak super.pointfree;
 
-  # Needs time<1.7
-  taffybar = doJailbreak super.taffybar;
-
   # Needs tasty-quickcheck ==0.8.*, which we don't have.
   cryptohash-sha256 = doJailbreak super.cryptohash-sha256;
   cryptohash-sha1 = doJailbreak super.cryptohash-sha1;
diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix
index f336e8126f0..ef1ebe881f5 100644
--- a/pkgs/development/haskell-modules/configuration-nix.nix
+++ b/pkgs/development/haskell-modules/configuration-nix.nix
@@ -144,6 +144,7 @@ self: super: builtins.intersectAttrs super {
   gtk = disableHardening (addPkgconfigDepend (addBuildTool super.gtk self.gtk2hs-buildtools) pkgs.gtk2) ["fortify"];
   gtksourceview2 = addPkgconfigDepend super.gtksourceview2 pkgs.gtk2;
   gtk-traymanager = addPkgconfigDepend super.gtk-traymanager pkgs.gtk3;
+  taffybar = (addPkgconfigDepend super.taffybar pkgs.gtk3).override { dbus = self.dbus_1_0_1; };
 
   # Need WebkitGTK, not just webkit.
   webkit = super.webkit.override { webkit = pkgs.webkitgtk24x-gtk2; };
diff --git a/pkgs/development/interpreters/erlang/R20.nix b/pkgs/development/interpreters/erlang/R20.nix
index 7757039a4a1..42aaed0b659 100644
--- a/pkgs/development/interpreters/erlang/R20.nix
+++ b/pkgs/development/interpreters/erlang/R20.nix
@@ -1,8 +1,8 @@
 { mkDerivation, fetchurl }:
 
 mkDerivation rec {
-  version = "20.3.1";
-  sha256 = "13qh3an98qm477zr1dvcklbhar001cikp177295llcqpchamgzx3";
+  version = "20.3.2";
+  sha256 = "0cd7rz32cxghxb2q7g3p52sxbhwqn4pkjlf28hy1dms6q7f85zv1";
 
   prePatch = ''
     substituteInPlace configure.in --replace '`sw_vers -productVersion`' '10.10'
diff --git a/pkgs/development/libraries/arm-frc-linux-gnueabi-eglibc/default.nix b/pkgs/development/libraries/arm-frc-linux-gnueabi-eglibc/default.nix
deleted file mode 100755
index 8adbef8f576..00000000000
--- a/pkgs/development/libraries/arm-frc-linux-gnueabi-eglibc/default.nix
+++ /dev/null
@@ -1,65 +0,0 @@
-{stdenv, fetchurl, arm-frc-linux-gnueabi-linux-api-headers}:
-
-let
-  _target = "arm-frc-linux-gnueabi";
-  _basever = "2.21-r0.83";
-  srcs = [
-    (fetchurl {
-      url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libc6_${_basever}_cortexa9-vfpv3.ipk";
-      sha256 = "117058215440e258027bb9ff18db63c078d55288787dbedfcd5730c06c7a1ae9";
-    })
-    (fetchurl {
-      url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libc6-dev_${_basever}_cortexa9-vfpv3.ipk";
-      sha256 = "e28b05d498c1160949f51539270035e12c5bb9d75d68df1f5f111a8fc087f3a6";
-    })
-    (fetchurl {
-      url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libcidn1_${_basever}_cortexa9-vfpv3.ipk";
-      sha256 = "0f7372590abf69da54a9b7db8f944cf6c48d9ac8a091218ee60f84fdd9de2398";
-    })
-    (fetchurl {
-      url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libc6-thread-db_${_basever}_cortexa9-vfpv3.ipk";
-      sha256 = "5a839498507a0b63165cb7a78234d7eb2ee2bb6a046bff586090f2e70e0e2bfb";
-    })
-    (fetchurl {
-      url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/libc6-extra-nss_${_basever}_cortexa9-vfpv3.ipk";
-      sha256 = "d765d43c8ec95a4c64fa38eddf8cee848fd090d9cc5b9fcda6d2c9b03d2635c5";
-    })
-  ];
-in
-stdenv.mkDerivation rec {
-  version = "2.21";
-  name = "${_target}-eglibc-${version}";
-
-  sourceRoot = ".";
-  inherit srcs;
-
-  phases = [ "unpackPhase" "installPhase" ];
-
-  unpackCmd = ''
-      ar x $curSrc
-      tar xf data.tar.gz
-  '';
-
-  installPhase = ''
-    mkdir -p $out/${_target}
-    rm -rf lib/eglibc
-    find . \( -name .install -o -name ..install.cmd \) -delete
-    cp -r lib $out/${_target}
-    cp -r usr $out/${_target}
-
-    cp -r ${arm-frc-linux-gnueabi-linux-api-headers}/* $out
-  '';
-
-  meta = {
-    description = "FRC standard C lib";
-    longDescription = ''
-      eglibc library for the NI RoboRio to be used in compiling frc user
-      programs.
-    '';
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.colescott ];
-    platforms = stdenv.lib.platforms.linux;
-
-    priority = 2;
-  };
-}
diff --git a/pkgs/development/libraries/arm-frc-linux-gnueabi-linux-api-headers/default.nix b/pkgs/development/libraries/arm-frc-linux-gnueabi-linux-api-headers/default.nix
deleted file mode 100755
index 29e349e0a82..00000000000
--- a/pkgs/development/libraries/arm-frc-linux-gnueabi-linux-api-headers/default.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{stdenv, fetchurl}:
-
-let
-  _target = "arm-frc-linux-gnueabi";
-  _basever = "3.19-r0.36";
-  src = fetchurl {
-    url = "http://download.ni.com/ni-linux-rt/feeds/2016/arm/ipk/cortexa9-vfpv3/linux-libc-headers-dev_${_basever}_cortexa9-vfpv3.ipk";
-    sha256 = "10066ddb9a19bf764a9a67919a7976478041e98c44c19308f076c78ecb07408c";
-  };
-in
-stdenv.mkDerivation rec {
-  version = "3.19";
-  name = "${_target}-linux-api-headers-${version}";
-
-  sourceRoot = ".";
-  inherit src;
-
-  phases = [ "unpackPhase" "installPhase" ];
-
-  unpackCmd = ''
-    ar x $curSrc
-    tar xf data.tar.gz
-  '';
-
-  installPhase = ''
-    mkdir -p $out/${_target}
-    find . \( -name .install -o -name ..install.cmd \) -delete
-    cp -r usr/ $out/${_target}
-  '';
-
-  meta = {
-    description = "FRC linux api headers";
-    longDescription = ''
-      All linux api headers required to compile the arm-frc-linux-gnuaebi-gcc
-      cross compiler and all user programs.
-    '';
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.colescott ];
-    platforms = stdenv.lib.platforms.linux;
-
-    priority = 1;
-  };
-}
diff --git a/pkgs/development/libraries/babl/default.nix b/pkgs/development/libraries/babl/default.nix
index be4cf809f0c..285f4dea802 100644
--- a/pkgs/development/libraries/babl/default.nix
+++ b/pkgs/development/libraries/babl/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "babl-0.1.44";
+  name = "babl-0.1.46";
 
   src = fetchurl {
     url = "http://ftp.gtk.org/pub/babl/0.1/${name}.tar.bz2";
-    sha256 = "0zfy1jrwdp4ja2f1rqa2m46vx6nilm73f72d4d1c8d65vshgsqzl";
+    sha256 = "0nwyhvfca6m35wjcccvwca7fcihzgdfyc012qi703y5d3cxl1hmv";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/caf/default.nix b/pkgs/development/libraries/caf/default.nix
index d3b6722b36c..1e764aff4cc 100644
--- a/pkgs/development/libraries/caf/default.nix
+++ b/pkgs/development/libraries/caf/default.nix
@@ -2,25 +2,17 @@
 
 stdenv.mkDerivation rec {
   name = "actor-framework-${version}";
-  version = "0.15.3";
+  version = "0.15.7";
 
   src = fetchFromGitHub {
     owner = "actor-framework";
     repo = "actor-framework";
     rev = "${version}";
-    sha256 = "0202nsdriigdh6sxi1k3hddvmf1x54qpykbvf2ghfhzyh0m1q7j2";
+    sha256 = "0qmb18k162xdvf8z03mybjazkwb2vqda5xd1qh5bwkvxracwq3sb";
   };
 
-  # See https://github.com/actor-framework/actor-framework/issues/545 and remove on next release that incorporates this
-  patches = [ (fetchpatch {
-    url    = "https://github.com/actor-framework/actor-framework/commit/c5a3ee26a6e76b28dd4226f35230b280f291386d.patch";
-    sha256 = "1l0323cqyqlp3lvggm709fmfm6lk6av1smdbd420adhi3ksj2vhj";
-  }) ];
-
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
   meta = with stdenv.lib; {
     description = "An open source implementation of the actor model in C++";
     homepage = http://actor-framework.org/;
diff --git a/pkgs/development/libraries/flint/default.nix b/pkgs/development/libraries/flint/default.nix
index 2977293fefa..67bf7503db9 100644
--- a/pkgs/development/libraries/flint/default.nix
+++ b/pkgs/development/libraries/flint/default.nix
@@ -26,6 +26,9 @@ stdenv.mkDerivation rec {
   ] ++ stdenv.lib.optionals withBlas [
     openblas
   ];
+  propagatedBuildInputs = [
+    mpfr # flint.h includes mpfr.h
+  ];
   configureFlags = [
     "--with-gmp=${gmp}"
     "--with-mpir=${mpir}"
diff --git a/pkgs/development/libraries/fplll/default.nix b/pkgs/development/libraries/fplll/default.nix
index b377061fe97..2dd757bf821 100644
--- a/pkgs/development/libraries/fplll/default.nix
+++ b/pkgs/development/libraries/fplll/default.nix
@@ -4,12 +4,12 @@
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
   pname = "fplll";
-  version = "5.0.2";
+  version = "5.2.0";
   src = fetchFromGitHub {
     owner = "${pname}";
     repo = "${pname}";
     rev = "${version}";
-    sha256 = "0rl98rx284giyhj3pf6iydn1a06jis8c8mnsc7kqs4rcmiw4bjpx";
+    sha256 = "0931i4q49lzlifsg9zd8a2yzj626i1s2bqhkfxvcxv94c38s0nh1";
   };
   nativeBuildInputs = [autoconf automake libtool gettext autoreconfHook];
   buildInputs = [gmp mpfr];
diff --git a/pkgs/development/libraries/gvfs/default.nix b/pkgs/development/libraries/gvfs/default.nix
index 67837b345c0..238edddaf3a 100644
--- a/pkgs/development/libraries/gvfs/default.nix
+++ b/pkgs/development/libraries/gvfs/default.nix
@@ -18,14 +18,14 @@
 
 let
   pname = "gvfs";
-  version = "1.36.0";
+  version = "1.36.1";
 in
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
-    sha256 = "1fsn6aa9a68cfbna9s00l1ry4ym1fr7ii2f45hzj2fipxfpqihwy";
+    sha256 = "09phj9kqk8lzcmkjfq7qmzpkj4xp1vg4mskv6d2s9j62hvrxyh1q";
   };
 
   # Uncomment when switching back to meson
diff --git a/pkgs/development/libraries/jemalloc/common.nix b/pkgs/development/libraries/jemalloc/common.nix
new file mode 100644
index 00000000000..1a26bd13d41
--- /dev/null
+++ b/pkgs/development/libraries/jemalloc/common.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, version, sha256, ... }@args:
+
+stdenv.mkDerivation (rec {
+  name = "jemalloc-${version}";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://github.com/jemalloc/jemalloc/releases/download/${version}/${name}.tar.bz2";
+    inherit sha256;
+  };
+
+  # By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
+  # then stops downstream builds (mariadb in particular) from detecting it. This
+  # option should remove the prefix and give us a working jemalloc.
+  configureFlags = stdenv.lib.optional stdenv.isDarwin "--with-jemalloc-prefix="
+                   # jemalloc is unable to correctly detect transparent hugepage support on
+                   # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default
+                   # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support
+                   ++ stdenv.lib.optional stdenv.isArm "--disable-thp";
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://jemalloc.net;
+    description = "General purpose malloc(3) implementation";
+    longDescription = ''
+      malloc(3)-compatible memory allocator that emphasizes fragmentation
+      avoidance and scalable concurrency support.
+    '';
+    license = licenses.bsd2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ wkennington ];
+  };
+} // (builtins.removeAttrs args [ "stdenv" "fetchurl" "version" "sha256" ]))
diff --git a/pkgs/development/libraries/jemalloc/default.nix b/pkgs/development/libraries/jemalloc/default.nix
index 0882431cc15..40c06cbffdf 100644
--- a/pkgs/development/libraries/jemalloc/default.nix
+++ b/pkgs/development/libraries/jemalloc/default.nix
@@ -1,40 +1,10 @@
 { stdenv, fetchurl, fetchpatch }:
-
-stdenv.mkDerivation rec {
-  name = "jemalloc-${version}";
+import ./common.nix {
+  inherit stdenv fetchurl;
   version = "5.0.1";
-
-  src = fetchurl {
-    url = "https://github.com/jemalloc/jemalloc/releases/download/${version}/${name}.tar.bz2";
-    sha256 = "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9";
-  };
-
-  # By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
-  # then stops downstream builds (mariadb in particular) from detecting it. This
-  # option should remove the prefix and give us a working jemalloc.
-  configureFlags = stdenv.lib.optional stdenv.isDarwin "--with-jemalloc-prefix="
-                   # jemalloc is unable to correctly detect transparent hugepage support on
-                   # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default
-                   # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support
-                   ++ stdenv.lib.optional stdenv.isArm "--disable-thp";
-  doCheck = true;
-
+  sha256 = "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9";
   patches = stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
     url = "https://patch-diff.githubusercontent.com/raw/jemalloc/jemalloc/pull/1035.patch";
     sha256 = "02y0q3dp253bipxv4r954nqipbjbj92p6ww9bx5bk3d8pa81wkqq";
   });
-
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
-    homepage = http://jemalloc.net;
-    description = "General purpose malloc(3) implementation";
-    longDescription = ''
-      malloc(3)-compatible memory allocator that emphasizes fragmentation
-      avoidance and scalable concurrency support.
-    '';
-    license = licenses.bsd2;
-    platforms = platforms.all;
-    maintainers = with maintainers; [ wkennington ];
-  };
 }
diff --git a/pkgs/development/libraries/jemalloc/jemalloc450.nix b/pkgs/development/libraries/jemalloc/jemalloc450.nix
new file mode 100644
index 00000000000..00b38a85553
--- /dev/null
+++ b/pkgs/development/libraries/jemalloc/jemalloc450.nix
@@ -0,0 +1,6 @@
+{ stdenv, fetchurl }:
+import ./common.nix {
+  inherit stdenv fetchurl;
+  version = "4.5.0";
+  sha256 = "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl";
+}
diff --git a/pkgs/development/libraries/kirigami/default.nix b/pkgs/development/libraries/kirigami/default.nix
deleted file mode 100644
index 1127f3e197d..00000000000
--- a/pkgs/development/libraries/kirigami/default.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ stdenv, fetchurl, cmake, extra-cmake-modules, pkgconfig
-, plasma-framework, qtbase, qttranslations
-, qtquickcontrols ? null
-, qtquickcontrols2 ? null }:
-
-let
-  pname = "kirigami";
-
-  generic = { name, version, sha256, qtqc, broken }:
-  stdenv.mkDerivation rec {
-    inherit name version;
-
-    src = fetchurl {
-      url = "mirror://kde/stable/${pname}/${name}.tar.xz";
-      inherit sha256;
-    };
-
-    buildInputs = [ plasma-framework qtbase qtqc qttranslations ];
-
-    nativeBuildInputs = [ cmake pkgconfig extra-cmake-modules ];
-
-    meta = with stdenv.lib; {
-      license     = licenses.lgpl2;
-      homepage    = http://www.kde.org;
-      maintainers = with maintainers; [ ttuegel peterhoeg ];
-      platforms   = platforms.unix;
-      inherit broken;
-    };
-  };
-
-in {
-  kirigami_1 = generic rec {
-    name    = "${pname}-${version}";
-    version = "1.1.0";
-    sha256  = "1p9ydggwbyfdgwmvyc8004sk9mfshlg9b83lzvz9qk3a906ayxv6";
-    qtqc    = qtquickcontrols;
-    broken  = false;
-  };
-
-  kirigami_2 = generic rec {
-    name    = "${pname}2-${version}";
-    version = "2.1.0";
-    sha256  = "0d79h10jzv9z7xzap4k9vbw6p9as8vdkz3x6xlzx407i9sbzyi77";
-    qtqc    = qtquickcontrols2;
-    broken  = builtins.compareVersions qtbase.version "5.7.0" < 0;
-  };
-}
diff --git a/pkgs/development/libraries/libdazzle/default.nix b/pkgs/development/libraries/libdazzle/default.nix
index 50f03f3ac7a..faa8b483a78 100644
--- a/pkgs/development/libraries/libdazzle/default.nix
+++ b/pkgs/development/libraries/libdazzle/default.nix
@@ -2,7 +2,7 @@
 , gtk-doc, docbook_xsl, dbus, xvfb_run, glib, gtk3, gnome3 }:
 
 let
-  version = "3.28.0";
+  version = "3.28.1";
   pname = "libdazzle";
 in
 stdenv.mkDerivation {
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://gnome/sources/libdazzle/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0zq37i7gnmnc7qfngzhj71nqhf2wxl4m247s2ym9ykakxbi6zajp";
+    sha256 = "04j9pjigpgxddq6y90y73k8qyjixlalip87q121ss5d8zp8xnz32";
   };
 
   nativeBuildInputs = [ ninja meson pkgconfig vala gobjectIntrospection libxml2 gtk-doc docbook_xsl dbus xvfb_run ];
diff --git a/pkgs/development/libraries/libqrencode/default.nix b/pkgs/development/libraries/libqrencode/default.nix
index 337d9423aa3..7c1844bf281 100644
--- a/pkgs/development/libraries/libqrencode/default.nix
+++ b/pkgs/development/libraries/libqrencode/default.nix
@@ -3,12 +3,12 @@
 
 stdenv.mkDerivation rec {
   name = "libqrencode-${version}";
-  version = "3.4.4";
+  version = "4.0.0";
 
   src = fetchurl {
     url = "https://fukuchi.org/works/qrencode/qrencode-${version}.tar.gz";
     sha1 = "644054a76c8b593acb66a8c8b7dcf1b987c3d0b2";
-    sha256 = "0wiagx7i8p9zal53smf5abrnh9lr31mv0p36wg017401jrmf5577";
+    sha256 = "10da4q5pym7pzxcv21w2kc2rxmq7sp1rg58zdklwfr0jjci1nqjv";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libwnck/3.x.nix b/pkgs/development/libraries/libwnck/3.x.nix
index 937fa28b902..8efd908584e 100644
--- a/pkgs/development/libraries/libwnck/3.x.nix
+++ b/pkgs/development/libraries/libwnck/3.x.nix
@@ -19,8 +19,8 @@ in stdenv.mkDerivation rec{
   nativeBuildInputs = [ pkgconfig intltool gobjectIntrospection ];
   propagatedBuildInputs = [ libX11 gtk3 ];
 
-  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "share/gir-1.0";
-  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "lib/girepository-1.0";
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "$(dev)/share/gir-1.0";
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "$(out)/lib/girepository-1.0";
 
   passthru = {
     updateScript = gnome3.updateScript {
diff --git a/pkgs/development/libraries/nix-plugins/default.nix b/pkgs/development/libraries/nix-plugins/default.nix
index c2c5858ca75..392d4daa0d1 100644
--- a/pkgs/development/libraries/nix-plugins/default.nix
+++ b/pkgs/development/libraries/nix-plugins/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, nix, cmake, pkgconfig, boost }:
-let version = "4.0.2"; in
+let version = "4.0.3"; in
 stdenv.mkDerivation {
   name = "nix-plugins-${version}";
 
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
     owner = "shlevy";
     repo = "nix-plugins";
     rev = version;
-    sha256 = "0cr1lz788rw7kxfs2acplhdl5cv8qrfh4kdqxi0p63ajnd303k8c";
+    sha256 = "0dkrrh94s3gvym7hhdqivxzphsjh0828c0y6w6a51xdpm8rlajzj";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
diff --git a/pkgs/development/libraries/openvdb/default.nix b/pkgs/development/libraries/openvdb/default.nix
index 8ed383c887b..be28c84e3e4 100644
--- a/pkgs/development/libraries/openvdb/default.nix
+++ b/pkgs/development/libraries/openvdb/default.nix
@@ -3,13 +3,13 @@
 stdenv.mkDerivation rec
 {
   name = "openvdb-${version}";
-  version = "5.0.0";
+  version = "5.1.0";
 
   src = fetchFromGitHub {
     owner = "dreamworksanimation";
     repo = "openvdb";
     rev = "v${version}";
-    sha256 = "162l1prgdyf571bgxc621gicl40b050ny64f0jmnhz0h5xq6sfrv";
+    sha256 = "1als53dnbnwa66k16vy95h1rhpdzz6i80c0gc2g3i17qbasl6ni5";
   };
 
   outputs = [ "out" ];
diff --git a/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
index 5085d9bf5ef..8667f272cf7 100644
--- a/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
+++ b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "qtstyleplugin-kvantum-${version}";
-  version = "0.10.4";
+  version = "0.10.6";
 
   src = fetchFromGitHub {
     owner = "tsujan";
     repo = "Kvantum";
-    rev = "0527bb03f2252269fd382e11181a34ca72c96b4b";
-    sha256 = "0ky44s1fgqxraywagx1mv07yz76ppgiz3prq447db78wkwqg2d8p";
+    rev = "a6daa1a6df3c5d4abc7ea39ef7028ddea2addbf6";
+    sha256 = "1zns4x95h0ydiwx8yw0bmyg4lc2sy7annmdrg66sx753x3177zxp";
   };
 
   nativeBuildInputs = [ qmake qttools ];
@@ -16,15 +16,16 @@ stdenv.mkDerivation rec {
 
   postUnpack = "sourceRoot=\${sourceRoot}/Kvantum";
 
-  postInstall= ''
-    mkdir -p $out/$qtPluginPrefix/styles
-    mv $NIX_QT5_TMP/$qtPluginPrefix/styles/libkvantum.so $out/$qtPluginPrefix/styles/libkvantum.so
+  postPatch = ''
+    # Fix plugin dir
+    substituteInPlace style/style.pro \
+      --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix"
   '';
 
   meta = with stdenv.lib; {
     description = "SVG-based Qt5 theme engine plus a config tool and extra themes";
     homepage = "https://github.com/tsujan/Kvantum";
-    license = licenses.gpl2;
+    license = licenses.gpl3;
     platforms = platforms.linux;
     maintainers = [ maintainers.bugworm ];
   };
diff --git a/pkgs/development/libraries/rocksdb/default.nix b/pkgs/development/libraries/rocksdb/default.nix
index 0951c113e3f..bb0faf76be6 100644
--- a/pkgs/development/libraries/rocksdb/default.nix
+++ b/pkgs/development/libraries/rocksdb/default.nix
@@ -15,12 +15,13 @@
 
 let
   malloc = if jemalloc != null then jemalloc else gperftools;
+  tools = [ "sst_dump" "ldb" "rocksdb_dump" "rocksdb_undump" "blob_dump" ];
 in
 stdenv.mkDerivation rec {
   name = "rocksdb-${version}";
   version = "5.10.3";
 
-  outputs = [ "dev" "out" "static" ];
+  outputs = [ "dev" "out" "static" "bin" ];
 
   src = fetchFromGitHub {
     owner = "facebook";
@@ -55,7 +56,7 @@ stdenv.mkDerivation rec {
   buildFlags = buildAndInstallFlags ++ [
     "shared_lib"
     "static_lib"
-  ];
+  ] ++ tools ;
 
   installFlags = buildAndInstallFlags ++ [
     "INSTALL_PATH=\${out}"
@@ -69,6 +70,9 @@ stdenv.mkDerivation rec {
     cat make_config.mk
     mkdir -pv $static/lib/
     mv -vi $out/lib/${LIBNAME}.a $static/lib/
+
+    install -d ''${!outputBin}/bin
+    install -D ${stdenv.lib.concatStringsSep " " tools} ''${!outputBin}/bin
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/science/math/cliquer/default.nix b/pkgs/development/libraries/science/math/cliquer/default.nix
new file mode 100644
index 00000000000..2441aff9fa3
--- /dev/null
+++ b/pkgs/development/libraries/science/math/cliquer/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, fetchFromGitHub
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.21";
+  name = "cliquer-${version}";
+
+  # autotoolized version of the original cliquer
+  src = fetchFromGitHub {
+    owner = "dimpase";
+    repo = "autocliquer";
+    rev = "v${version}";
+    sha256 = "180i4qj1a25qfp75ig2d3144xfpb1dgcgpha0iqqghd7di4awg7z";
+  };
+
+  doCheck = true;
+
+  buildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = https://users.aalto.fi/~pat/cliquer.html;
+    downloadPage = src.meta.homepage; # autocliquer
+    description = "Routines for clique searching";
+    longDescription = ''
+      Cliquer is a set of C routines for finding cliques in an arbitrary weighted graph.
+      It uses an exact branch-and-bound algorithm developed by Patric Östergård.
+      It is designed with the aim of being efficient while still being flexible and
+      easy to use.
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ timokau ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/science/math/m4ri/default.nix b/pkgs/development/libraries/science/math/m4ri/default.nix
new file mode 100644
index 00000000000..b9ee1e2a10d
--- /dev/null
+++ b/pkgs/development/libraries/science/math/m4ri/default.nix
@@ -0,0 +1,30 @@
+{ stdenv
+, fetchFromBitbucket
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  version = "20140914";
+  name = "m4ri-${version}";
+
+  src = fetchFromBitbucket {
+    owner = "malb";
+    repo = "m4ri";
+    rev = "release-${version}";
+    sha256 = "0xfg6pffbn8r1s0y7bn9b8i55l00d41dkmhrpf7pwk53qa3achd3";
+  };
+
+  doCheck = true;
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = https://malb.bitbucket.io/m4ri/;
+    description = "Library to do fast arithmetic with dense matrices over F_2";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ timokau ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/science/math/m4rie/default.nix b/pkgs/development/libraries/science/math/m4rie/default.nix
new file mode 100644
index 00000000000..23fc03655cf
--- /dev/null
+++ b/pkgs/development/libraries/science/math/m4rie/default.nix
@@ -0,0 +1,39 @@
+{ stdenv
+, fetchFromBitbucket
+, autoreconfHook
+, m4ri
+}:
+
+stdenv.mkDerivation rec {
+  version = "20150908";
+  name = "m4rie-${version}";
+
+  src = fetchFromBitbucket {
+    owner = "malb";
+    repo = "m4rie";
+    rev = "release-${version}";
+    sha256 = "0r8lv46qx5mkz5kp3ay2jnsp0mbhlqr5z2z220wdk73wdshcznss";
+  };
+
+  doCheck = true;
+
+  buildInputs = [
+    m4ri
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = https://malb.bitbucket.io/m4rie/;
+    description = "Library for matrix multiplication, reduction and inversion over GF(2^k) for 2 <= k <= 10";
+    longDescription = ''
+      M4RIE is a library for fast arithmetic with dense matrices over small finite fields of even characteristic.
+      It uses the M4RI library, implementing the same operations over the finite field F2.
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ timokau ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/node-packages/default-v6.nix b/pkgs/development/node-packages/default-v6.nix
index 5fc007bbfd0..2be09eb1632 100644
--- a/pkgs/development/node-packages/default-v6.nix
+++ b/pkgs/development/node-packages/default-v6.nix
@@ -24,13 +24,13 @@ nodePackages // {
   phantomjs = nodePackages.phantomjs.override (oldAttrs: {
     buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs2 ];
   });
-  
+
   webdrvr = nodePackages.webdrvr.override (oldAttrs: {
     buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs ];
-    
+
     preRebuild = ''
       mkdir $TMPDIR/webdrvr
-      
+
       ln -s ${pkgs.fetchurl {
         url = "https://selenium-release.storage.googleapis.com/2.43/selenium-server-standalone-2.43.1.jar";
         sha1 = "ef1b5f8ae9c99332f99ba8794988a1d5b974d27b";
@@ -72,4 +72,11 @@ nodePackages // {
     '';
     buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs2 ];
   });
+
+  node2nix =  nodePackages.node2nix.override (oldAttrs: {
+    buildInputs = oldAttrs.buildInputs ++ [ pkgs.makeWrapper ];
+    postInstall = ''
+      wrapProgram "$out/bin/node2nix" --prefix PATH : ${stdenv.lib.makeBinPath [ pkgs.nix ]}
+    '';
+  });
 }
diff --git a/pkgs/development/perl-modules/Socket6-sv_undef.patch b/pkgs/development/perl-modules/Socket6-sv_undef.patch
new file mode 100644
index 00000000000..3ed4b61b6d3
--- /dev/null
+++ b/pkgs/development/perl-modules/Socket6-sv_undef.patch
@@ -0,0 +1,18 @@
+diff --git a/Socket6.xs b/Socket6.xs
+index 05c791c..058e9d9 100644
+--- a/Socket6.xs
++++ b/Socket6.xs
+@@ -105,10 +105,6 @@ const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
+ #define	HAVE_INET_PTON		1
+ #endif
+ 
+-#ifndef HAVE_PL_SV_UNDEF
+-#define	PL_sv_undef		sv_undef
+-#endif
+-
+ static int
+ not_here(char *s)
+ {
+-- 
+2.16.3
+
diff --git a/pkgs/development/python-modules/alot/default.nix b/pkgs/development/python-modules/alot/default.nix
index 7abc56c4783..dd06d4dde7a 100644
--- a/pkgs/development/python-modules/alot/default.nix
+++ b/pkgs/development/python-modules/alot/default.nix
@@ -19,12 +19,6 @@ buildPythonPackage rec {
     sha256 = "1y932smng7qx7ybmqw4qh75b0lv9imfs5ak9fd0qhysij8kpmdhi";
   };
 
-  postPatch = ''
-    substituteInPlace alot/defaults/alot.rc.spec \
-      --replace "themes_dir = string(default=None)" \
-                "themes_dir = string(default='$out/share/themes')"
-  '';
-
   nativeBuildInputs = lib.optional withManpage sphinx;
 
   propagatedBuildInputs = [
@@ -50,8 +44,8 @@ buildPythonPackage rec {
     cp -r docs/build/man $out/man
   ''
   + ''
-    mkdir -p $out/share/applications
-    cp -r extra/themes $out/share
+    mkdir -p $out/share/{applications,alot}
+    cp -r extra/themes $out/share/alot
 
     sed "s,/usr/bin,$out/bin,g" extra/alot.desktop > $out/share/applications/alot.desktop
   '';
diff --git a/pkgs/development/python-modules/apsw/default.nix b/pkgs/development/python-modules/apsw/default.nix
index c16fb3c4c46..fb22128b928 100644
--- a/pkgs/development/python-modules/apsw/default.nix
+++ b/pkgs/development/python-modules/apsw/default.nix
@@ -1,24 +1,24 @@
-{ stdenv, buildPythonPackage, fetchPypi
+{ stdenv, buildPythonPackage, fetchFromGitHub
 , sqlite, isPyPy }:
 
 buildPythonPackage rec {
   pname = "apsw";
-  version = "3.9.2-r1";
+  version = "3.22.0-r1";
 
   disabled = isPyPy;
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "dab96fd164dde9e59f7f27228291498217fa0e74048e2c08c7059d7e39589270";
+  src = fetchFromGitHub {
+    owner = "rogerbinns";
+    repo = "apsw";
+    rev = version;
+    sha256 = "02ldvshcgr4c7c8anp4flfnw8g8ys5bflkb8b51rb618qxhhwyak";
   };
 
   buildInputs = [ sqlite ];
 
-  # python: double free or corruption (fasttop): 0x0000000002fd4660 ***
-#   doCheck = false;
-
   meta = with stdenv.lib; {
     description = "A Python wrapper for the SQLite embedded relational database engine";
-    homepage = http://code.google.com/p/apsw/;
+    homepage = https://github.com/rogerbinns/apsw;
+    license = licenses.zlib;
   };
 }
diff --git a/pkgs/development/python-modules/cvxopt/default.nix b/pkgs/development/python-modules/cvxopt/default.nix
new file mode 100644
index 00000000000..be6f688f503
--- /dev/null
+++ b/pkgs/development/python-modules/cvxopt/default.nix
@@ -0,0 +1,69 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, isPyPy
+, python
+, openblasCompat # build segfaults with regular openblas
+, suitesparse
+, glpk ? null
+, gsl ? null
+, fftw ? null
+, withGlpk ? true
+, withGsl ? true
+, withFftw ? true
+}:
+
+buildPythonPackage rec {
+  pname = "cvxopt";
+  version = "1.1.9";
+
+  disabled = isPyPy; # hangs at [translation:info]
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0gcqq8ymjxv8qa5ss2pdhsj5bahvdxa6h2rlpp51520mjxrpw5cg";
+  };
+
+  # similar to Gsl, glpk, fftw there is also a dsdp interface
+  # but dsdp is not yet packaged in nixpkgs
+  preConfigure = ''
+    export CVXOPT_BLAS_LIB_DIR=${openblasCompat}/lib
+    export CVXOPT_BLAS_LIB=openblas
+    export CVXOPT_LAPACK_LIB=openblas
+    export CVXOPT_SUITESPARSE_LIB_DIR=${suitesparse}/lib
+    export CVXOPT_SUITESPARSE_INC_DIR=${suitesparse}/include
+  '' + lib.optionalString withGsl ''
+    export CVXOPT_BUILD_GSL=1
+    export CVXOPT_GSL_LIB_DIR=${gsl}/lib
+    export CVXOPT_GSL_INC_DIR=${gsl}/include
+  '' + lib.optionalString withGlpk ''
+    export CVXOPT_BUILD_GLPK=1
+    export CVXOPT_GLPK_LIB_DIR=${glpk}/lib
+    export CVXOPT_GLPK_INC_DIR=${glpk}/include
+  '' + lib.optionalString withFftw ''
+    export CVXOPT_BUILD_FFTW=1
+    export CVXOPT_FFTW_LIB_DIR=${fftw}/lib
+    export CVXOPT_FFTW_INC_DIR=${fftw.dev}/include
+  '';
+
+  checkPhase = ''
+    ${python.interpreter} -m unittest discover -s tests
+  '';
+
+  meta = {
+    homepage = http://cvxopt.org/;
+    description = "Python Software for Convex Optimization";
+    longDescription = ''
+      CVXOPT is a free software package for convex optimization based on the
+      Python programming language. It can be used with the interactive
+      Python interpreter, on the command line by executing Python scripts,
+      or integrated in other software via Python extension modules. Its main
+      purpose is to make the development of software for convex optimization
+      applications straightforward by building on Python's extensive
+      standard library and on the strengths of Python as a high-level
+      programming language.
+    '';
+    maintainers = with lib.maintainers; [ edwtjo ];
+    license = lib.licenses.gpl3Plus;
+  };
+}
diff --git a/pkgs/development/python-modules/cysignals/default.nix b/pkgs/development/python-modules/cysignals/default.nix
new file mode 100644
index 00000000000..c1fedecbff3
--- /dev/null
+++ b/pkgs/development/python-modules/cysignals/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, fetchPypi
+, buildPythonPackage
+, cython
+, sphinx
+}:
+
+buildPythonPackage rec {
+  pname = "cysignals";
+  version = "1.6.9";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "003invnixqy1h4lb358vwrxykxzp15csaddkgq3pqqmswnva5908";
+  };
+
+  hardeningDisable = [
+    "fortify"
+  ];
+
+  # currently fails, probably because of formatting changes in gdb 8.0
+  doCheck = false;
+
+  preCheck = ''
+    # Make sure cysignals-CSI is in PATH
+    export PATH="$out/bin:$PATH"
+  '';
+
+  propagatedBuildInputs = [
+    cython
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Interrupt and signal handling for Cython";
+    homepage = https://github.com/sagemath/cysignals/;
+    maintainers = with lib.maintainers; [ timokau ];
+    license = lib.licenses.lgpl3Plus;
+  };
+}
diff --git a/pkgs/development/python-modules/digitalocean/default.nix b/pkgs/development/python-modules/digitalocean/default.nix
index 1d36f7b5486..e81caa66e5f 100644
--- a/pkgs/development/python-modules/digitalocean/default.nix
+++ b/pkgs/development/python-modules/digitalocean/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPythonPackage, fetchPypi, requests }:
+{ stdenv, buildPythonPackage, fetchPypi, requests, jsonpickle }:
 
 buildPythonPackage rec {
   pname = "python-digitalocean";
@@ -6,10 +6,10 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "06391cf0b253c8b4a5a10b3a4b7b7808b890a1d1e3b43d5ce3b5293a9c77af6b";
+    sha256 = "0h4drpdsmk0b3rlvg6q6cz11k23w0swj1iddk7xdcw4m7r7c52kw";
   };
 
-  propagatedBuildInputs = [ requests ];
+  propagatedBuildInputs = [ requests jsonpickle ];
 
   # Package doesn't distribute tests.
   doCheck = false;
diff --git a/pkgs/development/python-modules/envs/default.nix b/pkgs/development/python-modules/envs/default.nix
new file mode 100644
index 00000000000..7b6159d0e61
--- /dev/null
+++ b/pkgs/development/python-modules/envs/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildPythonPackage, fetchFromGitHub
+, click, jinja2, terminaltables }:
+
+buildPythonPackage rec {
+  pname = "envs";
+  version = "1.2.4";
+
+  # move to fetchPyPi when https://github.com/capless/envs/issues/8 is fixed
+  src = fetchFromGitHub {
+    owner  = "capless";
+    repo   = "envs";
+    rev    = "e1f6cbad7f20316fc44324d2c50826d57c2817a8";
+    sha256 = "0p88a79amj0jxll3ssq1dzg78y7zwgc8yqyr7cf53nv2i7kmpakv";
+  };
+
+  checkInputs = [ click jinja2 terminaltables ];
+
+  meta = with lib; {
+    description = "Easy access to environment variables from Python";
+    homepage = https://github.com/capless/envs;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ peterhoeg ];
+  };
+}
diff --git a/pkgs/development/python-modules/fpylll/default.nix b/pkgs/development/python-modules/fpylll/default.nix
new file mode 100644
index 00000000000..6ce069b3191
--- /dev/null
+++ b/pkgs/development/python-modules/fpylll/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, fetchPypi
+, buildPythonPackage
+, pkgconfig
+, gmp
+, pari
+, mpfr
+, fplll
+, cython
+, cysignals
+, numpy
+, pytest
+}:
+
+buildPythonPackage rec {
+  pname = "fpylll";
+  version = "0.3.0dev";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0bjkh02fnxsrxwjzai8ij12zl2wq319z8y25sn9pvvzla5izgnp9";
+  };
+
+  buildInputs = [
+    gmp
+    pari
+    mpfr
+    fplll
+  ];
+
+  propagatedBuildInputs = [
+    cython
+    cysignals
+    numpy
+  ];
+
+  nativeBuildInputs = [
+    pkgconfig
+  ];
+
+  checkInputs = [
+    pytest
+  ];
+
+  checkPhase = ''
+    py.test
+  '';
+
+  meta = {
+    description = "A Python interface for fplll";
+    homepage = https://github.com/fplll/fpylll;
+    maintainers = with lib.maintainers; [ timokau ];
+    license = lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/development/python-modules/python-docx/default.nix b/pkgs/development/python-modules/python-docx/default.nix
new file mode 100644
index 00000000000..11ade481df5
--- /dev/null
+++ b/pkgs/development/python-modules/python-docx/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, behave
+, buildPythonPackage
+, fetchPypi
+, lxml
+, pytest
+, pyparsing
+, mock
+}:
+
+buildPythonPackage rec {
+  pname = "python-docx";
+  version = "0.8.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "117i84s6fcdsrfckbvznnqgqwhnf1x0523ps16cki8sg9byydv2m";
+  };
+
+  checkInputs = [ behave mock pyparsing pytest ];
+  propagatedBuildInputs = [ lxml ];
+
+  checkPhase = ''
+    py.test tests
+  '';
+
+  meta = {
+    description = "Create and update Microsoft Word .docx files";
+    homepage = https://python-docx.readthedocs.io/en/latest/;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.alexchapman ];
+  };
+}
diff --git a/pkgs/development/python-modules/rlp/default.nix b/pkgs/development/python-modules/rlp/default.nix
new file mode 100644
index 00000000000..6443a4e2bbf
--- /dev/null
+++ b/pkgs/development/python-modules/rlp/default.nix
@@ -0,0 +1,21 @@
+{ lib, fetchPypi, buildPythonPackage, pytest }:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "rlp";
+  version = "0.6.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0d3gx4mp8q4z369s5yk1n9c55sgfw9fidbwqxq67d6s7l45rm1w7";
+  };
+
+  buildInputs = [ pytest ];
+
+  meta = {
+    description = "A package for encoding and decoding data in and from Recursive Length Prefix notation";
+    homepage = "https://github.com/ethereum/pyrlp";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ gebner ];
+  };
+}
diff --git a/pkgs/development/python-modules/rpy2/default.nix b/pkgs/development/python-modules/rpy2/default.nix
new file mode 100644
index 00000000000..8db7ae3b337
--- /dev/null
+++ b/pkgs/development/python-modules/rpy2/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, isPyPy
+, readline
+, R
+, pcre
+, lzma
+, bzip2
+, zlib
+, icu
+, singledispatch
+, six
+, jinja2
+, pytest
+}:
+
+buildPythonPackage rec {
+    version = "2.8.2";
+    pname = "rpy2";
+    disabled = isPyPy;
+    src = fetchPypi {
+      inherit version pname;
+      sha256 = "0k5jp6n1lfab7a6r5568aq31hg4fgf2cwy0hzvf3chp6yhyk26ic";
+    };
+    buildInputs = [
+      readline
+      R
+      pcre
+      lzma
+      bzip2
+      zlib
+      icu
+    ];
+    propagatedBuildInputs = [
+      singledispatch
+      six
+      jinja2
+    ];
+    checkInputs = [ pytest ];
+    # Tests fail with `assert not _relpath.startswith('..'), "Path must be within the project"`
+    # in the unittest `loader.py`. I don't know what causes this.
+    doCheck = false;
+    # without this tests fail when looking for libreadline.so
+    LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
+
+    meta = {
+      homepage = http://rpy.sourceforge.net/rpy2;
+      description = "Python interface to R";
+      license = lib.licenses.gpl2Plus;
+      platforms = lib.platforms.linux;
+      maintainers = with lib.maintainers; [ joelmo ];
+    };
+  }
diff --git a/pkgs/development/python-modules/trezor/default.nix b/pkgs/development/python-modules/trezor/default.nix
index cc31939ff03..3a6b5f62e4f 100644
--- a/pkgs/development/python-modules/trezor/default.nix
+++ b/pkgs/development/python-modules/trezor/default.nix
@@ -1,5 +1,5 @@
 { lib, fetchPypi, buildPythonPackage,
-  protobuf, hidapi, ecdsa, mnemonic, requests, pyblake2, click, libusb1
+  protobuf, hidapi, ecdsa, mnemonic, requests, pyblake2, click, libusb1, rlp
 }:
 
 buildPythonPackage rec {
@@ -12,7 +12,7 @@ buildPythonPackage rec {
     sha256 = "a481191011bade98f1e9f1201e7c72a83945050657bbc90dc4ac32dc8b8b46a4";
   };
 
-  propagatedBuildInputs = [ protobuf hidapi ecdsa mnemonic requests pyblake2 click libusb1 ];
+  propagatedBuildInputs = [ protobuf hidapi ecdsa mnemonic requests pyblake2 click libusb1 rlp ];
 
   # There are no actual tests: "ImportError: No module named tests"
   doCheck = false;
diff --git a/pkgs/development/python-modules/warrant/default.nix b/pkgs/development/python-modules/warrant/default.nix
new file mode 100644
index 00000000000..ac83430fbae
--- /dev/null
+++ b/pkgs/development/python-modules/warrant/default.nix
@@ -0,0 +1,36 @@
+{ lib, buildPythonPackage, fetchFromGitHub, fetchPypi
+, mock
+, boto3, envs, python-jose, requests }:
+
+buildPythonPackage rec {
+  pname = "warrant";
+  version = "0.6.1";
+
+  # move to fetchPyPi when https://github.com/capless/warrant/issues/97 is fixed
+  src = fetchFromGitHub {
+    owner  = "capless";
+    repo   = "warrant";
+    rev    = "ff2e4793d8479e770f2461ef7cbc0c15ee784395";
+    sha256 = "0gw3crg64p1zx3k5js0wh0x5bldgs7viy4g8hld9xbka8q0374hi";
+  };
+
+  # this needs to go when 0.6.2 or later is released
+  postPatch = ''
+    substituteInPlace requirements.txt \
+      --replace "python-jose-cryptodome>=1.3.2" "python-jose>=2.0.0"
+  '';
+
+  checkInputs = [ mock ];
+
+  propagatedBuildInputs = [ boto3 envs python-jose requests ];
+
+  # all the checks are failing
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Python library for using AWS Cognito with support for SRP";
+    homepage = https://github.com/capless/warrant;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ peterhoeg ];
+  };
+}
diff --git a/pkgs/development/ruby-modules/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix
index 1f31aec886a..16f1abe1a89 100644
--- a/pkgs/development/ruby-modules/bundled-common/default.nix
+++ b/pkgs/development/ruby-modules/bundled-common/default.nix
@@ -29,7 +29,7 @@ with  import ./functions.nix { inherit lib gemConfig; };
 let
   gemFiles = bundlerFiles args;
 
-  importedGemset = if builtins.typeOf gemFiles.gemset == "path"
+  importedGemset = if builtins.typeOf gemFiles.gemset != "set"
     then import gemFiles.gemset
     else gemFiles.gemset;
 
diff --git a/pkgs/development/ruby-modules/bundler-app/default.nix b/pkgs/development/ruby-modules/bundler-app/default.nix
index 99d1dd64dc4..c8f61389ad3 100644
--- a/pkgs/development/ruby-modules/bundler-app/default.nix
+++ b/pkgs/development/ruby-modules/bundler-app/default.nix
@@ -26,12 +26,13 @@
 , allowSubstitutes ? false
 , meta ? {}
 , postBuild ? ""
+, gemConfig ? null
 }@args:
 
 let
   basicEnv = (callPackage ../bundled-common {}) args;
 
-  cmdArgs = removeAttrs args [ "pname" "postBuild" ]
+  cmdArgs = removeAttrs args [ "pname" "postBuild" "gemConfig" ]
   // { inherit preferLocalBuild allowSubstitutes; }; # pass the defaults
 in
    runCommand basicEnv.name cmdArgs ''
diff --git a/pkgs/development/tools/analysis/radare2-cutter/default.nix b/pkgs/development/tools/analysis/radare2-cutter/default.nix
index 3cd1d309e15..d1ff712be2d 100644
--- a/pkgs/development/tools/analysis/radare2-cutter/default.nix
+++ b/pkgs/development/tools/analysis/radare2-cutter/default.nix
@@ -3,35 +3,17 @@
 
 stdenv.mkDerivation rec {
   name = "radare2-cutter-${version}";
-  version = "1.1";
+  version = "1.3";
 
   src = fetchFromGitHub {
     owner = "radareorg";
     repo = "cutter";
     rev = "v${version}";
-    sha256 = "02m5sf45n455hn34y7hrqanj830rc5xhz2ppp1z3mzbz0s515pfl";
+    sha256 = "1z76yz2i9k8mxjk85k2agdj941szdbl2gi66p3dh50878zqavfrr";
   };
 
   postUnpack = "export sourceRoot=$sourceRoot/src";
 
-  patches = [
-    # Fixup version number :D
-    (fetchpatch {
-      url = "https://github.com/radareorg/cutter/commit/69506b64600df632afdca8b680baa7d946c78644.patch";
-      sha256 = "0ks3ixz8bycjcfi26bd0p6z7qaplhq00alw44hsfzpdm4bmr01x0";
-    })
-    (fetchpatch {
-      url = "https://github.com/radareorg/cutter/commit/8b52c66f4f0091cd9d97389b32aa519c2c602e2b.patch";
-      sha256 = "0wcdn35lx2943pfzm7mkg4sr82pm0qz3yxf74m8fxbd70s3w0gkm";
-    })
-
-    # case-insensitive filtering
-    (fetchpatch {
-      url = "https://github.com/radareorg/cutter/commit/0ebd34370bcaed00000168147572bb78106eeab1.patch";
-      sha256 = "0sc50jwhncfnd2i5mlyld4dbdzi2ws7nh4yglkhlap9l9h1jxn20";
-    })
-  ];
-
   patchFlags = [ "-p2" ];
 
   nativeBuildInputs = [ qmake pkgconfig ];
diff --git a/pkgs/development/tools/analysis/radare2/default.nix b/pkgs/development/tools/analysis/radare2/default.nix
index 844267b7adb..5f7b389cc2b 100644
--- a/pkgs/development/tools/analysis/radare2/default.nix
+++ b/pkgs/development/tools/analysis/radare2/default.nix
@@ -1,9 +1,10 @@
-{stdenv, fetchFromGitHub, fetchgit, fetchurl, fetchpatch, pkgconfig, libusb, readline, libewf, perl, zlib, openssl, git,
-gtk2 ? null, vte ? null, gtkdialog ? null,
-python ? null,
-ruby ? null,
-lua ? null,
-useX11, rubyBindings, pythonBindings, luaBindings}:
+{stdenv, fetchFromGitHub, pkgconfig, libusb, readline, libewf, perl, zlib, openssl
+, gtk2 ? null, vte ? null, gtkdialog ? null
+, python ? null
+, ruby ? null
+, lua ? null
+, useX11, rubyBindings, pythonBindings, luaBindings
+}:
 
 assert useX11 -> (gtk2 != null && vte != null && gtkdialog != null);
 assert rubyBindings -> ruby != null;
@@ -20,16 +21,19 @@ stdenv.mkDerivation rec {
     owner = "radare";
     repo = "radare2";
     rev = version;
-    sha256 = "08zvxgsvc6rqpjaapcxz1wm9vzlrbsqgplfkx0lch2s67v6slr7z";
+    sha256 = "07x94chkhpn3wgw4pypn35psxq370j6xwmhf1mh5z27cqkq7c2yd";
   };
 
+  # do not try to update capstone
+  WITHOUT_PULL=1;
+
   postPatch = let
     cs_tip = "4a1b580d069c82d60070d0869a87000db7cdabe2"; # version from $sourceRoot/shlr/Makefile
-    capstone = fetchgit {
-      url = "https://github.com/aquynh/capstone.git";
+    capstone = fetchFromGitHub {
+      owner = "aquynh";
+      repo = "capstone";
       rev = cs_tip;
-      sha256 = "19vfgdfykmi3cfs4x1acxy0gnwggjjc8qq46pybqvcksbi11nw1k";
-      leaveDotGit = true;
+      sha256 = "0v6rxfpxjq0hf40qn1n5m5wsv1dv6p1j8vm94a708lhvcbk9nkv8";
     };
   in ''
     if ! grep -F "CS_TIP=${cs_tip}" shlr/Makefile; then echo "CS_TIP mismatch"; exit 1; fi
@@ -39,7 +43,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  nativeBuildInputs = [ pkgconfig git ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ readline libusb libewf perl zlib openssl]
     ++ optional useX11 [gtkdialog vte gtk2]
     ++ optional rubyBindings [ruby]
diff --git a/pkgs/development/tools/build-managers/gnumake/3.82/default.nix b/pkgs/development/tools/build-managers/gnumake/3.82/default.nix
index 87897017f86..94fa7e7201a 100644
--- a/pkgs/development/tools/build-managers/gnumake/3.82/default.nix
+++ b/pkgs/development/tools/build-managers/gnumake/3.82/default.nix
@@ -33,6 +33,9 @@ stdenv.mkDerivation {
       ./construct-command-line.patch
       ./long-command-line.patch
       ./darwin-library_search-dylib.patch
+
+      # Fix support for glibc 2.27's glob
+      ../4.2/glibc-2.27-glob.patch
     ];
   patchFlags = "-p0";
 
diff --git a/pkgs/development/tools/misc/arm-frc-linux-gnueabi-binutils/default.nix b/pkgs/development/tools/misc/arm-frc-linux-gnueabi-binutils/default.nix
deleted file mode 100755
index fff91c6f7f3..00000000000
--- a/pkgs/development/tools/misc/arm-frc-linux-gnueabi-binutils/default.nix
+++ /dev/null
@@ -1,50 +0,0 @@
-{stdenv, fetchurl, glibc, bison, arm-frc-linux-gnueabi-eglibc}:
-
-stdenv.mkDerivation rec {
-  _target = "arm-frc-linux-gnueabi";
-
-  version = "2.28";
-  name = "${_target}-binutils-${version}";
-
-  src = fetchurl {
-    url = "ftp://ftp.gnu.org/gnu/binutils/binutils-${version}.tar.bz2";
-    sha256 = "369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88";
-  };
-
-  nativeBuildInputs = [ bison arm-frc-linux-gnueabi-eglibc ];
-  buildInputs = [ glibc ];
-
-  configureFlags = ''
-    --target=${_target}
-    --with-pkgversion='GNU-Binutils-for-FRC'
-    --with-sysroot=$out/${_target}
-    --with-build-sysroot=/$out/${_target}
-    --disable-multilib
-    --disable-nls
-    --enable-lto
-    --disable-libiberty-install
-    --enable-ld
-    --enable-gold=default
-    --enable-plugins
-  '';
-
-  postConfigure = ''
-    make configure-host
-  '';
-
-  postInstall = ''
-    rm -rf $out/share/info
-  '';
-
-  meta = {
-    description = "FRC binutils";
-    longDescription = ''
-      binutils used to build arm-frc-linux-gnueabi and user programs.
-    '';
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.colescott ];
-    platforms = stdenv.lib.platforms.linux;
-    broken = true; # since 2017-09-10
-    priority = 3;
-  };
-}
diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix b/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix
index b3a37e3f760..3caeabaae78 100644
--- a/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix
+++ b/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix
@@ -1,5 +1,5 @@
 { stdenv, ocaml, findlib, jbuilder, js_of_ocaml-compiler
-, camlp4
+, camlp4, ocsigen_deriving
 }:
 
 stdenv.mkDerivation rec {
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
 
 	inherit (js_of_ocaml-compiler) version src installPhase meta;
 
-	buildInputs = [ ocaml findlib jbuilder camlp4 ];
+	buildInputs = [ ocaml findlib jbuilder camlp4 ocsigen_deriving ];
 
 	buildPhase = "jbuilder build -p js_of_ocaml-camlp4";
 }
diff --git a/pkgs/development/tools/parsing/antlr/2.7.7.nix b/pkgs/development/tools/parsing/antlr/2.7.7.nix
index 23141185f68..017ef20e81c 100644
--- a/pkgs/development/tools/parsing/antlr/2.7.7.nix
+++ b/pkgs/development/tools/parsing/antlr/2.7.7.nix
@@ -19,6 +19,6 @@ stdenv.mkDerivation {
       walk parse trees.
     '';
     homepage = http://www.antlr.org/;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/rust/bindgen/default.nix b/pkgs/development/tools/rust/bindgen/default.nix
index 61adb0b73fb..2f4c89ab43b 100644
--- a/pkgs/development/tools/rust/bindgen/default.nix
+++ b/pkgs/development/tools/rust/bindgen/default.nix
@@ -4,13 +4,13 @@
 
 rustPlatform.buildRustPackage rec {
   name = "rust-bindgen-${version}";
-  version = "0.35.0";
+  version = "0.36.0";
 
   src = fetchFromGitHub {
     owner = "rust-lang-nursery";
     repo = "rust-bindgen";
     rev = "v${version}";
-    sha256 = "1qs67mkvrzwzi69rlq49p098h247197f2jiq1f4ivw9naggq5c7v";
+    sha256 = "1bpya490qh2jvq99mdlcifj6mgn3yxr0sqas6y5xw842b46g6hi6";
   };
 
   nativeBuildInputs = [ makeWrapper ];
@@ -24,7 +24,7 @@ rustPlatform.buildRustPackage rec {
     wrapProgram $out/bin/bindgen --set LIBCLANG_PATH "${llvmPackages.clang-unwrapped.lib}/lib"
   '';
 
-  cargoSha256 = "0bh22fkynn1z83230pbj0gg5k3948f6m0idzyqjyfg1f3qmnzdi6";
+  cargoSha256 = "0b8v6c7q1abibzygrigldpd31lyd5ngmj4vq5d7zni96m20mm85w";
 
   doCheck = false; # A test fails because it can't find standard headers in NixOS
 
diff --git a/pkgs/development/tools/xcbuild/platform.nix b/pkgs/development/tools/xcbuild/platform.nix
index d0836daf613..a36c4f4bf80 100644
--- a/pkgs/development/tools/xcbuild/platform.nix
+++ b/pkgs/development/tools/xcbuild/platform.nix
@@ -258,6 +258,27 @@ let
       };
       PackageTypes = [ "com.apple.package-type.wrapper.application" ];
     }
+    {
+      Type = "ProductType";
+      Identifier = "com.apple.product-type.framework";
+      Name = "Bundle";
+      DefaultBuildProperties = {
+        FULL_PRODUCT_NAME = "$(WRAPPER_NAME)";
+        MACH_O_TYPE = "mh_bundle";
+        WRAPPER_PREFIX = "";
+        WRAPPER_SUFFIX = ".$(WRAPPER_EXTENSION)";
+        WRAPPER_EXTENSION = "bundle";
+        WRAPPER_NAME = "$(WRAPPER_PREFIX)$(PRODUCT_NAME)$(WRAPPER_SUFFIX)";
+        FRAMEWORK_FLAG_PREFIX = "-framework";
+        LIBRARY_FLAG_PREFIX = "-l";
+        LIBRARY_FLAG_NOSPACE = "YES";
+        STRIP_STYLE = "non-global";
+      };
+      PackageTypes = [ "com.apple.package-type.wrapper" ];
+      IsWrapper = "YES";
+      HasInfoPlist = "YES";
+      HasInfoPlistStrings = "YES";
+    }
   ];
 
 in
diff --git a/pkgs/development/tools/xcbuild/setup-hook.sh b/pkgs/development/tools/xcbuild/setup-hook.sh
index c3b26a6ac79..70100c19697 100644
--- a/pkgs/development/tools/xcbuild/setup-hook.sh
+++ b/pkgs/development/tools/xcbuild/setup-hook.sh
@@ -5,7 +5,7 @@ xcbuildBuildPhase() {
 
     echo "running xcodebuild"
 
-    xcodebuild OTHER_CFLAGS="$NIX_CFLAGS_COMPILE" OTHER_CPLUSPLUSFLAGS="$NIX_CFLAGS_COMPILE" OTHER_LDFLAGS="$NIX_LDFLAGS" build
+    xcodebuild SYMROOT=$PWD/Products OBJROOT=$PWD/Intermediates $xcbuildFlags build
 
     runHook postBuild
 }
diff --git a/pkgs/development/tools/xcbuild/wrapper.nix b/pkgs/development/tools/xcbuild/wrapper.nix
index 3a1547440fd..06c48ec0a73 100644
--- a/pkgs/development/tools/xcbuild/wrapper.nix
+++ b/pkgs/development/tools/xcbuild/wrapper.nix
@@ -46,6 +46,9 @@ stdenv.mkDerivation {
       ln -s $file
     done
 
+    mkdir $out/usr
+    ln -s $out/bin $out/usr/bin
+
     mkdir -p $out/Library/Xcode/
     ln -s ${xcbuild}/Library/Xcode/Specifications $out/Library/Xcode/Specifications
 
diff --git a/pkgs/games/openclonk/default.nix b/pkgs/games/openclonk/default.nix
index d3fb8c7bc58..e4bcef29878 100644
--- a/pkgs/games/openclonk/default.nix
+++ b/pkgs/games/openclonk/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, cmake, gnome3, pcre, freetype, glew, gtk3, libjpeg, libpng,
-  SDL, SDL_mixer, libupnp, xorg, pkgconfig, gtest, tinyxml, gmock, readline,
-  libxkbcommon, epoxy, at-spi2-core, dbus, libxml2,
-  enableSoundtrack ? false # Enable the "Open Clonk Soundtrack - Explorers Journey" by David Oerther
+{ stdenv, fetchurl, cmake, pkgconfig
+, SDL2, libvorbis, libogg, libjpeg, libpng, freetype, glew, tinyxml, openal
+, freealut, readline, gcc-unwrapped
+, enableSoundtrack ? false # Enable the "Open Clonk Soundtrack - Explorers Journey" by David Oerther
 }:
 
 let
@@ -10,32 +10,38 @@ let
     sha256 = "1ckj0dlpp5zsnkbb5qxxfxpkiq76jj2fgj91fyf3ll7n0gbwcgw5";
   };
 in stdenv.mkDerivation rec {
-  version = "7.0";
+  version = "8.1";
   name = "openclonk-${version}";
 
   src = fetchurl {
-    url = "http://www.openclonk.org/builds/release/7.0/openclonk-${version}-src.tar.bz2";
-    sha256 = "0ch71dqaaalg744pc1gvg6sj2yp2kgvy2m4yh6l7ljkpf8fj66mw";
+    url = "http://www.openclonk.org/builds/release/8.1/openclonk-${version}-src.tar.bz2";
+    sha256 = "0imkqjp8lww5p0cnqf4k4mb2v682mnsas63qmiz17rspakr7fxik";
   };
 
   postInstall = ''
     mv -v $out/games/openclonk $out/bin/
   '' + stdenv.lib.optionalString enableSoundtrack ''
-    cp -v ${soundtrack_src} $out/share/games/openclonk/Music.ocg
+    ln -sv ${soundtrack_src} $out/share/games/openclonk/Music.ocg
   '';
 
   enableParallelBuilding = true;
 
+  nativeBuildInputs = [ cmake pkgconfig ];
+
   buildInputs = [
-    cmake gnome3.gtksourceview pcre freetype glew gtk3 libjpeg libpng SDL
-    SDL_mixer libupnp tinyxml xorg.libpthreadstubs libxkbcommon xorg.libXdmcp
-    pkgconfig gtest gmock readline epoxy at-spi2-core dbus libxml2
+    SDL2 libvorbis libogg libjpeg libpng freetype glew tinyxml openal freealut
+    readline
   ];
 
+  cmakeFlags = [ "-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar" "-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib" ];
+
+  cmakeBuildType = "RelWithDebInfo";
+
   meta = with stdenv.lib; {
     description = "Free multiplayer action game in which you control clonks, small but witty and nimble humanoid beings";
-    homepage = http://openclonk.org;
+    homepage = https://www.openclonk.org;
     license = if enableSoundtrack then licenses.unfreeRedistributable else licenses.isc;
-    platforms = platforms.all;
+    maintainers = with maintainers; [ lheckemann ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
   };
 }
diff --git a/pkgs/games/quake2/yquake2/default.nix b/pkgs/games/quake2/yquake2/default.nix
new file mode 100644
index 00000000000..bee7d7703ab
--- /dev/null
+++ b/pkgs/games/quake2/yquake2/default.nix
@@ -0,0 +1,93 @@
+{ stdenv, lib, fetchFromGitHub, buildEnv, cmake, makeWrapper
+, SDL2, libGL
+, oggSupport ? true, libogg, libvorbis
+, openalSupport ? true, openal
+, zipSupport ? true, zlib
+}:
+
+let
+  mkFlag = b: if b then "ON" else "OFF";
+
+  games = import ./games.nix { inherit stdenv lib fetchFromGitHub cmake; };
+
+  wrapper = import ./wrapper.nix { inherit stdenv lib buildEnv makeWrapper yquake2; };
+
+  yquake2 = stdenv.mkDerivation rec {
+    name = "yquake2-${version}";
+    version = "7.20";
+
+    src = fetchFromGitHub {
+      owner = "yquake2";
+      repo = "yquake2";
+      rev = "QUAKE2_${builtins.replaceStrings ["."] ["_"] version}";
+      sha256 = "1yrmn8vajab3zd0fni029s6wrvv2ljn1kyhaiw02wm1dc5yyzb2g";
+    };
+
+    enableParallelBuilding = true;
+
+    nativeBuildInputs = [ cmake ];
+
+    buildInputs = [ SDL2 libGL ]
+      ++ lib.optionals oggSupport [ libogg libvorbis ]
+      ++ lib.optional openalSupport openal
+      ++ lib.optional zipSupport zlib;
+
+    cmakeFlags = [
+      "-DCMAKE_BUILD_TYPE=Release"
+      "-DOGG_SUPPORT=${mkFlag oggSupport}"
+      "-DOPENAL_SUPPORT=${mkFlag openalSupport}"
+      "-DZIP_SUPPORT=${mkFlag zipSupport}"
+      "-DSYSTEMWIDE_SUPPORT=ON"
+    ];
+
+    preConfigure = ''
+      # Since we can't expand $out in `cmakeFlags`
+      cmakeFlags="$cmakeFlags -DSYSTEMDIR=$out/share/games/quake2"
+    '';
+
+    installPhase = ''
+      # Yamagi Quake II expects all binaries (executables and libs) to be in the
+      # same directory.
+      mkdir -p $out/bin $out/lib/yquake2 $out/share/games/quake2
+      cp -r release/* $out/lib/yquake2
+      ln -s $out/lib/yquake2/quake2 $out/bin/yquake2
+      ln -s $out/lib/yquake2/q2ded $out/bin/yq2ded
+      cp $src/stuff/yq2.cfg $out/share/games/quake2
+    '';
+
+    meta = with stdenv.lib; {
+      description = "Yamagi Quake II client";
+      homepage = "https://www.yamagi.org/quake2/";
+      license = licenses.gpl2;
+      platforms = platforms.unix;
+      maintainers = with maintainers; [ tadfisher ];
+    };
+  };
+
+in rec {
+  inherit yquake2;
+
+  yquake2-ctf = wrapper {
+    games = [ games.ctf ];
+    name = "yquake2-ctf";
+    inherit (games.ctf) description;
+  };
+
+  yquake2-ground-zero = wrapper {
+    games = [ games.ground-zero ];
+    name = "yquake2-ground-zero";
+    inherit (games.ground-zero) description;
+  };
+
+  yquake2-the-reckoning = wrapper {
+    games = [ games.the-reckoning ];
+    name = "yquake2-the-reckoning";
+    inherit (games.the-reckoning) description;
+  };
+
+  yquake2-all-games = wrapper {
+    games = lib.attrValues games;
+    name = "yquake2-all-games";
+    description = "Yamagi Quake II with all add-on games";
+  };
+}
diff --git a/pkgs/games/quake2/yquake2/games.nix b/pkgs/games/quake2/yquake2/games.nix
new file mode 100644
index 00000000000..059fb26eb9b
--- /dev/null
+++ b/pkgs/games/quake2/yquake2/games.nix
@@ -0,0 +1,59 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+let
+  games = {
+    ctf = {
+      id = "ctf";
+      version = "1.05";
+      description = "'Capture The Flag' for Yamagi Quake II";
+      sha256 = "15ihspyshls645ig0gq6bwdzvghyyysqk60g6ad3n4idb2ms52md";
+    };
+
+    ground-zero = {
+      id = "rogue";
+      version = "2.04";
+      description = "'Ground Zero' for Yamagi Quake II";
+      sha256 = "0x1maaycrxv7d3xvvk1ih2zymhvcd3jnab7g3by8qh6g5y33is5l";
+    };
+
+    the-reckoning = {
+      id = "xatrix";
+      version = "2.05";
+      description = "'The Reckoning' for Yamagi Quake II";
+      sha256 = "0gf2ryhgz8nw1mb1arlbriihjsx09fa0wmkgcayc8ijignfi1qkh";
+    };
+  };
+
+  toDrv = title: data: stdenv.mkDerivation rec {
+    inherit (data) id version description sha256;
+    inherit title;
+
+    name = "yquake2-${title}-${version}";
+
+    src = fetchFromGitHub {
+      inherit sha256;
+      owner = "yquake2";
+      repo = data.id;
+      rev = "${lib.toUpper id}_${builtins.replaceStrings ["."] ["_"] version}";
+    };
+
+    enableParallelBuilding = true;
+
+    nativeBuildInputs = [ cmake ];
+
+    installPhase = ''
+      mkdir -p $out/lib/yquake2/${id}
+      cp Release/* $out/lib/yquake2/${id}
+    '';
+
+    meta = with stdenv.lib; {
+      inherit (data) description;
+      homepage = "https://www.yamagi.org/quake2/";
+      license = licenses.unfree;
+      platforms = platforms.unix;
+      maintainers = with maintainers; [ tadfisher ];
+    };
+  };
+
+in
+  lib.mapAttrs toDrv games
diff --git a/pkgs/games/quake2/yquake2/wrapper.nix b/pkgs/games/quake2/yquake2/wrapper.nix
new file mode 100644
index 00000000000..8cd1044456a
--- /dev/null
+++ b/pkgs/games/quake2/yquake2/wrapper.nix
@@ -0,0 +1,31 @@
+{ stdenv, lib, buildEnv, makeWrapper, yquake2 }:
+
+{ games
+, name
+, description
+}:
+
+let
+  env = buildEnv {
+    name = "${name}-env";
+    paths = [ yquake2 ] ++ games;
+  };
+
+in stdenv.mkDerivation {
+  inherit name;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  buildCommand = ''
+    mkdir -p $out/bin
+  '' + lib.concatMapStringsSep "\n" (game: ''
+    makeWrapper ${env}/bin/yquake2 $out/bin/yquake2-${game.title} \
+      --add-flags "+set game ${game.id}"
+    makeWrapper ${env}/bin/yq2ded $out/bin/yq2ded-${game.title} \
+      --add-flags "+set game ${game.id}"
+  '') games;
+
+  meta = {
+    inherit description;
+  };
+}
diff --git a/pkgs/games/sgt-puzzles/default.nix b/pkgs/games/sgt-puzzles/default.nix
index a9f2aae443f..30e2bcfdf52 100644
--- a/pkgs/games/sgt-puzzles/default.nix
+++ b/pkgs/games/sgt-puzzles/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "sgt-puzzles-r${version}";
-  version = "20171029.69773d8";
+  version = "20180409.d95f476";
 
   src = fetchurl {
    url = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/puzzles-${version}.tar.gz";
-   sha256 = "0m1gaa802jyih9hcwpvb05zrzprgj6akafgvbsnq321s0sqzaxf0";
+   sha256 = "1psml0abh3i577dns440h52568ggdny2wk1hhr30815nxibbribx";
   };
 
   nativeBuildInputs = [ autoreconfHook makeWrapper pkgconfig perl wrapGAppsHook ];
diff --git a/pkgs/games/wesnoth/dev.nix b/pkgs/games/wesnoth/dev.nix
index 9fd2dc97d98..c9cd7119d8f 100644
--- a/pkgs/games/wesnoth/dev.nix
+++ b/pkgs/games/wesnoth/dev.nix
@@ -1,23 +1,23 @@
 { stdenv, fetchurl, cmake, pkgconfig, SDL2, SDL2_image, SDL2_mixer, SDL2_net, SDL2_ttf
-, pango, gettext, boost, freetype, libvorbis, fribidi, dbus, libpng, pcre, openssl
+, pango, gettext, boost, freetype, libvorbis, fribidi, dbus, libpng, pcre, openssl, icu
 , enableTools ? false
 }:
 
 stdenv.mkDerivation rec {
   pname = "wesnoth";
-  version = "1.13.11";
+  version = "1.13.13";
 
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/sourceforge/${pname}/${name}.tar.bz2";
-    sha256 = "168732lmdnskca9hrkmaz4mi0bssc5ppklln10s306cbsl93bd39";
+    sha256 = "1jn3gvw0x8ndwvdm4bqpki1p1cxg2ij02s6w0frhfi4kz706al0c";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
 
   buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net SDL2_ttf pango gettext boost
-                  libvorbis fribidi dbus libpng pcre openssl ];
+                  libvorbis fribidi dbus libpng pcre openssl icu ];
 
   cmakeFlags = [ "-DENABLE_TOOLS=${if enableTools then "ON" else "OFF"}" ];
 
diff --git a/pkgs/misc/drivers/gutenprint/default.nix b/pkgs/misc/drivers/gutenprint/default.nix
index 3a46414512c..7c8750905d9 100644
--- a/pkgs/misc/drivers/gutenprint/default.nix
+++ b/pkgs/misc/drivers/gutenprint/default.nix
@@ -6,11 +6,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gutenprint-5.2.13";
+  name = "gutenprint-5.2.14";
 
   src = fetchurl {
     url = "mirror://sourceforge/gimp-print/${name}.tar.bz2";
-    sha256 = "0hi7s0y59306p4kp06sankfa57k2805khbknkvl9d036hdfp9afr";
+    sha256 = "1293x19gw1b742id7c7bz5giv3vlxaqpmbdz2g0n99wny5k0ggs5";
   };
 
   nativeBuildInputs = [ makeWrapper pkgconfig ];
diff --git a/pkgs/misc/emulators/wine/sources.nix b/pkgs/misc/emulators/wine/sources.nix
index 663da1eb114..f86e34a5d54 100644
--- a/pkgs/misc/emulators/wine/sources.nix
+++ b/pkgs/misc/emulators/wine/sources.nix
@@ -62,5 +62,4 @@ in rec {
     repo = "winetricks";
     rev = version;
   };
-
 }
diff --git a/pkgs/misc/screensavers/i3lock-pixeled/default.nix b/pkgs/misc/screensavers/i3lock-pixeled/default.nix
index 7cb3e68dec8..5fff7b8f0ea 100644
--- a/pkgs/misc/screensavers/i3lock-pixeled/default.nix
+++ b/pkgs/misc/screensavers/i3lock-pixeled/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "i3lock-pixeled-${version}";
-  version = "1.1.0";
+  version = "1.2.0";
 
   src = fetchurl {
     url = "https://github.com/Ma27/i3lock-pixeled/archive/${version}.tar.gz";
-    sha256 = "046qbx4qvcc66h53h4mm9pyjj9gjc6dzy38a0f0jc5a84xbivh7k";
+    sha256 = "0vlynm833fk1mmdnkcgh4hwqmfypn22zskhysm110k39zvikif0h";
   };
 
   propagatedBuildInputs = with pkgs; [
diff --git a/pkgs/misc/themes/gtk3/numix-solarized-gtk-theme/default.nix b/pkgs/misc/themes/numix-solarized/default.nix
index 4ede14d3bb3..3c81e4308ca 100644
--- a/pkgs/misc/themes/gtk3/numix-solarized-gtk-theme/default.nix
+++ b/pkgs/misc/themes/numix-solarized/default.nix
@@ -1,26 +1,40 @@
-{ stdenv, fetchFromGitHub, sass, glib, gdk_pixbuf }:
+{ stdenv, fetchFromGitHub, python3, sass, glib, gdk_pixbuf, libxml2,
+  inkscape, optipng, gtk-engine-murrine
+}:
 
 stdenv.mkDerivation rec {
-  version = "20160919";
+  version = "20170810";
   name = "numix-solarized-gtk-theme-${version}";
 
   src = fetchFromGitHub {
     owner = "Ferdi265";
     repo = "numix-solarized-gtk-theme";
     rev = version;
-    sha256 = "0243w918ycmf9vnkzfvwnrxz9zc6xxk7167h8ywxj901pqy59kad";
+    sha256 = "0l4xvsiyg15kp6xwpvm3jckxyhr1lxd678lkhrcyf40n7rd4xinl";
   };
 
+  nativeBuildInputs = [ python3 sass glib gdk_pixbuf libxml2 inkscape optipng ];
+
+  propagatedUserEnvPkgs = [ gtk-engine-murrine ];
+
   postPatch = ''
-    substituteInPlace Makefile --replace \
-      'INSTALL_DIR=$(DESTDIR)/usr/share/themes' "INSTALL_DIR=$out/share/themes"
     patchShebangs .
+    substituteInPlace Makefile --replace '$(DESTDIR)'/usr $out
+    substituteInPlace scripts/render-assets.sh \
+      --replace /usr/bin/inkscape ${inkscape}/bin/inkscape \
+      --replace /usr/bin/optipng ${optipng}/bin/optipng
   '';
 
-  buildInputs = [sass glib gdk_pixbuf];
+  buildPhase = "true";
+
+  installPhase = ''
+    for theme in *.colors; do
+      make THEME="''${theme/.colors/}" install
+    done
+  '';
 
   meta = with stdenv.lib; {
-    description = "GTK3.20-compatible version of bitterologist's Numix Solarized from deviantart";
+    description = "Solarized versions of Numix GTK2 and GTK3 theme";
     longDescription = ''
       This is a fork of the Numix GTK theme that replaces the colors of the theme
       and icons to use the solarized theme with a solarized green accent color.
@@ -29,7 +43,7 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/Ferdi265/numix-solarized-gtk-theme;
     downloadPage = https://github.com/Ferdi265/numix-solarized-gtk-theme/releases;
     license = licenses.gpl3;
-    maintainers = [ maintainers.offline ];
     platforms = platforms.linux;
+    maintainers = [ maintainers.offline ];
   };
 }
diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix
index 3e8c6e9b257..a06b090bb6d 100644
--- a/pkgs/misc/vim-plugins/default.nix
+++ b/pkgs/misc/vim-plugins/default.nix
@@ -54,6 +54,7 @@ rec {
   # aliasess
   airline             = vim-airline;
   alternative         = a-vim; # backwards compat, added 2014-10-21
+  bats                = bats-vim;
   calendar            = calendar-vim;
   coffee-script       = vim-coffee-script;
   coffeeScript        = coffee-script; # backwards compat, added 2014-10-18
@@ -1500,6 +1501,17 @@ rec {
     postInstall = false;
   };
 
+  julia-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "julia-vim-2018-03-27";
+    src = fetchgit {
+      url = "https://github.com/JuliaEditorSupport/julia-vim";
+      rev = "4593c8b1ffe20022677e524487c8554d96cf8f84";
+      sha256 = "0yrdzkxyg6cg2i4bd6bqbq0w63hssh3nd0f0qnfl7v5pkq9yba4w";
+    };
+    dependencies = [];
+
+  };
+
   fzf-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "fzf-vim-2018-03-09";
     src = fetchgit {
@@ -3035,6 +3047,17 @@ rec {
 
   };
 
+  bats-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
+    name = "bats-vim-2013-07-03";
+    src = fetchgit {
+      url = "https://github.com/vim-scripts/bats.vim";
+      rev = "3c283f594ff8bc7fb0c25cd07ebef0f17385f94a";
+      sha256 = "06f3hdf7y5gpwmc6inrhk938qmn7cr6mbk00amrnl1qjvk09givx";
+    };
+    dependencies = [];
+
+  };
+
   changeColorScheme-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
     name = "changeColorScheme-vim-2010-10-17";
     src = fetchgit {
diff --git a/pkgs/misc/vim-plugins/vim-plugin-names b/pkgs/misc/vim-plugins/vim-plugin-names
index 42de002d1ea..fcc4fcaa76f 100644
--- a/pkgs/misc/vim-plugins/vim-plugin-names
+++ b/pkgs/misc/vim-plugins/vim-plugin-names
@@ -87,6 +87,7 @@
 "github:jnurmine/zenburn"
 "github:jonbri/vim-colorstepper"
 "github:joonty/vim-xdebug"
+"github:JuliaEditorSupport/julia-vim"
 "github:junegunn/fzf.vim"
 "github:junegunn/goyo.vim"
 "github:junegunn/limelight.vim"
@@ -246,6 +247,7 @@
 "github:vim-scripts/align"
 "github:vim-scripts/argtextobj.vim"
 "github:vim-scripts/a.vim"
+"github:vim-scripts/bats.vim"
 "github:vim-scripts/changeColorScheme.vim"
 "github:vim-scripts/Colour-Sampler-Pack"
 "github:vim-scripts/Improved-AnsiEsc"
diff --git a/pkgs/os-specific/darwin/CoreSymbolication/default.nix b/pkgs/os-specific/darwin/CoreSymbolication/default.nix
new file mode 100644
index 00000000000..aa73c7f86c4
--- /dev/null
+++ b/pkgs/os-specific/darwin/CoreSymbolication/default.nix
@@ -0,0 +1,19 @@
+{ fetchFromGitHub, stdenv }:
+
+# Reverse engineered CoreSymbolication to make dtrace buildable
+
+stdenv.mkDerivation rec {
+  name = "CoreSymbolication";
+
+  src = fetchFromGitHub {
+    repo = name;
+    owner = "matthewbauer";
+    rev = "671fcb66c82eac1827f3f53dc4cc4e9b1b94da0a";
+    sha256 = "0qpw46gwgjxiwqqjxksb8yghp2q8dwad6hzaf4zl82xpvk9n5ahj";
+  };
+
+  installPhase = ''
+    mkdir -p $out/include
+    cp -r CoreSymbolication $out/include
+  '';
+}
diff --git a/pkgs/os-specific/darwin/apple-source-releases/SmartCardServices/default.nix b/pkgs/os-specific/darwin/apple-source-releases/SmartCardServices/default.nix
new file mode 100644
index 00000000000..1cb85b1e988
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/SmartCardServices/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, appleDerivation, xcbuild, gnumake, Security
+, libsecurity_utilities, libsecurity_cdsa_utilities }:
+
+appleDerivation {
+  buildInputs = [ xcbuild libsecurity_utilities libsecurity_cdsa_utilities ];
+
+  DSTROOT = "$out";
+
+  NIX_CFLAGS_COMPILE = "-I.";
+  preBuild = ''
+    mkdir -p Security
+    cp ${Security}/Library/Frameworks/Security.framework/Headers/*.h Security
+  '';
+
+  patchPhase = ''
+    substituteInPlace SmartCardServices.xcodeproj/project.pbxproj \
+      --replace "/usr/bin/gnumake" "${gnumake}/bin/make"
+    substituteInPlace src/PCSC/PCSC.exp \
+      --replace _PCSCVersionString "" \
+      --replace _PCSCVersionNumber ""
+    substituteInPlace Makefile.installPhase \
+      --replace chown "# chown" \
+      --replace /usr/bin/ ""
+  '';
+
+  installPhase = ''
+    make -f Makefile.installPhase install
+    make -f Makefile-exec.installPhase install
+    mv $out/usr/* $out
+    rmdir $out/usr
+
+    mkdir -p $out/Library/Frameworks
+    cp -r Products/Release/PCSC.bundle $out/Library/Frameworks/PCSC.framework
+  '';
+
+  meta = with stdenv.lib; {
+    maintainers = with maintainers; [ matthewbauer ];
+    platforms   = platforms.darwin;
+    license     = licenses.apsl20;
+  };
+}
diff --git a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix
index a3d4099399b..dcfb4aefe1f 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix
@@ -27,14 +27,14 @@ appleDerivation {
                 | grep -v -e Desktop -e Embedded -e mklocale -e colldef)
 
     for i in $targets; do
-      xcodebuild -target $i
+      xcodebuild SYMROOT=$PWD/Products OBJROOT=$PWD/Intermediates -target $i
     done
   '';
 
   # temporary install phase until xcodebuild has "install" support
   installPhase = ''
     mkdir -p $out/bin/
-    install adv_cmds-*/Build/Products/Release/* $out/bin/
+    install Products/Release/* $out/bin/
 
     for n in 1 8; do
       mkdir -p $out/share/man/man$n
diff --git a/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix
index 9e8b78e57d6..b52ec3306dc 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/basic_cmds/default.nix
@@ -14,7 +14,7 @@ appleDerivation rec {
   # temporary install phase until xcodebuild has "install" support
   installPhase = ''
     mkdir -p $out/bin/
-    install basic_cmds-*/Build/Products/Release/* $out/bin/
+    install Products/Release/* $out/bin/
 
     for n in 1; do
       mkdir -p $out/share/man/man$n
diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix
index cca729016c2..3120d8ae3d1 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix
@@ -7,6 +7,7 @@ let
   # now it's staying here.
   versions = {
     "osx-10.11.6" = {
+      SmartCardServices = "55111";
       dtrace        = "168";
       xnu           = "3248.60.10";
       libpthread    = "138.10.4";
@@ -43,6 +44,9 @@ let
       file_cmds     = "264.1.1";
       shell_cmds    = "187";
       system_cmds   = "550.6";
+      diskdev_cmds   = "593";
+      top           = "108";
+      text_cmds     = "99";
     };
     "osx-10.11.5" = {
       Libc          = "1082.50.1"; # 10.11.6 still unreleased :/
@@ -53,6 +57,7 @@ let
       ICU           = "531.48";
       libdispatch   = "442.1.4";
       Security      = "57031.40.6";
+      security_systemkeychain = "55202";
 
       IOAudioFamily                        = "203.3";
       IOFireWireFamily                     = "458";
@@ -191,6 +196,8 @@ let
   adv_cmds = applePackage "adv_cmds" "osx-10.5.8" "102ssayxbg9wb35mdmhswbnw0bg7js3pfd8fcbic83c5q3bqa6c6" {};
 
   packages = {
+    SmartCardServices = applePackage "SmartCardServices" "osx-10.11.6" "1qqjlbi6j37mw9p3qpfnwf14xh9ff8h5786bmvzwc4kblfglabkm" {};
+
     inherit (adv_cmds) ps locale;
     architecture    = applePackage "architecture"      "osx-10.11.6"     "1pbpjcd7is69hn8y29i98ci0byik826if8gnp824ha92h90w0fq3" {};
     bootstrap_cmds  = applePackage "bootstrap_cmds"    "dev-tools-7.0"   "1v5dv2q3af1xwj5kz0a5g54fd5dm6j4c9dd2g66n4kc44ixyrhp3" {};
@@ -201,7 +208,8 @@ let
     configd         = applePackage "configd"           "osx-10.8.5"      "1gxakahk8gallf16xmhxhprdxkh3prrmzxnmxfvj0slr0939mmr2" {};
     copyfile        = applePackage "copyfile"          "osx-10.11.6"     "1rkf3iaxmjz5ycgrmf0g971kh90jb2z1zqxg5vlqz001s4y457gs" {};
     Csu             = applePackage "Csu"               "osx-10.11.6"     "0yh5mslyx28xzpv8qww14infkylvc1ssi57imhi471fs91sisagj" {};
-    dtrace          = applePackage "dtrace"            "osx-10.11.6"     "0pp5x8dgvzmg9vvg32hpy2brm17dpmbwrcr4prsmdmfvd4767wc0" {};
+    dtrace          = applePackage "dtrace"            "osx-10.11.6"     "04mi0jy8gy0w59rk9i9dqznysv6fzz1v5mq779s41cp308yi0h1c" {};
+    dtrace-xcode    = applePackage "dtrace/xcode.nix"  "osx-10.11.6"     "04mi0jy8gy0w59rk9i9dqznysv6fzz1v5mq779s41cp308yi0h1c" {};
     dyld            = applePackage "dyld"              "osx-10.11.6"     "0qkjmjazm2zpgvwqizhandybr9cm3gz9pckx8rmf0py03faafc08" {};
     eap8021x        = applePackage "eap8021x"          "osx-10.11.6"     "0iw0qdib59hihyx2275rwq507bq2a06gaj8db4a8z1rkaj1frskh" {};
     ICU             = applePackage "ICU"               "osx-10.10.5"     "1qihlp42n5g4dl0sn0f9pc0bkxy1452dxzf0vr6y5gqpshlzy03p" {};
@@ -238,10 +246,15 @@ let
     adv_cmds        = applePackage "adv_cmds/xcode.nix" "osx-10.11.6"    "12gbv35i09aij9g90p6b3x2f3ramw43qcb2gjrg8lzkzmwvcyw9q" {};
     basic_cmds      = applePackage "basic_cmds"        "osx-10.11.6"     "0hvab4b1v5q2x134hdkal0rmz5gsdqyki1vb0dbw4py1bqf0yaw9" {};
     developer_cmds  = applePackage "developer_cmds"    "osx-10.11.6"     "1r9c2b6dcl22diqf90x58psvz797d3lxh4r2wppr7lldgbgn24di" {};
+    diskdev_cmds    = applePackage "diskdev_cmds"      "osx-10.11.6"     "1ssdyiaq5m1zfy96yy38yyknp682ki6bvabdqd5z18fa0rv3m2ar" {};
     network_cmds    = applePackage "network_cmds"      "osx-10.11.6"     "0lhi9wz84qr1r2ab3fb4nvmdg9gxn817n5ldg7zw9gnf3wwn42kw" {};
     file_cmds       = applePackage "file_cmds"         "osx-10.11.6"     "1zfxbmasps529pnfdjvc13p7ws2cfx8pidkplypkswyff0nff4wp" {};
     shell_cmds      = applePackage "shell_cmds"        "osx-10.11.6"     "0084k271v66h4jqp7q7rmjvv7w4mvhx3aq860qs8jbd30canm86n" {};
     system_cmds     = applePackage "system_cmds"       "osx-10.11.6"     "1h46j2c5v02pkv5d9fyv6cpgyg0lczvwicrx6r9s210cl03l77jl" {};
+    text_cmds       = applePackage "text_cmds"         "osx-10.11.6"     "1f93m7dd0ghqb2hwh905mjhzblyfr7dwffw98xhgmv1mfdnigxg0" {};
+    top             = applePackage "top"               "osx-10.11.6"     "0i9120rfwapgwdvjbfg0ya143i29s1m8zbddsxh39pdc59xnsg5l" {};
+
+    security_systemkeychain = applePackage "security_systemkeychain" "osx-10.10.5" "0xviskdgxsail15npi0billyiysvljlmg38mmhnr7qi4ymnnjr90" {};
 
     libsecurity_apple_csp      = libsecPackage "libsecurity_apple_csp"      "osx-10.7.5" "1ngyn1ik27n4x981px3kfd1z1n8zx7r5w812b6qfjpy5nw4h746w" {};
     libsecurity_apple_cspdl    = libsecPackage "libsecurity_apple_cspdl"    "osx-10.7.5" "1svqa5fhw7p7njzf8bzg7zgc5776aqjhdbnlhpwmr5hmz5i0x8r7" {};
diff --git a/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix
index 67fbf83496e..1f35e3008b3 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/developer_cmds/default.nix
@@ -11,7 +11,7 @@ appleDerivation rec {
   # temporary install phase until xcodebuild has "install" support
   installPhase = ''
     mkdir -p $out/bin/
-    install developer_cmds-*/Build/Products/Release/* $out/bin/
+    install Products/Release/* $out/bin/
 
     for n in 1; do
       mkdir -p $out/share/man/man$n
diff --git a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix
new file mode 100644
index 00000000000..aba2472af60
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, appleDerivation, xcbuild, lib, hostPlatform, Libc, xnu, libutil-new }:
+
+appleDerivation {
+  buildInputs = [ xcbuild libutil-new ];
+
+  NIX_CFLAGS_COMPILE = "-I.";
+  NIX_LDFLAGS = "-lutil";
+  patchPhase = ''
+    # ugly hacks for missing headers
+    # most are bsd related - probably should make this a drv
+    unpackFile ${Libc.src}
+    unpackFile ${xnu.src}
+    mkdir System sys machine i386
+    cp xnu-*/bsd/sys/disklabel.h sys
+    cp xnu-*/bsd/machine/disklabel.h machine
+    cp xnu-*/bsd/i386/disklabel.h i386
+    cp -r xnu-*/bsd/sys System
+    cp -r Libc-*/uuid System
+  '';
+  installPhase = ''
+    install -D Products/Release/libdisk.a $out/lib/libdisk.a
+    rm Products/Release/libdisk.a
+    for bin in Products/Release/*; do
+      install -D $bin $out/bin/$(basename $bin)
+    done
+  '';
+
+  meta = {
+    platforms = stdenv.lib.platforms.darwin;
+    maintainers = with stdenv.lib.maintainers; [ matthewbauer ];
+  };
+}
diff --git a/pkgs/os-specific/darwin/apple-source-releases/dtrace/xcode.nix b/pkgs/os-specific/darwin/apple-source-releases/dtrace/xcode.nix
new file mode 100644
index 00000000000..dd193f2c07d
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/dtrace/xcode.nix
@@ -0,0 +1,45 @@
+{ appleDerivation, xcbuild, CoreSymbolication, xnu, bison, flex, darling, stdenv }:
+
+appleDerivation {
+  buildInputs = [ xcbuild CoreSymbolication xnu bison flex darling ];
+  NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers";
+  NIX_LDFLAGS = "-L./Products/Release";
+  xcbuildFlags = "-target dtrace";
+
+  patchPhase = ''
+    substituteInPlace dtrace.xcodeproj/project.pbxproj --replace "/usr/sbin" ""
+    substituteInPlace libdtrace/dt_open.c \
+      --replace "/usr/bin/clang" "${stdenv.cc}/bin/cpp" \
+      --replace "/usr/bin/ld" "${stdenv.cc}/bin/ld" \
+      --replace "/usr/bin/dtrace" $out/lib/dtrace
+  '';
+
+  # hack to handle xcbuild's broken lex handling
+  preBuild = ''
+    cd libdtrace
+    yacc -d dt_grammar.y
+    flex -l -d dt_lex.l
+    cd ..
+
+    substituteInPlace dtrace.xcodeproj/project.pbxproj \
+      --replace '6EBC9800099BFBBF0001019C /* dt_grammar.y */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.yacc; name = dt_grammar.y; path = libdtrace/dt_grammar.y; sourceTree = "<group>"; };' '6EBC9800099BFBBF0001019C /* y.tab.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = y.tab.c; path = libdtrace/y.tab.c; sourceTree = "<group>"; };' \
+      --replace '6EBC9808099BFBBF0001019C /* dt_lex.l */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.lex; name = dt_lex.l; path = libdtrace/dt_lex.l; sourceTree = "<group>"; };' '6EBC9808099BFBBF0001019C /* lex.yy.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lex.yy.c; path = libdtrace/lex.yy.c; sourceTree = "<group>"; };'
+  '';
+
+  # xcbuild doesn't support install
+  installPhase = ''
+    mkdir -p $out
+
+    cp -r Products/Release/usr $out
+    mv $out/usr/* $out
+    rmdir $out/usr
+
+    mkdir $out/lib
+    cp Products/Release/*.dylib $out/lib
+
+    mkdir $out/bin
+    cp Products/Release/dtrace $out/bin
+
+    mkdir -p $out/lib/dtrace
+  '';
+}
diff --git a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix
index 8346ca7a9a7..47a587966b4 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix
@@ -19,7 +19,7 @@ appleDerivation rec {
   # temporary install phase until xcodebuild has "install" support
   installPhase = ''
     mkdir -p $out/bin/
-    install file_cmds-*/Build/Products/Release/* $out/bin
+    install Products/Release/* $out/bin
 
     for n in 1; do
       mkdir -p $out/share/man/man$n
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_x509_tp/GNUmakefile b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_x509_tp/GNUmakefile
index 083a8a85d17..166b4e631c8 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_x509_tp/GNUmakefile
+++ b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_x509_tp/GNUmakefile
@@ -5,6 +5,7 @@ LIBRARY_NAME = security_apple_x509_tp
 security_apple_x509_tp_HEADER_FILES = $(notdir $(wildcard lib/*.h))
 security_apple_x509_tp_HEADER_FILES_DIR = lib
 
+security_apple_x509_tp_C_FILES = $(wildcard lib/*.c)
 security_apple_x509_tp_CC_FILES = $(wildcard lib/*.cpp)
 
 include $(GNUSTEP_MAKEFILES)/library.make
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_codesigning/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_codesigning/default.nix
index c5ba9cc8d7e..2a05855bd52 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_codesigning/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_codesigning/default.nix
@@ -1,7 +1,33 @@
-{ appleDerivation, libsecurity_cdsa_utilities, libsecurity_utilities }:
+{ appleDerivation, libsecurity_cdsa_utilities, libsecurity_utilities
+, Security, xnu, xar, antlr, libsecurityd, apple_sdk
+, dtrace-xcode, osx_private_sdk }:
 appleDerivation {
-  buildInputs = [
-    libsecurity_utilities
-    libsecurity_cdsa_utilities
-  ];
-}
\ No newline at end of file
+  buildInputs = [ libsecurity_utilities libsecurity_cdsa_utilities dtrace-xcode
+                  Security xar antlr libsecurityd ];
+  NIX_CFLAGS_COMPILE = "-Iinclude -I${xnu}/Library/Frameworks/System.framework/Headers";
+  patchPhase = ''
+    substituteInPlace lib/policydb.cpp \
+      --replace "new MutableDictionary::MutableDictionary()" NULL
+    substituteInPlace lib/xpcengine.h \
+      --replace "#include <xpc/private.h>" ""
+    substituteInPlace lib/policyengine.cpp \
+      --replace "#include <OpenScriptingUtilPriv.h>" ""
+
+    rm lib/policyengine.cpp lib/quarantine++.cpp lib/codedirectory.cpp lib/xpcengine.cpp
+  '';
+  preBuild = ''
+    mkdir -p include
+    cp ${osx_private_sdk.src}/PrivateSDK10.10.sparse.sdk/usr/include/quarantine.h include
+    mkdir -p include/CoreServices/
+    cp ${osx_private_sdk.src}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/CoreServices.framework/PrivateHeaders/*.h include/CoreServices/
+
+    unpackFile ${Security.src}
+    mkdir -p include/securityd_client
+    cp Security-*/libsecurityd/lib/*.h include/securityd_client
+    mkdir -p include/xpc
+    cp ${apple_sdk.sdk}/include/xpc/*.h include/xpc
+
+    sed -i '1i #define bool int' lib/security_codesigning.d
+    dtrace -h -C -s lib/security_codesigning.d -o codesigning_dtrace.h
+  '';
+}
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix
index bb55fd48d8b..e811c4c11a8 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix
@@ -4,9 +4,12 @@ appleDerivation {
     libauto
     libobjc
     IOKit
+  ];
+  propagatedBuildInputs = [
     sqlite
     apple_sdk.frameworks.PCSC
   ];
+  NIX_LDFLAGS = "-framework PCSC";
   patchPhase = ''
     substituteInPlace lib/errors.h --replace \
       '<CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h>' \
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix b/pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix
index 860a74f61f7..7facea2b893 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix
@@ -4,22 +4,18 @@
 appleDerivation {
   buildInputs = [ xcbuild ];
 
-  dontUseXcbuild = true;
-
   prePatch = ''
     substituteInPlace tzlink.c \
       --replace '#include <xpc/xpc.h>' ""
   '';
 
-  buildPhase = ''
-    xcodebuild -target util
-  '';
+  xcbuildFlags = "-target util";
 
   installPhase = ''
     mkdir -p $out/lib $out/include
 
-    cp libutil-*/Build/Products/Release/*.dylib $out/lib
-    cp libutil-*/Build/Products/Release/*.h $out/include
+    cp Products/Release/*.dylib $out/lib
+    cp Products/Release/*.h $out/include
 
     # TODO: figure out how to get this to be right the first time around
     install_name_tool -id $out/lib/libutil.dylib $out/lib/libutil.dylib
diff --git a/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix
index dc7edface9a..23777c94157 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/network_cmds/default.nix
@@ -19,7 +19,7 @@ appleDerivation rec {
   # temporary install phase until xcodebuild has "install" support
   installPhase = ''
     mkdir -p $out/bin/
-    install network_cmds-*/Build/Products/Release/* $out/bin/
+    install Products/Release/* $out/bin/
 
     for n in 1 5; do
       mkdir -p $out/share/man/man$n
diff --git a/pkgs/os-specific/darwin/apple-source-releases/security_systemkeychain/default.nix b/pkgs/os-specific/darwin/apple-source-releases/security_systemkeychain/default.nix
new file mode 100644
index 00000000000..1a0208ef3a0
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/security_systemkeychain/default.nix
@@ -0,0 +1,31 @@
+{ appleDerivation, xcbuild, Security
+, libsecurity_codesigning, libsecurity_utilities, libsecurity_cdsa_utilities
+, xnu, osx_private_sdk, pcsclite}:
+
+appleDerivation {
+  buildInputs = [ xcbuild Security libsecurity_utilities
+                  libsecurity_cdsa_utilities libsecurity_codesigning
+                  pcsclite ];
+
+  NIX_LDFLAGS = "-lpcsclite";
+
+  # can't build the whole thing
+  xcbuildFlags = "-target codesign";
+
+  preBuild = ''
+    mkdir -p include/Security
+    cp ${osx_private_sdk.src}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/Security.framework/PrivateHeaders/*.h include/Security
+    cp ${osx_private_sdk.src}/PrivateSDK10.10.sparse.sdk/System/Library/Frameworks/Security.framework/Headers/*.h include/Security
+
+    unpackFile ${xnu.src}
+    mkdir -p include/sys
+    cp -r xnu-*/bsd/sys/codesign.h include/sys/codesign.h
+  '';
+
+  NIX_CFLAGS_COMPILE = "-Iinclude";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp Products/Release/codesign $out/bin/codesign
+  '';
+}
diff --git a/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/default.nix
index 4f527acc950..8ce916feb38 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/shell_cmds/default.nix
@@ -29,7 +29,7 @@ appleDerivation rec {
   # temporary install phase until xcodebuild has "install" support
   installPhase = ''
     mkdir -p $out/usr/bin
-    install shell_cmds-*/Build/Products/Release/* $out/usr/bin
+    install Products/Release/* $out/usr/bin
 
     export DSTROOT=$out
     export SRCROOT=$PWD
diff --git a/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix
new file mode 100644
index 00000000000..196276b0b27
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, appleDerivation, fetchurl, xcbuild, ncurses, bzip2, zlib, lzma }:
+
+appleDerivation {
+  buildInputs = [ xcbuild ncurses bzip2 zlib lzma ];
+
+  # patches to use ncursees
+  # disables md5
+  patchPhase = ''
+    substituteInPlace text_cmds.xcodeproj/project.pbxproj \
+		  --replace 'FC6C98FB149A94EB00DDCC47 /* libcurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurses.dylib; path = /usr/lib/libcurses.dylib; sourceTree = "<absolute>"; };' 'FC6C98FB149A94EB00DDCC47 /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = /usr/lib/libncurses.dylib; sourceTree = "<absolute>"; };' \
+      --replace 'FC7A7EB5149875E00086576A /* PBXTargetDependency */,' ""
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    for f in Products/Release/*; do
+      install -D $f $out/bin/$(basename $f)
+    done
+  '';
+
+  meta = {
+    platforms = stdenv.lib.platforms.darwin;
+    maintainers = with stdenv.lib.maintainers; [ matthewbauer ];
+  };
+}
diff --git a/pkgs/os-specific/darwin/apple-source-releases/top/default.nix b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix
new file mode 100644
index 00000000000..4ddec2a30c9
--- /dev/null
+++ b/pkgs/os-specific/darwin/apple-source-releases/top/default.nix
@@ -0,0 +1,15 @@
+{xcbuild, appleDerivation, apple_sdk, ncurses, libutil-new, lib}:
+
+appleDerivation {
+  buildInputs = [ xcbuild apple_sdk.frameworks.IOKit ncurses libutil-new ];
+  NIX_LDFLAGS = "-lutil";
+  installPhase = ''
+    install -D Products/Release/libtop.a $out/lib/libtop.a
+    install -D Products/Release/libtop.h $out/include/libtop.h
+    install -D Products/Release/top $out/bin/top
+  '';
+  meta = {
+    platforms = lib.platforms.darwin;
+    maintainers = with lib.maintainers; [ matthewbauer ];
+  };
+}
diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix
index bcca11d66b1..55995c1592d 100644
--- a/pkgs/os-specific/darwin/cctools/port.nix
+++ b/pkgs/os-specific/darwin/cctools/port.nix
@@ -2,6 +2,7 @@
 , llvm, libcxx, libcxxabi, clang, libuuid
 , libobjc ? null, maloader ? null, xctoolchain ? null
 , hostPlatform, targetPlatform
+, enableDumpNormalizedLibArgs ? false
 }:
 
 let
@@ -12,8 +13,6 @@ let
     "${targetPlatform.config}-";
 in
 
-assert targetPlatform.isDarwin;
-
 # Non-Darwin alternatives
 assert (!hostPlatform.isDarwin) -> (maloader != null && xctoolchain != null);
 
@@ -22,12 +21,18 @@ let
     name = "${targetPrefix}cctools-port-${version}";
     version = "895";
 
-    src = fetchFromGitHub {
+    src = fetchFromGitHub (if enableDumpNormalizedLibArgs then {
+      owner  = "tpoechtrager";
+      repo   = "cctools-port";
+      # master with https://github.com/tpoechtrager/cctools-port/pull/34
+      rev    = "8395d4b2c3350356e2fb02f5e04f4f463c7388df";
+      sha256 = "10vbf1cfzx02q8chc77s84fp2kydjpx2y682mr6mrbb7sq5rwh8f";
+    } else {
       owner  = "tpoechtrager";
       repo   = "cctools-port";
       rev    = "2e569d765440b8cd6414a695637617521aa2375b"; # From branch 895-ld64-274.2
       sha256 = "0l45mvyags56jfi24rawms8j2ihbc45mq7v13pkrrwppghqrdn52";
-    };
+    });
 
     outputs = [ "out" "dev" ];
 
@@ -117,6 +122,7 @@ let
     };
 
     meta = {
+      broken = !targetPlatform.isDarwin; # Only supports darwin targets
       homepage = http://www.opensource.apple.com/source/cctools/;
       description = "MacOS Compiler Tools (cross-platform port)";
       license = stdenv.lib.licenses.apsl20;
diff --git a/pkgs/os-specific/darwin/darling/default.nix b/pkgs/os-specific/darwin/darling/default.nix
new file mode 100644
index 00000000000..de06c176d1d
--- /dev/null
+++ b/pkgs/os-specific/darwin/darling/default.nix
@@ -0,0 +1,34 @@
+{stdenv, lib, fetchFromGitHub, cmake, bison, flex}:
+
+stdenv.mkDerivation rec {
+  pname = "darling";
+  name = pname;
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "darlinghq";
+    rev = "d2cc5fa748003aaa70ad4180fff0a9a85dc65e9b";
+    sha256 = "1sdl0ysa3yfdvkq0x7vkdl64g7mcfy3qx70saf1d8rnhycbxjgjg";
+  };
+
+  # only packaging sandbox for now
+  buildPhase = ''
+    cc -c src/sandbox/sandbox.c -o src/sandbox/sandbox.o
+    cc -dynamiclib -flat_namespace src/sandbox/sandbox.o -o libsystem_sandbox.dylib
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib
+    cp -rL src/sandbox/include/ $out/
+    cp libsystem_sandbox.dylib $out/lib/
+  '';
+
+  # buildInputs = [ cmake bison flex ];
+
+  meta = with lib; {
+    maintainers = with maintainers; [ matthewbauer ];
+    license = licenses.gpl3;
+    description = "Darwin/macOS emulation layer for Linux";
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/os-specific/darwin/maloader/default.nix b/pkgs/os-specific/darwin/maloader/default.nix
index 5f4306ec0c1..133266ec95a 100644
--- a/pkgs/os-specific/darwin/maloader/default.nix
+++ b/pkgs/os-specific/darwin/maloader/default.nix
@@ -32,5 +32,6 @@ stdenv.mkDerivation {
     description = "Mach-O loader for Linux";
     homepage = https://github.com/shinh/maloader;
     license = stdenv.lib.licenses.bsd2;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/darwin/swift-corefoundation/default.nix b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
index 969168fa54b..969168fa54b 100644
--- a/pkgs/os-specific/darwin/swift-corefoundation/default.nix
+++ b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix
diff --git a/pkgs/os-specific/darwin/swift-corelibs/default.nix b/pkgs/os-specific/darwin/swift-corelibs/default.nix
new file mode 100644
index 00000000000..fdc97304528
--- /dev/null
+++ b/pkgs/os-specific/darwin/swift-corelibs/default.nix
@@ -0,0 +1,8 @@
+{callPackage, stdenv, darwin, xcbuild}:
+
+rec {
+  corefoundation = callPackage ./corefoundation.nix {};
+  libdispatch = callPackage ./libdispatch.nix {
+   inherit (darwin) apple_sdk_sierra xnu;
+  };
+}
diff --git a/pkgs/os-specific/darwin/swift-corelibs/libdispatch.nix b/pkgs/os-specific/darwin/swift-corelibs/libdispatch.nix
new file mode 100644
index 00000000000..bd143b6071b
--- /dev/null
+++ b/pkgs/os-specific/darwin/swift-corelibs/libdispatch.nix
@@ -0,0 +1,12 @@
+{ stdenv, fetchFromGitHub, cmake, apple_sdk_sierra, xnu-new }:
+
+stdenv.mkDerivation rec {
+  name = "swift-corelibs-libdispatch";
+  src = fetchFromGitHub {
+    owner = "apple";
+    repo = name;
+    rev = "f83b5a498bad8e9ff8916183cf6e8ccf677c346b";
+    sha256 = "1czkyyc9llq2mnqfp19mzcfsxzas0y8zrk0gr5hg60acna6jkz2l";
+  };
+  buildInputs = [ cmake apple_sdk_sierra.sdk xnu-new ];
+}
diff --git a/pkgs/os-specific/linux/autofs/default.nix b/pkgs/os-specific/linux/autofs/default.nix
index a7472de1d02..859593e4b9a 100644
--- a/pkgs/os-specific/linux/autofs/default.nix
+++ b/pkgs/os-specific/linux/autofs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, flex, bison, linuxHeaders, libtirpc, mount, umount, modprobe, nfs-utils, e2fsprogs
+{ stdenv, lib, fetchurl, flex, bison, linuxHeaders, libtirpc, mount, umount, nfs-utils, e2fsprogs
 , libxml2, kerberos, kmod, openldap, sssd, cyrus_sasl, openssl }:
 
 let
@@ -20,7 +20,7 @@ in stdenv.mkDerivation {
     export MOUNT=${mount}/bin/mount
     export MOUNT_NFS=${nfs-utils}/bin/mount.nfs
     export UMOUNT=${umount}/bin/umount
-    export MODPROBE=${modprobe}/bin/modprobe
+    export MODPROBE=${kmod}/bin/modprobe
     export E2FSCK=${e2fsprogs}/bin/fsck.ext2
     export E3FSCK=${e2fsprogs}/bin/fsck.ext3
     export E4FSCK=${e2fsprogs}/bin/fsck.ext4
diff --git a/pkgs/os-specific/linux/bluez/bluez5_28.nix b/pkgs/os-specific/linux/bluez/bluez5_28.nix
deleted file mode 100644
index 11aee0d88f2..00000000000
--- a/pkgs/os-specific/linux/bluez/bluez5_28.nix
+++ /dev/null
@@ -1,82 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, dbus, glib, alsaLib,
-  pythonPackages, readline, libsndfile, udev, libical,
-  systemd, enableWiimote ? false }:
-
-assert stdenv.isLinux;
-
-let
-  inherit (pythonPackages) python;
-in stdenv.mkDerivation rec {
-  name = "bluez-5.28";
-   
-  src = fetchurl {
-    url = "mirror://kernel/linux/bluetooth/${name}.tar.xz";
-    sha256 = "1a8qzh38wpq5c0rydpx9isf0jc6g14g2qs18j1rmi8a79f7v9fl5";
-  };
-
-  pythonPath = with pythonPackages;
-    [ dbus pygobject2 pygobject3 recursivePthLoader ];
-
-  buildInputs =
-    [ pkgconfig dbus glib alsaLib python pythonPackages.wrapPython
-      readline libsndfile udev libical
-      # Disables GStreamer; not clear what it gains us other than a
-      # zillion extra dependencies.
-      # gstreamer gst-plugins-base 
-    ];
-
-  preConfigure = ''
-      substituteInPlace tools/hid2hci.rules --replace /sbin/udevadm ${systemd}/bin/udevadm
-      substituteInPlace tools/hid2hci.rules --replace "hid2hci " "$out/lib/udev/hid2hci "
-    '';
-
-  configureFlags = [
-    "--localstatedir=/var"
-    "--enable-library"
-    "--enable-cups"
-    "--with-dbusconfdir=$(out)/etc"
-    "--with-dbussystembusdir=$(out)/share/dbus-1/system-services"
-    "--with-dbussessionbusdir=$(out)/share/dbus-1/services"
-    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
-    "--with-systemduserunitdir=$(out)/etc/systemd/user"
-    "--with-udevdir=$(out)/lib/udev"
-    ] ++
-    stdenv.lib.optional enableWiimote [ "--enable-wiimote" ];
-
-  # Work around `make install' trying to create /var/lib/bluetooth.
-  installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
-
-  makeFlags = "rulesdir=$(out)/lib/udev/rules.d";
-
-  # FIXME: Move these into a separate package to prevent Bluez from
-  # depending on Python etc.
-  postInstall = ''
-    mkdir $out/test
-    cp -a test $out
-    pushd $out/test
-    for a in \
-            simple-agent \
-            test-adapter \
-            test-device \
-            test-thermometer \
-            list-devices \
-            monitor-bluetooth \
-            ; do
-      ln -s ../test/$a $out/bin/bluez-$a
-    done
-    popd
-    wrapPythonProgramsIn $out/test "$out/test $pythonPath"
-
-    # for bluez4 compatibility for NixOS
-    mkdir $out/sbin
-    ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd
-    ln -s ../libexec/bluetooth/obexd $out/sbin/obexd
-  '';
-
-  meta = with stdenv.lib; {
-    homepage = http://www.bluez.org/;
-    repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git;
-    description = "Bluetooth support for Linux";
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/os-specific/linux/ipset/default.nix b/pkgs/os-specific/linux/ipset/default.nix
index 68692019ca9..d736caa535d 100644
--- a/pkgs/os-specific/linux/ipset/default.nix
+++ b/pkgs/os-specific/linux/ipset/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libmnl }:
 
 stdenv.mkDerivation rec {
-  name = "ipset-6.36";
+  name = "ipset-6.38";
 
   src = fetchurl {
     url = "http://ipset.netfilter.org/${name}.tar.bz2";
-    sha256 = "03fk40v0rbiv2b9ciy3zk8yix163803xvpmdlyvrfzbcvj84l8i2";
+    sha256 = "0i72wcljl0nkpmzc20jcch3hpphrm0qp4v4j4ajamq0zlddn5vyf";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/os-specific/linux/iputils/default.nix b/pkgs/os-specific/linux/iputils/default.nix
index 3fc4f3b2377..d2eab02f675 100644
--- a/pkgs/os-specific/linux/iputils/default.nix
+++ b/pkgs/os-specific/linux/iputils/default.nix
@@ -35,20 +35,21 @@ stdenv.mkDerivation rec {
   installPhase =
     ''
       mkdir -p $out/bin
-      cp -p ping tracepath clockdiff arping rdisc $out/bin/
+      cp -p ping tracepath clockdiff arping rdisc rarpd $out/bin/
       if [ -x ninfod/ninfod ]; then
         cp -p ninfod/ninfod $out/bin
       fi
 
       mkdir -p $out/share/man/man8
       cp -p \
-        doc/clockdiff.8 doc/arping.8 doc/ping.8 doc/rdisc.8 doc/tracepath.8 doc/ninfod.8 \
+        doc/clockdiff.8 doc/arping.8 doc/ping.8 doc/rdisc.8 doc/rarpd.8 doc/tracepath.8 doc/ninfod.8 \
         $out/share/man/man8
     '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://github.com/iputils/iputils;
     description = "A set of small useful utilities for Linux networking";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ lheckemann ];
   };
 }
diff --git a/pkgs/os-specific/linux/kernel/linux-4.14.nix b/pkgs/os-specific/linux/kernel/linux-4.14.nix
index 46486e0ff58..ba589b70b6b 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.14.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.14.nix
@@ -3,13 +3,13 @@
 with stdenv.lib;
 
 buildLinux (args // rec {
-  version = "4.14.33";
+  version = "4.14.34";
 
   # branchVersion needs to be x.y
   extraMeta.branch = concatStrings (intersperse "." (take 2 (splitString "." version)));
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "0c88p5vly63jsz62ff7971zl6vqzzbv5q519gi8z17ld66sf5063";
+    sha256 = "1f9bl4qw61xw49y5xz1wyilg8gh0wv9k868fh8n3hp17hm66qavq";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.15.nix b/pkgs/os-specific/linux/kernel/linux-4.15.nix
index e58f44ea6a0..63bfc79e62d 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.15.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.15.nix
@@ -3,7 +3,7 @@
 with stdenv.lib;
 
 buildLinux (args // rec {
-  version = "4.15.16";
+  version = "4.15.17";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0")));
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "00y5b00f90pq3il5jdzigx8k32i9ksrinavqa991xday5mcz5np7";
+    sha256 = "1f20h22rrchvqd653a3ih8q6l13zl47bp6k2339x9ihq40rg5m9g";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.16.nix b/pkgs/os-specific/linux/kernel/linux-4.16.nix
index eb219ce0e0f..aa225c8e7c7 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.16.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.16.nix
@@ -3,7 +3,7 @@
 with stdenv.lib;
 
 buildLinux (args // rec {
-  version = "4.16.1";
+  version = "4.16.2";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0")));
@@ -13,6 +13,6 @@ buildLinux (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1hv00176njm4g9m1aj92lvhwqn75c46qwsglsmx95ivbr9qc58av";
+    sha256 = "157q43px707nizqwzi5nk87c0nvdif9fbi751f71wpgfp3iiy2s7";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix b/pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix
index 82b0b44bfc0..0075cfbe165 100644
--- a/pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix
+++ b/pkgs/os-specific/linux/kernel/linux-copperhead-hardened.nix
@@ -3,9 +3,9 @@
 with stdenv.lib;
 
 let
-  version = "4.15.16";
+  version = "4.15.17";
   revision = "a";
-  sha256 = "0jxf01gf5rh6kwxcsv6mwlhq3wva2ps0ayrx40zwrdhkqy03w79x";
+  sha256 = "0rm5dlfj3ryz879p04px1y3hvlfgh3ryk13ihldnl2j1dzl2046i";
 
   # modVersion needs to be x.y.z, will automatically add .0 if needed
   modVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0")));
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index e163459d7f4..cedb2dfc223 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -73,4 +73,15 @@ rec {
     };
   };
 
+  # https://patchwork.kernel.org/patch/9626797/
+  # Should be included in 4.17, so this patch can be dropped when 4.16 becomes obsolete.
+  bcm2835_mmal_v4l2_camera_driver = rec {
+    name = "bcm2835_mmal_v4l2_camera_driver";
+    patch = fetchpatch {
+      name = name + ".patch";
+      url = https://patchwork.kernel.org/patch/9626797/raw/;
+      sha256 = "0iwb0yxsf95zv4qxkvlvhqfmzx0rk13g9clvxsharvwkb4w5lwa0";
+    };
+  };
+
 }
diff --git a/pkgs/os-specific/linux/kmod/aggregator.nix b/pkgs/os-specific/linux/kmod/aggregator.nix
index 9bd7c8480c1..7d46a13f356 100644
--- a/pkgs/os-specific/linux/kmod/aggregator.nix
+++ b/pkgs/os-specific/linux/kmod/aggregator.nix
@@ -9,6 +9,12 @@ buildEnv {
     ''
       source ${stdenv}/setup
 
+      if ! test -d "$out/lib/modules"; then
+        echo "No modules found."
+        # To support a kernel without modules
+        exit 0
+      fi
+
       kernelVersion=$(cd $out/lib/modules && ls -d *)
       if test "$(echo $kernelVersion | wc -w)" != 1; then
          echo "inconsistent kernel versions: $kernelVersion"
diff --git a/pkgs/os-specific/linux/rtkit/default.nix b/pkgs/os-specific/linux/rtkit/default.nix
index 4fd716ab8db..868dcc9a58e 100644
--- a/pkgs/os-specific/linux/rtkit/default.nix
+++ b/pkgs/os-specific/linux/rtkit/default.nix
@@ -24,6 +24,12 @@ stdenv.mkDerivation rec {
       url = "http://git.0pointer.net/rtkit.git/patch/?id=88d4082ef6caf6b071d749dca1c50e7edde914cc";
       sha256 = "0hp1blbi359qz8fmr6nj4w9yc0jf3dd176f8pn25wdj38n13qkix";
     })
+
+    # Fix format string errors due to -Werror=format-security
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/r/rtkit/0.11-6/debian/patches/0006-fix-format-strings.patch";
+      sha256 = "09mr89lh16jvz6cqw00zmh0xk919bjfhjkvna1czwmafwy9p7kgp";
+    })
   ];
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
index 2550e6d28f6..7c37d18c868 100644
--- a/pkgs/os-specific/linux/spl/default.nix
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -78,5 +78,6 @@ in
       version = "2018-01-24";
       rev = "23602fdb39e1254c669707ec9d2d0e6bcdbf1771";
       sha256 = "09py2dwj77f6s2qcnkwdslg5nxb3hq2bq39zpxpm6msqyifhl69h";
+      patches = [ ./install_prefix.patch ];
     };
 }
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index 4cbe527de05..d4b312ad6d5 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -82,6 +82,7 @@ let
         done
 
         ./autogen.sh
+        configureFlagsArray+=("--libexecdir=$out/libexec")
       '';
 
       configureFlags = [
@@ -91,6 +92,7 @@ let
         "--with-udevdir=$(out)/lib/udev"
         "--with-systemdunitdir=$(out)/etc/systemd/system"
         "--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
+        "--with-systemdgeneratordir=$(out)/lib/systemd/system-generator"
         "--with-mounthelperdir=$(out)/bin"
         "--sysconfdir=/etc"
         "--localstatedir=/var"
diff --git a/pkgs/servers/dns/knot-dns/default.nix b/pkgs/servers/dns/knot-dns/default.nix
index 0af077c455c..de37aeaa590 100644
--- a/pkgs/servers/dns/knot-dns/default.nix
+++ b/pkgs/servers/dns/knot-dns/default.nix
@@ -7,11 +7,11 @@ let inherit (stdenv.lib) optional optionals; in
 # Note: ATM only the libraries have been tested in nixpkgs.
 stdenv.mkDerivation rec {
   name = "knot-dns-${version}";
-  version = "2.6.5";
+  version = "2.6.6";
 
   src = fetchurl {
     url = "http://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz";
-    sha256 = "33cd676706e2baeb37cf3879ccbc91a1e1cd1ee5d7a082adff4d1e753ce49d46";
+    sha256 = "02h8qdkja4kic3br79svws6r2pq1ijz945238v99d998d2jxh6ci";
   };
 
   outputs = [ "bin" "out" "dev" ];
diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix
index 94dee4c8724..718fd3cc6a9 100644
--- a/pkgs/servers/home-assistant/component-packages.nix
+++ b/pkgs/servers/home-assistant/component-packages.nix
@@ -2,7 +2,7 @@
 # Do not edit!
 
 {
-  version = "0.66.1";
+  version = "0.67.0";
   components = {
     "abode" = ps: with ps; [  ];
     "ads" = ps: with ps; [  ];
@@ -55,10 +55,11 @@
     "climate.sensibo" = ps: with ps; [  ];
     "climate.touchline" = ps: with ps; [  ];
     "climate.venstar" = ps: with ps; [  ];
-    "cloud" = ps: with ps; [  ];
+    "cloud" = ps: with ps; [ warrant ];
     "coinbase" = ps: with ps; [  ];
     "comfoconnect" = ps: with ps; [  ];
     "config.config_entries" = ps: with ps; [  ];
+    "cover.gogogate2" = ps: with ps; [  ];
     "cover.myq" = ps: with ps; [  ];
     "daikin" = ps: with ps; [  ];
     "datadog" = ps: with ps; [ datadog ];
@@ -71,6 +72,7 @@
     "device_tracker.bluetooth_tracker" = ps: with ps; [  ];
     "device_tracker.cisco_ios" = ps: with ps; [ pexpect ];
     "device_tracker.fritz" = ps: with ps; [ fritzconnection ];
+    "device_tracker.google_maps" = ps: with ps; [  ];
     "device_tracker.icloud" = ps: with ps; [  ];
     "device_tracker.linksys_ap" = ps: with ps; [ beautifulsoup4 ];
     "device_tracker.mikrotik" = ps: with ps; [  ];
@@ -84,6 +86,7 @@
     "device_tracker.unifi" = ps: with ps; [ pyunifi ];
     "device_tracker.unifi_direct" = ps: with ps; [ pexpect ];
     "device_tracker.upc_connect" = ps: with ps; [ defusedxml ];
+    "device_tracker.xiaomi_miio" = ps: with ps; [  ];
     "digital_ocean" = ps: with ps; [ digital-ocean ];
     "discovery" = ps: with ps; [ netdisco ];
     "dominos" = ps: with ps; [  ];
@@ -99,6 +102,7 @@
     "fan.xiaomi_miio" = ps: with ps; [ construct ];
     "feedreader" = ps: with ps; [ feedparser ];
     "ffmpeg" = ps: with ps; [ ha-ffmpeg ];
+    "folder_watcher" = ps: with ps; [ watchdog ];
     "frontend" = ps: with ps; [  ];
     "gc100" = ps: with ps; [  ];
     "goalfeed" = ps: with ps; [  ];
@@ -139,6 +143,7 @@
     "light.lifx_legacy" = ps: with ps; [  ];
     "light.limitlessled" = ps: with ps; [  ];
     "light.mystrom" = ps: with ps; [  ];
+    "light.nanoleaf_aurora" = ps: with ps; [  ];
     "light.osramlightify" = ps: with ps; [  ];
     "light.piglow" = ps: with ps; [  ];
     "light.rpi_gpio_pwm" = ps: with ps; [  ];
@@ -205,7 +210,6 @@
     "media_player.yamaha_musiccast" = ps: with ps; [  ];
     "media_player.ziggo_mediabox_xl" = ps: with ps; [  ];
     "melissa" = ps: with ps; [  ];
-    "mercedesme" = ps: with ps; [  ];
     "mochad" = ps: with ps; [  ];
     "modbus" = ps: with ps; [  ];
     "mqtt" = ps: with ps; [ paho-mqtt ];
@@ -230,6 +234,7 @@
     "notify.kodi" = ps: with ps; [ jsonrpc-async ];
     "notify.lametric" = ps: with ps; [  ];
     "notify.mailgun" = ps: with ps; [  ];
+    "notify.mastodon" = ps: with ps; [  ];
     "notify.matrix" = ps: with ps; [ matrix-client ];
     "notify.message_bird" = ps: with ps; [  ];
     "notify.pushbullet" = ps: with ps; [ pushbullet ];
@@ -375,6 +380,7 @@
     "sensor.ups" = ps: with ps; [  ];
     "sensor.vasttrafik" = ps: with ps; [  ];
     "sensor.waqi" = ps: with ps; [  ];
+    "sensor.waze_travel_time" = ps: with ps; [  ];
     "sensor.whois" = ps: with ps; [  ];
     "sensor.xbox_live" = ps: with ps; [  ];
     "sensor.xiaomi_miio" = ps: with ps; [ construct ];
diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix
index 04d0ba66486..0f5e59918aa 100644
--- a/pkgs/servers/home-assistant/default.nix
+++ b/pkgs/servers/home-assistant/default.nix
@@ -8,10 +8,10 @@ let
   py = python3.override {
     packageOverrides = self: super: {
       aiohttp = super.aiohttp.overridePythonAttrs (oldAttrs: rec {
-        version = "3.0.9";
+        version = "3.1.1";
         src = oldAttrs.src.override {
           inherit version;
-          sha256 = "281a9fa56b5ce587a2147ec285d18a224942f7e020581afa6cc44d7caecf937b";
+          sha256 = "dc5cab081d4b334d0440b019edf24fe1cb138b8114e0e22d2b0661284bc1775f";
         };
       });
       pytest = super.pytest.overridePythonAttrs (oldAttrs: rec {
@@ -58,7 +58,7 @@ let
   extraBuildInputs = extraPackages py.pkgs;
 
   # Don't forget to run parse-requirements.py after updating
-  hassVersion = "0.66.1";
+  hassVersion = "0.67.0";
 
 in with py.pkgs; buildPythonApplication rec {
   pname = "homeassistant";
@@ -73,7 +73,7 @@ in with py.pkgs; buildPythonApplication rec {
     owner = "home-assistant";
     repo = "home-assistant";
     rev = version;
-    sha256 = "16yz5mfzpfms22f8linw1k3wjp3jpwj270vy2rc893x9bzsppfl0";
+    sha256 = "00y7sm6nsyxxl98izxxmg2nwi76kxb7p47hv07y04fs45lnvr61s";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/servers/http/jetty/default.nix b/pkgs/servers/http/jetty/default.nix
index 98ca50c5bc4..1e99aab24c6 100644
--- a/pkgs/servers/http/jetty/default.nix
+++ b/pkgs/servers/http/jetty/default.nix
@@ -2,19 +2,18 @@
 
 stdenv.mkDerivation rec {
   name = "jetty-${version}";
-  version = "9.3.10.v20160621";
-
+  version = "9.4.8.v20171121";
   src = fetchurl {
     url = "http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/${version}/jetty-distribution-${version}.tar.gz";
     name = "jetty-distribution-${version}.tar.gz";
-    sha256 = "0xqv7bp82i95gikma70kyi91nlgsj5zabzg59ly9ga4mqf5y0zbz";
+    sha256 = "0bvwi70vdk468yqgvgq99lwrpy2y5znrl0b1cr8j6ygmsgnvvmjh";
   };
 
   phases = [ "unpackPhase" "installPhase" ];
 
   installPhase = ''
     mkdir -p $out
-    mv etc lib modules start.jar $out
+    mv etc lib modules start.ini start.jar $out
   '';
 
   meta = {
diff --git a/pkgs/servers/oauth2_proxy/default.nix b/pkgs/servers/oauth2_proxy/default.nix
index b58fc342ded..d9919005e39 100644
--- a/pkgs/servers/oauth2_proxy/default.nix
+++ b/pkgs/servers/oauth2_proxy/default.nix
@@ -1,17 +1,25 @@
-{ stdenv, lib, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }:
+{ stdenv, lib, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   name = "oauth2_proxy-${version}";
-  version = "20160120-${stdenv.lib.strings.substring 0 7 rev}";
-  rev = "10f47e325b782a60b8689653fa45360dee7fbf34";
+  version = "20180325-${stdenv.lib.strings.substring 0 7 rev}";
+  rev = "a94b0a8b25e553f7333f7b84aeb89d9d18ec259b";
   
   goPackagePath = "github.com/bitly/oauth2_proxy";
 
-  src = fetchgit {
+  src = fetchFromGitHub {
     inherit rev;
-    url = "https://github.com/bitly/oauth2_proxy";
-    sha256 = "13f6kaq15f6ial9gqzrsx7i94jhd5j70js2k93qwxcw1vkh1b6si";
+    repo = "oauth2_proxy";
+    owner = "bitly";
+    sha256 = "07m258s9fxjsgixggw0d1zicd7l6l2rkm5mh3zdjdaj20sqcj217";
   };
 
   goDeps = ./deps.nix;
+
+  meta = with lib; {
+    description = "A reverse proxy that provides authentication with Google, Github or other provider";
+    homepage = https://github.com/bitly/oauth2_proxy/;
+    license = licenses.mit;
+    maintainers = [ maintainers.yorickvp ];
+  };
 }
diff --git a/pkgs/servers/oauth2_proxy/deps.nix b/pkgs/servers/oauth2_proxy/deps.nix
index 37ddbbde64e..435c7d12782 100644
--- a/pkgs/servers/oauth2_proxy/deps.nix
+++ b/pkgs/servers/oauth2_proxy/deps.nix
@@ -1,20 +1,21 @@
+# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
 [
   {
-    goPackagePath = "gopkg.in/fsnotify.v1";
+    goPackagePath = "cloud.google.com/go";
     fetch = {
       type = "git";
-      url = "https://gopkg.in/fsnotify.v1";
-      rev = "96c060f6a6b7e0d6f75fddd10efeaca3e5d1bcb0";
-      sha256 = "1308z1by82fbymcra26wjzw7lpjy91kbpp2skmwqcq4q1iwwzvk2";
+      url = "https://code.googlesource.com/gocloud";
+      rev = "d27f27d9b3cf75c9901d9981f9af50bbfd9002da";
+      sha256 = "18vdhkymm4cqh5fjyz0ia0bc2mpmarjk6w6zh9ydm2d4nkj36cm5";
     };
   }
   {
-    goPackagePath = "golang.org/x/net";
+    goPackagePath = "github.com/BurntSushi/toml";
     fetch = {
       type = "git";
-      url = "https://go.googlesource.com/net";
-      rev = "62ac18b461605b4be188bbc7300e9aa2bc836cd4";
-      sha256 = "0lwwvbbwbf3yshxkfhn6z20gd45dkvnmw2ms36diiy34krgy402p";
+      url = "https://github.com/BurntSushi/toml";
+      rev = "a368813c5e648fee92e5f6c30e3944ff9d5e8895";
+      sha256 = "1sjxs2lwc8jpln80s4rlzp7nprbcljhy5mz4rf9995gq93wqnym5";
     };
   }
   {
@@ -22,17 +23,26 @@
     fetch = {
       type = "git";
       url = "https://github.com/bitly/go-simplejson";
-      rev = "18db6e68d8fd9cbf2e8ebe4c81a78b96fd9bf05a";
-      sha256 = "0lj9cxyncchlw6p35j0yym5q5waiz0giw6ri41qdwm8y3dghwwiy";
+      rev = "0c965951289cce37dec52ad1f34200fefc816777";
+      sha256 = "0ys37wshd430dizzbg39x5mw55daih2q4qj5l9gr3qbmq9qdn0f3";
     };
   }
   {
-    goPackagePath = "github.com/BurntSushi/toml";
+    goPackagePath = "github.com/coreos/go-oidc";
     fetch = {
       type = "git";
-      url = "https://github.com/BurntSushi/toml";
-      rev = "056c9bc7be7190eaa7715723883caffa5f8fa3e4";
-      sha256 = "0gkgkw04ndr5y7hrdy0r4v2drs5srwfcw2bs1gyas066hwl84xyw";
+      url = "https://github.com/coreos/go-oidc";
+      rev = "065b426bd41667456c1a924468f507673629c46b";
+      sha256 = "10xhrh70rccgydi708dc9xl4ivmjnzhh1skd1ij6xl1i3x8lk3g6";
+    };
+  }
+  {
+    goPackagePath = "github.com/mbland/hmacauth";
+    fetch = {
+      type = "git";
+      url = "https://github.com/mbland/hmacauth";
+      rev = "44256dfd4bfa7594cfa73587a464ca890e85971a";
+      sha256 = "1d5pbjgc5j8pi3frsjp5gqg7j12bxdbl55nhy01cv4c96hay2ij1";
     };
   }
   {
@@ -40,26 +50,35 @@
     fetch = {
       type = "git";
       url = "https://github.com/mreiferson/go-options";
-      rev = "7c174072188d0cfbe6f01bb457626abb22bdff52";
-      sha256 = "0ksyi2cb4k6r2fxamljg42qbz5hdcb9kv5i7y6cx4ajjy0xznwgm";
+      rev = "77551d20752b54535462404ad9d877ebdb26e53d";
+      sha256 = "02c18zrx038gbas58l90xzsz9m5q3gpjprdcwmnvxsn0zvld0vpj";
     };
   }
   {
-    goPackagePath = "google.golang.org/api";
+    goPackagePath = "github.com/pquerna/cachecontrol";
     fetch = {
       type = "git";
-      url = "https://code.googlesource.com/google-api-go-client";
-      rev = "a5c3e2a4792aff40e59840d9ecdff0542a202a80";
-      sha256 = "1kigddnbyrl9ddpj5rs8njvf1ck54ipi4q1282k0d6b3am5qfbj8";
+      url = "https://github.com/pquerna/cachecontrol";
+      rev = "525d0eb5f91d30e3b1548de401b7ef9ea6898520";
+      sha256 = "13r6qz9pghy9fapps5h9mhblggnjq2nfxysvf2jp4scanc5vw2y3";
     };
   }
   {
-    goPackagePath = "google.golang.org/cloud";
+    goPackagePath = "golang.org/x/crypto";
     fetch = {
       type = "git";
-      url = "https://code.googlesource.com/gocloud";
-      rev = "6335269abf9002cf5a84613c13cda6010842b834";
-      sha256 = "15xrqxna5ms0r634k3bfzyymn431dvqcjwbsap8ay60x371kzbwf";
+      url = "https://go.googlesource.com/crypto";
+      rev = "88942b9c40a4c9d203b82b3731787b672d6e809b";
+      sha256 = "0jw1faq8krcxwf1fv3w75apk1ncnykwg8y5ahs5rasjmspvkv8cw";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/net";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/net";
+      rev = "6078986fec03a1dcc236c34816c71b0e05018fda";
+      sha256 = "0qbl17mzpq7anwyzy6hdvxqk7f6q2xlm6f9dknkwlszfd4id2fwb";
     };
   }
   {
@@ -67,17 +86,44 @@
     fetch = {
       type = "git";
       url = "https://go.googlesource.com/oauth2";
-      rev = "397fe7649477ff2e8ced8fc0b2696f781e53745a";
-      sha256 = "0fza0l7iwh6llkq2yzqn7dxi138vab0da64lnghfj1p71fprjzn8";
+      rev = "fdc9e635145ae97e6c2cb777c48305600cf515cb";
+      sha256 = "0pznj7pb2rjar005dvppimdynarm8smj6vnqz9wvd9fxyn0q0yww";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/sys";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/sys";
+      rev = "13d03a9a82fba647c21a0ef8fba44a795d0f0835";
+      sha256 = "1lmyd4mk7lbgnxyvr6ndfdfafazp9a4cc6c0a2q2j4n53g2vwbgk";
+    };
+  }
+  {
+    goPackagePath = "google.golang.org/api";
+    fetch = {
+      type = "git";
+      url = "https://code.googlesource.com/google-api-go-client";
+      rev = "e4126357c891acdef6dcd7805daa4c6533be6544";
+      sha256 = "19c874pr7vhhiyw7zn6v625g8i70gqzi3rr645kai6pnd1w7s27n";
+    };
+  }
+  {
+    goPackagePath = "gopkg.in/fsnotify.v1";
+    fetch = {
+      type = "git";
+      url = "https://gopkg.in/fsnotify/fsnotify.v1";
+      rev = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9";
+      sha256 = "07va9crci0ijlivbb7q57d2rz9h27zgn2fsm60spjsqpdbvyrx4g";
     };
   }
   {
-    goPackagePath = "github.com/18F/hmacauth";
+    goPackagePath = "gopkg.in/square/go-jose.v2";
     fetch = {
       type = "git";
-      url = "https://github.com/18F/hmacauth";
-      rev = "9232a6386b737d7d1e5c1c6e817aa48d5d8ee7cd";
-      sha256 = "056mcqrf2bv0g9gn2ixv19srk613h4sasl99w9375mpvmadb3pz1";
+      url = "https://gopkg.in/square/go-jose.v2";
+      rev = "552e98edab5d620205ff1a8960bf52a5a10aad03";
+      sha256 = "03w6rgxkvdv3vcfr23s6wbck431w7dwnw0jy7qnyl0qihxzn40rv";
     };
   }
 ]
diff --git a/pkgs/servers/sql/postgresql/jdbc/default.nix b/pkgs/servers/sql/postgresql/jdbc/default.nix
index 39b574ae96d..62ebf6b4453 100644
--- a/pkgs/servers/sql/postgresql/jdbc/default.nix
+++ b/pkgs/servers/sql/postgresql/jdbc/default.nix
@@ -1,24 +1,21 @@
-{ stdenv, fetchurl, ant, jdk }:
-
-let version = "9.3-1100"; in
+{ stdenv, fetchMavenArtifact }:
 
 stdenv.mkDerivation rec {
   name = "postgresql-jdbc-${version}";
+  version = "42.2.2";
 
-  src = fetchurl {
-    url = "http://jdbc.postgresql.org/download/postgresql-jdbc-${version}.src.tar.gz";
-    sha256 = "0mbdzhzg4ws0i7ps98rg0q5n68lsrdm2klj7y7skaix0rpa57gp6";
+  src = fetchMavenArtifact {
+    artifactId = "postgresql";
+    groupId = "org.postgresql";
+    sha256 = "0w7sfi1gmzqhyhr4iq9znv8hff41xwwqcblkyd9ph0m34r0555hr";
+    inherit version;
   };
 
-  buildInputs = [ ant jdk ];
-
-  buildPhase = "ant";
+  phases = [ "installPhase" ];
 
-  installPhase =
-    ''
-      mkdir -p $out/share/java
-      cp jars/*.jar $out/share/java
-    '';
+  installPhase = ''
+    install -D $src/share/java/*_postgresql-${version}.jar $out/share/java/postgresql-jdbc.jar
+  '';
 
   meta = with stdenv.lib; {
     homepage = https://jdbc.postgresql.org/;
diff --git a/pkgs/servers/trezord/default.nix b/pkgs/servers/trezord/default.nix
index bdc37b700e5..a3c50564621 100644
--- a/pkgs/servers/trezord/default.nix
+++ b/pkgs/servers/trezord/default.nix
@@ -1,65 +1,26 @@
-{ stdenv, fetchgit, fetchFromGitHub, curl, cmake, boost, gcc, protobuf, pkgconfig, jsoncpp
-, libusb1, libmicrohttpd
-}:
+{ stdenv, buildGoPackage, fetchFromGitHub }:
 
-let
-  version = "1.2.1";
-in
+buildGoPackage rec {
+  name = "trezord-go-${version}";
+  version = "2.0.12";
 
-stdenv.mkDerivation rec {
-  name = "trezord-${version}";
+  # Fixes Cgo related build failures (see https://github.com/NixOS/nixpkgs/issues/25959 )
+  hardeningDisable = [ "fortify" ];
 
-  src = fetchgit {
-    url    = "https://github.com/trezor/trezord";
-    rev    = "refs/tags/v${version}";
-    sha256 = "1iaxmwyidjdcrc6jg0859v6v5x3qnz5b0p78pq0bypvmgyijhpm4";
-  };
+  goPackagePath = "github.com/trezor/trezord-go";
 
-  common = fetchFromGitHub {
-    owner = "trezor";
-    repo = "trezor-common";
-    rev = "b55fb61218431e9c99c9d6c1673801902fc9e92e";
-    sha256 = "1zanbgz1qjs8wfwp0z91sqcvj77a9iis694k415jyd2dn4riqhdg";
+  src = fetchFromGitHub {
+    owner  = "trezor";
+    repo   = "trezord-go";
+    rev    = "v${version}";
+    sha256 = "03pz223jjfbd0g9gkk21q6d27jc8vd1bc1jz00i0f3dzvsyfx5g6";
   };
 
   meta = with stdenv.lib; {
-    description = "TREZOR Bridge daemon for TREZOR bitcoin hardware wallet";
+    description = "TREZOR Communication Daemon aka TREZOR Bridge";
     homepage = https://mytrezor.com;
     license = licenses.gpl3;
     maintainers = with stdenv.lib.maintainers; [ canndrew jb55 ];
     platforms = platforms.linux;
   };
-
-  patches = [ ./dynamic-link.patch ];
-
-  nativeBuildInputs = [
-    cmake
-    gcc
-    pkgconfig
-  ];
-
-  buildInputs = [
-    curl
-    boost
-    protobuf
-    libusb1
-    libmicrohttpd
-    jsoncpp
-  ];
-
-  preConfigure = ''
-    ( cd src/config
-      ln -s $common/protob/config.proto
-      protoc -I . --cpp_out=. config.proto
-    )
-  '';
-
-  LD_LIBRARY_PATH = "${stdenv.lib.makeLibraryPath [ curl ]}";
-  cmakeFlags = [ "-DJSONCPP_LIBRARY='${jsoncpp}/lib/libjsoncpp.so'" ];
-
-  installPhase = ''
-    mkdir -p $out/bin
-    cp trezord $out/bin
-  '';
 }
-
diff --git a/pkgs/servers/trezord/dynamic-link.patch b/pkgs/servers/trezord/dynamic-link.patch
deleted file mode 100644
index 0f1f448a3f7..00000000000
--- a/pkgs/servers/trezord/dynamic-link.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 7c0e2cf..0e3f4ac 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -59,13 +59,6 @@ target_link_libraries(trezord ${OS_LIBRARIES})
- find_package(CURL REQUIRED)
- find_package(libmicrohttpd REQUIRED)
- 
--# add static libs
--if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
--  set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
--  set(BUILD_SHARED_LIBS off)
--  set(Boost_USE_STATIC_LIBS on)
--  set(CMAKE_FIND_STATIC FIRST)
--endif(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- find_package(Boost 1.53.0 REQUIRED
-   regex thread system unit_test_framework program_options chrono)
- find_package(Protobuf 2.5.0 REQUIRED)
diff --git a/pkgs/shells/oh-my-zsh/default.nix b/pkgs/shells/oh-my-zsh/default.nix
index 8cfcb9ecbbe..5412f4ce896 100644
--- a/pkgs/shells/oh-my-zsh/default.nix
+++ b/pkgs/shells/oh-my-zsh/default.nix
@@ -4,13 +4,13 @@
 { stdenv, fetchgit }:
 
 stdenv.mkDerivation rec {
-  version = "2018-01-22";
+  version = "2018-04-06";
   name = "oh-my-zsh-${version}";
 
   src = fetchgit {
     url = "https://github.com/robbyrussell/oh-my-zsh";
-    rev = "37c2d0ddd751e15d0c87a51e2d9f9849093571dc";
-    sha256 = "0x2r7205ps5v5bl1f9vdnry9gxflypaahz49cnhq5f5klb49bakn";
+    rev = "62b8a70a7c5d0c939d8dabfef48796a092d1a55f";
+    sha256 = "02na47pa2ly17yvwa2nhzyrp8iarawyirhfw3779sh0w78vgw1gs";
   };
 
   pathsToLink = [ "/share/oh-my-zsh" ];
diff --git a/pkgs/tools/admin/acme.sh/default.nix b/pkgs/tools/admin/acme.sh/default.nix
new file mode 100644
index 00000000000..00d8bdd3ef4
--- /dev/null
+++ b/pkgs/tools/admin/acme.sh/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchFromGitHub, makeWrapper, curl, openssl, socat, iproute }:
+stdenv.mkDerivation rec {
+  name = "acme.sh-${version}";
+  version = "2.7.8";
+
+  src = fetchFromGitHub {
+    owner = "Neilpang";
+    repo = "acme.sh";
+    rev = version;
+    sha256 = "0zm64z7av63xi7yjhljab2i8q1vx4q1mpcmcm58jm6k4babalxrf";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out $out/bin $out/libexec
+    cp -R $src/* $_
+    makeWrapper $out/libexec/acme.sh $out/bin/acme.sh \
+      --prefix PATH : "${lib.makeBinPath [ socat openssl curl iproute ]}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A pure Unix shell script implementing ACME client protocol";
+    homepage = https://acme.sh/;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.yorickvp ];
+  };
+}
diff --git a/pkgs/tools/admin/fastlane/Gemfile.lock b/pkgs/tools/admin/fastlane/Gemfile.lock
index a578bb4bca2..9cb80eb131c 100644
--- a/pkgs/tools/admin/fastlane/Gemfile.lock
+++ b/pkgs/tools/admin/fastlane/Gemfile.lock
@@ -1,7 +1,7 @@
 GEM
   remote: https://rubygems.org/
   specs:
-    CFPropertyList (2.3.6)
+    CFPropertyList (3.0.0)
     addressable (2.5.2)
       public_suffix (>= 2.0.2, < 4.0)
     atomos (0.1.2)
@@ -9,14 +9,15 @@ GEM
     claide (1.0.2)
     colored (1.2)
     colored2 (3.1.2)
-    commander-fastlane (4.4.5)
+    commander-fastlane (4.4.6)
       highline (~> 1.7.2)
     declarative (0.0.10)
     declarative-option (0.1.0)
     domain_name (0.5.20170404)
       unf (>= 0.0.5, < 1.0.0)
-    dotenv (2.2.1)
-    excon (0.60.0)
+    dotenv (2.2.2)
+    emoji_regex (0.1.1)
+    excon (0.62.0)
     faraday (0.14.0)
       multipart-post (>= 1.2, < 3)
     faraday-cookie_jar (0.0.6)
@@ -25,20 +26,21 @@ GEM
     faraday_middleware (0.12.2)
       faraday (>= 0.7.4, < 1.0)
     fastimage (2.1.1)
-    fastlane (2.80.0)
+    fastlane (2.91.0)
       CFPropertyList (>= 2.3, < 4.0.0)
       addressable (>= 2.3, < 3.0.0)
       babosa (>= 1.0.2, < 2.0.0)
       bundler (>= 1.12.0, < 2.0.0)
       colored
-      commander-fastlane (>= 4.4.5, < 5.0.0)
+      commander-fastlane (>= 4.4.6, < 5.0.0)
       dotenv (>= 2.1.1, < 3.0.0)
+      emoji_regex (~> 0.1)
       excon (>= 0.45.0, < 1.0.0)
       faraday (~> 0.9)
       faraday-cookie_jar (~> 0.0.6)
       faraday_middleware (~> 0.9)
       fastimage (>= 2.1.0, < 3.0.0)
-      gh_inspector (>= 1.0.1, < 2.0.0)
+      gh_inspector (>= 1.1.2, < 2.0.0)
       google-api-client (>= 0.13.1, < 0.14.0)
       highline (>= 1.7.2, < 2.0.0)
       json (< 3.0.0)
@@ -50,16 +52,17 @@ GEM
       public_suffix (~> 2.0.0)
       rubyzip (>= 1.1.0, < 2.0.0)
       security (= 0.1.3)
+      simctl (~> 1.6.3)
       slack-notifier (>= 2.0.0, < 3.0.0)
       terminal-notifier (>= 1.6.2, < 2.0.0)
       terminal-table (>= 1.4.5, < 2.0.0)
       tty-screen (>= 0.6.3, < 1.0.0)
       tty-spinner (>= 0.8.0, < 1.0.0)
       word_wrap (~> 1.0.0)
-      xcodeproj (>= 1.5.2, < 2.0.0)
+      xcodeproj (>= 1.5.7, < 2.0.0)
       xcpretty (>= 0.2.4, < 1.0.0)
       xcpretty-travis-formatter (>= 0.0.3)
-    gh_inspector (1.1.1)
+    gh_inspector (1.1.3)
     google-api-client (0.13.6)
       addressable (~> 2.5, >= 2.5.1)
       googleauth (~> 0.5)
@@ -93,7 +96,8 @@ GEM
     multi_json (1.13.1)
     multi_xml (0.6.0)
     multipart-post (2.0.0)
-    nanaimo (0.2.3)
+    nanaimo (0.2.5)
+    naturally (2.1.0)
     os (0.9.6)
     plist (3.4.0)
     public_suffix (2.0.5)
@@ -110,6 +114,9 @@ GEM
       faraday (~> 0.9)
       jwt (>= 1.5, < 3.0)
       multi_json (~> 1.10)
+    simctl (1.6.3)
+      CFPropertyList
+      naturally
     slack-notifier (2.3.2)
     terminal-notifier (1.8.0)
     terminal-table (1.8.0)
@@ -121,15 +128,15 @@ GEM
     uber (0.1.0)
     unf (0.1.4)
       unf_ext
-    unf_ext (0.0.7.4)
+    unf_ext (0.0.7.5)
     unicode-display_width (1.3.0)
     word_wrap (1.0.0)
-    xcodeproj (1.5.6)
-      CFPropertyList (~> 2.3.3)
+    xcodeproj (1.5.7)
+      CFPropertyList (>= 2.3.3, < 4.0)
       atomos (~> 0.1.2)
       claide (>= 1.0.2, < 2.0)
       colored2 (~> 3.1)
-      nanaimo (~> 0.2.3)
+      nanaimo (~> 0.2.4)
     xcpretty (0.2.8)
       rouge (~> 2.0.7)
     xcpretty-travis-formatter (1.0.0)
diff --git a/pkgs/tools/admin/fastlane/gemset.nix b/pkgs/tools/admin/fastlane/gemset.nix
index c9ddb7b77c0..4a0d0467d80 100644
--- a/pkgs/tools/admin/fastlane/gemset.nix
+++ b/pkgs/tools/admin/fastlane/gemset.nix
@@ -27,10 +27,10 @@
   CFPropertyList = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0hadm41xr1fq3qp74jd9l5q8l0j9083rgklgzsilllwaav7qrrid";
+      sha256 = "0ykjag3k5msz3sf1j91rb55da2xh596y06m3a4yl79fiy2id0w9z";
       type = "gem";
     };
-    version = "2.3.6";
+    version = "3.0.0";
   };
   claide = {
     source = {
@@ -60,10 +60,10 @@
     dependencies = ["highline"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "04gpg733wv878acvrzp4kc3k934v10l3v8bcz3fjq5imjsrjdnbp";
+      sha256 = "0y8d3ac9qwm1cg6rnpf8rcdsy1yxacrd2g2kl809xsp2vi973g65";
       type = "gem";
     };
-    version = "4.4.5";
+    version = "4.4.6";
   };
   declarative = {
     source = {
@@ -93,18 +93,26 @@
   dotenv = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1pgzlvs0sswnqlgfm9gkz2hlhkc0zd3vnlp2vglb1wbgnx37pjjv";
+      sha256 = "1f9s04xwa9gcsql734nwxvacgsl1si7xka4g4w3r6d3ab8a274y9";
       type = "gem";
     };
-    version = "2.2.1";
+    version = "2.2.2";
+  };
+  emoji_regex = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0pcw3axgcmsgihp0xlsdqrqmavz0lw8g396b048fg21033kssxjn";
+      type = "gem";
+    };
+    version = "0.1.1";
   };
   excon = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1rxwlfs7dq4r3bi9avgn7j6bz4hq1a3hdlr9xwdiyp4dp4286xfc";
+      sha256 = "15l9w0938c19nxmrp09n75qpmm64k12xj69h47yvxzcxcpbgnkb2";
       type = "gem";
     };
-    version = "0.60.0";
+    version = "0.62.0";
   };
   faraday = {
     dependencies = ["multipart-post"];
@@ -142,21 +150,21 @@
     version = "2.1.1";
   };
   fastlane = {
-    dependencies = ["CFPropertyList" "addressable" "babosa" "colored" "commander-fastlane" "dotenv" "excon" "faraday" "faraday-cookie_jar" "faraday_middleware" "fastimage" "gh_inspector" "google-api-client" "highline" "json" "mini_magick" "multi_json" "multi_xml" "multipart-post" "plist" "public_suffix" "rubyzip" "security" "slack-notifier" "terminal-notifier" "terminal-table" "tty-screen" "tty-spinner" "word_wrap" "xcodeproj" "xcpretty" "xcpretty-travis-formatter"];
+    dependencies = ["CFPropertyList" "addressable" "babosa" "colored" "commander-fastlane" "dotenv" "emoji_regex" "excon" "faraday" "faraday-cookie_jar" "faraday_middleware" "fastimage" "gh_inspector" "google-api-client" "highline" "json" "mini_magick" "multi_json" "multi_xml" "multipart-post" "plist" "public_suffix" "rubyzip" "security" "simctl" "slack-notifier" "terminal-notifier" "terminal-table" "tty-screen" "tty-spinner" "word_wrap" "xcodeproj" "xcpretty" "xcpretty-travis-formatter"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0saas50qdfipkms66snyg7imvzn1vfngd87dfygj9x8v18bqwvis";
+      sha256 = "04k6pn95qbpvbmqxrs4pngvfyk4pifcv8is3819b33p754pkiqrp";
       type = "gem";
     };
-    version = "2.80.0";
+    version = "2.91.0";
   };
   gh_inspector = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0mpfl279k8yff2ia601b37zw31blwh2plkr501iz6qj8drx3mq3c";
+      sha256 = "0f8r9byajj3bi2c7c5sqrc7m0zrv3nblfcd4782lw5l73cbsgk04";
       type = "gem";
     };
-    version = "1.1.1";
+    version = "1.1.3";
   };
   google-api-client = {
     dependencies = ["addressable" "googleauth" "httpclient" "mime-types" "representable" "retriable"];
@@ -294,10 +302,18 @@
   nanaimo = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0z6rbji02x75vm5jw4hbpp75khp4z5yfgbaz1h9l8aa00hqf0fxd";
+      sha256 = "03x5f7hk0s21hlkj309w0qipjxz34kyd3c5yj25zq3s2yyn57idi";
       type = "gem";
     };
-    version = "0.2.3";
+    version = "0.2.5";
+  };
+  naturally = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0avn8b2qbfm22afln2p7rky73zns8c444mdhdh4ki8hbjsn0f8cx";
+      type = "gem";
+    };
+    version = "2.1.0";
   };
   os = {
     source = {
@@ -373,6 +389,15 @@
     };
     version = "0.8.1";
   };
+  simctl = {
+    dependencies = ["CFPropertyList" "naturally"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0l1hwxkbpgfhla6dbf0f6nhj794c0k6ilxlh07zcm8by3vdrsvib";
+      type = "gem";
+    };
+    version = "1.6.3";
+  };
   slack-notifier = {
     source = {
       remotes = ["https://rubygems.org"];
@@ -443,10 +468,10 @@
   unf_ext = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "14hr2dzqh33kqc0xchs8l05pf3kjcayvad4z1ip5rdjxrkfk8glb";
+      sha256 = "06p1i6qhy34bpb8q8ms88y6f2kz86azwm098yvcc0nyqk9y729j1";
       type = "gem";
     };
-    version = "0.0.7.4";
+    version = "0.0.7.5";
   };
   unicode-display_width = {
     source = {
@@ -468,10 +493,10 @@
     dependencies = ["CFPropertyList" "atomos" "claide" "colored2" "nanaimo"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0zqx24qhax7p91rs1114da0v86cy9m7an1bjwxq6dyccp8g6kb50";
+      sha256 = "16743g16mrh47f1lxkbw28xn9mmlf1r0zicin4malalsxxkc7ykz";
       type = "gem";
     };
-    version = "1.5.6";
+    version = "1.5.7";
   };
   xcpretty = {
     dependencies = ["rouge"];
diff --git a/pkgs/tools/admin/iamy/default.nix b/pkgs/tools/admin/iamy/default.nix
new file mode 100644
index 00000000000..cfe336a7e83
--- /dev/null
+++ b/pkgs/tools/admin/iamy/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "iamy-${version}";
+  version = "2.1.1";
+
+  goPackagePath = "github.com/99designs/iamy";
+
+  src = fetchFromGitHub {
+    owner = "99designs";
+    repo = "iamy";
+    rev = "v${version}";
+    sha256 = "0b55hxcvgil8rl6zh2kyndfi7s5nzclawjb0sby14wpys3v08bjf";
+  };
+
+  meta = with stdenv.lib; {
+    description = "A cli tool for importing and exporting AWS IAM configuration to YAML files";
+    homepage = https://github.com/99designs/iamy;
+    license = licenses.mit;
+    maintainers = with maintainers; [ suvash ];
+  };
+}
diff --git a/pkgs/tools/admin/lxd/default.nix b/pkgs/tools/admin/lxd/default.nix
index 64ec5e9b418..cfbb90fdc30 100644
--- a/pkgs/tools/admin/lxd/default.nix
+++ b/pkgs/tools/admin/lxd/default.nix
@@ -1,23 +1,37 @@
-{ stdenv, lib, pkgconfig, lxc, buildGoPackage, fetchFromGitHub }:
+{ stdenv, lib, pkgconfig, lxc, buildGoPackage, fetchurl
+, makeWrapper, acl, rsync, gnutar, xz, btrfs-progs, gzip, dnsmasq, squashfsTools, iproute, iptables
+}:
 
 buildGoPackage rec {
-  name = "lxd-${version}";
-  version = "2.16";
-  rev = "lxd-${version}";
+  name = "lxd-3.0.0";
 
   goPackagePath = "github.com/lxc/lxd";
 
-  src = fetchFromGitHub {
-    inherit rev;
-    owner = "lxc";
-    repo = "lxd";
-    sha256 = "0i2mq9m8k9kznwz1i0xb48plp1ffpzvbdrvqvagis4sm17yab3fn";
+  src = fetchurl {
+    url = "https://github.com/lxc/lxd/releases/download/${name}/${name}.tar.gz";
+    sha256 = "0m5prdf9sk8k5bws1zva4n9ycggmy76wnjr6wb423066pszz24ww";
   };
 
-  goDeps = ./deps.nix;
+  preBuild = ''
+    # unpack vendor
+    pushd go/src/github.com/lxc/lxd
+    rm dist/src/github.com/lxc/lxd
+    cp -r dist/src/* ../../..
+    rm -r dist
+    popd
+  '';
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ lxc ];
+  postInstall = ''
+    # binaries from test/
+    rm $bin/bin/{deps,macaroon-identity}
+
+    wrapProgram $bin/bin/lxd --prefix PATH ":" ${stdenv.lib.makeBinPath [
+      acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables
+    ]}
+  '';
+
+  nativeBuildInputs = [ pkgconfig makeWrapper ];
+  buildInputs = [ lxc acl ];
 
   meta = with stdenv.lib; {
     description = "Daemon based on liblxc offering a REST API to manage containers";
diff --git a/pkgs/tools/admin/lxd/deps.nix b/pkgs/tools/admin/lxd/deps.nix
deleted file mode 100644
index e0f591a23d1..00000000000
--- a/pkgs/tools/admin/lxd/deps.nix
+++ /dev/null
@@ -1,165 +0,0 @@
-# This file was generated by https://github.com/kamilchm/go2nix v1.2.0
-[
-  {
-    goPackagePath = "github.com/dustinkirkland/golang-petname";
-    fetch = {
-      type = "git";
-      url = "https://github.com/dustinkirkland/golang-petname";
-      rev = "4f77bdee0b67a08d17afadc0d5a4a3d1cb7d8d14";
-      sha256 = "1cizm3xywsp9vc381k02dhjq5a6c772wc05w60m4gfdmp2kmd4di";
-    };
-  }
-  {
-    goPackagePath = "github.com/golang/protobuf";
-    fetch = {
-      type = "git";
-      url = "https://github.com/golang/protobuf";
-      rev = "2bba0603135d7d7f5cb73b2125beeda19c09f4ef";
-      sha256 = "1xy0bj66qks2xlzxzlfma16w7m8g6rrwawmlhlv68bcw2k5hvvib";
-    };
-  }
-  {
-    goPackagePath = "github.com/gorilla/mux";
-    fetch = {
-      type = "git";
-      url = "https://github.com/gorilla/mux";
-      rev = "599cba5e7b6137d46ddf58fb1765f5d928e69604";
-      sha256 = "0wd6jjii1kg5s0nk3ri6gqriz6hbd6bbcn6x4jf8n7ncrb8qsxyz";
-    };
-  }
-  {
-    goPackagePath = "github.com/gorilla/websocket";
-    fetch = {
-      type = "git";
-      url = "https://github.com/gorilla/websocket";
-      rev = "a91eba7f97777409bc2c443f5534d41dd20c5720";
-      sha256 = "13cg6wwkk2ddqbm0nh9fpx4mq7f6qym12ch4lvs53n028ycdgw87";
-    };
-  }
-  {
-    goPackagePath = "github.com/mattn/go-colorable";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mattn/go-colorable";
-      rev = "ded68f7a9561c023e790de24279db7ebf473ea80";
-      sha256 = "0q019h59jq815jfl9rgk4yrpkn5rpcx9s6dksdm48rp1abafwvfc";
-    };
-  }
-  {
-    goPackagePath = "github.com/mattn/go-sqlite3";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mattn/go-sqlite3";
-      rev = "cf7286f069c3ef596efcc87781a4653a2e7607bd";
-      sha256 = "19ipf6bf1xd7w2fm8dnv5my4jp3lhwhlrhfwhwq559amp1h4nwyq";
-    };
-  }
-  {
-    goPackagePath = "github.com/pborman/uuid";
-    fetch = {
-      type = "git";
-      url = "https://github.com/pborman/uuid";
-      rev = "1b00554d822231195d1babd97ff4a781231955c9";
-      sha256 = "0rjkcf85sagdwzsycj1bbjyx5bgmrc1i8l5qf1f44z24rhbbkaan";
-    };
-  }
-  {
-    goPackagePath = "github.com/syndtr/gocapability";
-    fetch = {
-      type = "git";
-      url = "https://github.com/syndtr/gocapability";
-      rev = "e7cb7fa329f456b3855136a2642b197bad7366ba";
-      sha256 = "1i65kyjhbaya45zj9zqkb17plbqf92sfvl9fcz9s9qslg0qab2i1";
-    };
-  }
-  {
-    goPackagePath = "golang.org/x/crypto";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/crypto";
-      rev = "3543873453996aaab2fc6b3928a35fc5ca2b5afb";
-      sha256 = "1d7pjqzh5893mzkz60bv5ypmr9zgyvb9z2gvcjrsqniwcqlhbk2c";
-    };
-  }
-  {
-    goPackagePath = "golang.org/x/net";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/net";
-      rev = "da118f7b8e5954f39d0d2130ab35d4bf0e3cb344";
-      sha256 = "09xpndqc6a2r0lw42cyl1pkhfddl01sd9c3qqjjwp3vmxm004whv";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/flosch/pongo2.v3";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/flosch/pongo2.v3";
-      rev = "5e81b817a0c48c1c57cdf1a9056cf76bdee02ca9";
-      sha256 = "0fd7d79644zmcirsb1gvhmh0l5vb5nyxmkzkvqpmzzcg6yfczph8";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/inconshreveable/log15.v2";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/inconshreveable/log15.v2";
-      rev = "b105bd37f74e5d9dc7b6ad7806715c7a2b83fd3f";
-      sha256 = "18rldvi60i7b3lljfrsqgcc24gdkw2pcixxydznyggaqhh96l6a8";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/lxc/go-lxc.v2";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/lxc/go-lxc.v2";
-      rev = "8304875cc3423823032ec93556beee076c6ba687";
-      sha256 = "12vrx9ilxkl1nxc5k81c6b2a1i715843r23fra681digdjnd8bpk";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/tomb.v2";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/tomb.v2";
-      rev = "d5d1b5820637886def9eef33e03a27a9f166942c";
-      sha256 = "1sv15sri99szkdz1bkh0ir46w9n8prrwx5hfai13nrhkawfyfy10";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/yaml.v2";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/yaml.v2";
-      rev = "cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b";
-      sha256 = "1hj2ag9knxflpjibck0n90jrhsrqz7qvad4qnif7jddyapi9bqzl";
-    };
-  }
-  {
-      goPackagePath = "github.com/gosexy/gettext";
-      fetch = {
-        type = "git";
-        url = "https://github.com/gosexy/gettext";
-        rev = "74466a0a0c4a62fea38f44aa161d4bbfbe79dd6b";
-        sha256 = "0asphx8nd7zmp88wk6aakk5292np7yw73akvfdvlvs9q5r5ahkgi";
-      };
-  }
-  {
-      goPackagePath = "github.com/olekukonko/tablewriter";
-      fetch = {
-        type = "git";
-        url = "https://github.com/olekukonko/tablewriter";
-        rev = "febf2d34b54a69ce7530036c7503b1c9fbfdf0bb";
-        sha256 = "1ir7bs4m5rk8v9vpycjj7mn6sc6j9wvxkd63i9b6fmrdsx9q0x4g";
-      };
-  }
-  {
-      goPackagePath = "github.com/mattn/go-runewidth";
-      fetch = {
-        type = "git";
-        url = "https://github.com/mattn/go-runewidth";
-        rev = "14207d285c6c197daabb5c9793d63e7af9ab2d50";
-        sha256 = "0y6yq9zd4kh7fimnc00r3h9pr2pwa5j85b3jcn5dyfamsnm2xdsv";
-      };
-  }
-]
diff --git a/pkgs/tools/admin/salt/default.nix b/pkgs/tools/admin/salt/default.nix
index b5056460225..4077c4fb9ec 100644
--- a/pkgs/tools/admin/salt/default.nix
+++ b/pkgs/tools/admin/salt/default.nix
@@ -8,19 +8,18 @@
 
 python2Packages.buildPythonApplication rec {
   pname = "salt";
-  version = "2017.7.2";
-  name = "${pname}-${version}";
+  version = "2017.7.4";
 
   src = python2Packages.fetchPypi {
     inherit pname version;
-    sha256 = "0h18zwp1w90rgxpmqgrmn9wp31h03f0vak8lpnnbh0dzbbgcffzz";
+    sha256 = "15xfvclk3ns8vk17j7bfy4alq7ab5x3y3jnpqzp5583bfyak0mqx";
   };
 
   propagatedBuildInputs = with python2Packages; [
     futures
     jinja2
     markupsafe
-    msgpack
+    msgpack-python
     pycrypto
     pyyaml
     pyzmq
diff --git a/pkgs/tools/compression/pbzx/default.nix b/pkgs/tools/compression/pbzx/default.nix
new file mode 100644
index 00000000000..bbba21f2b34
--- /dev/null
+++ b/pkgs/tools/compression/pbzx/default.nix
@@ -0,0 +1,27 @@
+{stdenv, lib, fetchFromGitHub, lzma, xar}:
+
+stdenv.mkDerivation rec {
+  pname = "pbzx";
+  version = "1.0.2";
+  name = "${pname}-${version}";
+  src = fetchFromGitHub {
+    owner = "NiklasRosenstein";
+    repo = "pbzx";
+    rev = "v${version}";
+    sha256 = "0bwd7wmnhpz1n5p39mh6asfyccj4cm06hwigslcwbb3pdwmvxc90";
+  };
+  buildInputs = [ lzma xar ];
+  buildPhase = ''
+    cc pbzx.c -llzma -lxar -o pbzx
+  '';
+  installPhase = ''
+    mkdir -p $out/bin
+    cp pbzx $out/bin
+  '';
+  meta = with lib; {
+    description = "Stream parser of Apple's pbzx compression format.";
+    platforms = platforms.unix;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.matthewbauer ];
+  };
+}
diff --git a/pkgs/tools/filesystems/extundelete/default.nix b/pkgs/tools/filesystems/extundelete/default.nix
index a30709d4c92..e0c5ea3def4 100644
--- a/pkgs/tools/filesystems/extundelete/default.nix
+++ b/pkgs/tools/filesystems/extundelete/default.nix
@@ -11,6 +11,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ e2fsprogs ];
 
+  # inode field i_dir_acl was repurposed as i_size_high in e2fsprogs 1.44,
+  # breaking the build
+  patchPhase = ''
+    substituteInPlace src/insertionops.cc \
+      --replace "Directory ACL:" "High 32 bits of size:" \
+      --replace "inode.i_dir_acl" "inode.i_size_high"
+  '';
+
   meta = with stdenv.lib; {
     description = "Utility that can recover deleted files from an ext3 or ext4 partition";
     homepage = http://extundelete.sourceforge.net/;
diff --git a/pkgs/tools/filesystems/mergerfs/default.nix b/pkgs/tools/filesystems/mergerfs/default.nix
index 6f239bfa127..16e6db8e4f7 100644
--- a/pkgs/tools/filesystems/mergerfs/default.nix
+++ b/pkgs/tools/filesystems/mergerfs/default.nix
@@ -1,21 +1,28 @@
-{ stdenv, fetchgit, autoconf, automake, pkgconfig, gettext, libtool, git, pandoc, which, attr, libiconv }:
+{ stdenv, fetchFromGitHub, automake, autoconf, pkgconfig, gettext, libtool, pandoc, which, attr, libiconv }:
 
 stdenv.mkDerivation rec {
   name = "mergerfs-${version}";
-  version = "2.24.0";
+  version = "2.24.2";
 
-  # not using fetchFromGitHub because of changelog being built with git log
-  src = fetchgit {
-    url = "https://github.com/trapexit/mergerfs";
-    rev = "refs/tags/${version}";
-    sha256 = "12ci1i5zkarl1rz0pq1ldw0fpp4yfj8vz36jij63am7w7gp7qly2";
-    deepClone = true;
-    leaveDotGit = true;
+  src = fetchFromGitHub {
+    owner = "trapexit";
+    repo = "mergerfs";
+    rev = version;
+    sha256 = "0i65v7900s7c9jkj3a4v44vf3r5mvjkbcic3df940nmk0clahhcs";
   };
 
-  nativeBuildInputs = [ autoconf automake pkgconfig gettext libtool git pandoc which ];
+  nativeBuildInputs = [
+    automake autoconf pkgconfig gettext libtool pandoc which
+  ];
   buildInputs = [ attr libiconv ];
 
+  preConfigure = ''
+    cat > src/version.hpp <<EOF
+    #pragma once
+    static const char MERGERFS_VERSION[] = "${version}";
+    EOF
+  '';
+
   makeFlags = [ "PREFIX=$(out)" "XATTR_AVAILABLE=1" ];
 
   meta = {
diff --git a/pkgs/tools/misc/contacts/default.nix b/pkgs/tools/misc/contacts/default.nix
index d146cd93343..47a74e84b55 100644
--- a/pkgs/tools/misc/contacts/default.nix
+++ b/pkgs/tools/misc/contacts/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     mkdir -p $out/bin
-    cp ./contacts-*/Build/Products/Default/contacts $out/bin
+    cp Products/Default/contacts $out/bin
   '';
 
   ## FIXME: the framework setup hook isn't adding these correctly
diff --git a/pkgs/tools/misc/quota/default.nix b/pkgs/tools/misc/linuxquota/default.nix
index dfcefe09200..dfcefe09200 100644
--- a/pkgs/tools/misc/quota/default.nix
+++ b/pkgs/tools/misc/linuxquota/default.nix
diff --git a/pkgs/tools/misc/lolcat/Gemfile.lock b/pkgs/tools/misc/lolcat/Gemfile.lock
index a97f1eb9c87..1ef7e552796 100644
--- a/pkgs/tools/misc/lolcat/Gemfile.lock
+++ b/pkgs/tools/misc/lolcat/Gemfile.lock
@@ -1,9 +1,11 @@
 GEM
   remote: http://rubygems.org/
   specs:
-    lolcat (90.8.8)
+    lolcat (99.9.10)
+      manpages (~> 0.6.1)
       paint (~> 2.0.0)
       trollop (~> 2.1.2)
+    manpages (0.6.1)
     paint (2.0.1)
     trollop (2.1.2)
 
diff --git a/pkgs/tools/misc/lolcat/gemset.nix b/pkgs/tools/misc/lolcat/gemset.nix
index 6d0962780f4..78677edcc34 100644
--- a/pkgs/tools/misc/lolcat/gemset.nix
+++ b/pkgs/tools/misc/lolcat/gemset.nix
@@ -1,12 +1,20 @@
 {
   lolcat = {
-    dependencies = ["paint" "trollop"];
+    dependencies = ["manpages" "paint" "trollop"];
     source = {
       remotes = ["http://rubygems.org"];
-      sha256 = "1q031wq8wvp09llb39w0ql5k1zkblvkbmhlvrkc3ym832pibk06f";
+      sha256 = "0fidwmgywkklxf2a4f4dl82b8mx4w4n73vqm6jqgyqd3nfmgysnl";
       type = "gem";
     };
-    version = "90.8.8";
+    version = "99.9.10";
+  };
+  manpages = {
+    source = {
+      remotes = ["http://rubygems.org"];
+      sha256 = "11p6ilnfda6af15ks3xiz2pr0hkvdvadnk1xm4ahqlf84dld3fnd";
+      type = "gem";
+    };
+    version = "0.6.1";
   };
   paint = {
     source = {
diff --git a/pkgs/tools/misc/ostree/default.nix b/pkgs/tools/misc/ostree/default.nix
index 3b220153f17..a437eba4957 100644
--- a/pkgs/tools/misc/ostree/default.nix
+++ b/pkgs/tools/misc/ostree/default.nix
@@ -7,8 +7,8 @@ let
   libglnx-src = fetchFromGitHub {
     owner  = "GNOME";
     repo   = "libglnx";
-    rev    = "5362f6bc3ff3e30f379e767b203d15c9e56d6f08";
-    sha256 = "1l4vm7bx3cf4q44n3a1i2gszyryqyimcxvx54gna72q7dw130mrr";
+    rev    = "0c82203cd459a35cc3f471e3205355e9fb79160f";
+    sha256 = "0xbrv7q6b2ygrbr0yr7p01zpryw45643qfwnlw0z2yv515qs7isc";
   };
 
   bsdiff-src = fetchFromGitHub {
@@ -18,7 +18,7 @@ let
     sha256 = "1h71d2h2d3anp4msvpaff445rnzdxii3id2yglqk7af9i43kdsn1";
   };
 
-  version = "2017.12";
+  version = "2018.4";
 in stdenv.mkDerivation {
   name = "ostree-${version}";
 
@@ -26,7 +26,7 @@ in stdenv.mkDerivation {
     rev    = "v${version}";
     owner  = "ostreedev";
     repo   = "ostree";
-    sha256 = "0gxvpzwz7z4zihz5hkn6ajv7f6gas4zi2pznhi5v6wy7cw06if68";
+    sha256 = "00jgj6vcjpz1akfbmf82q1bcs3njrmvdgy4c2gnn24vkmh9yr0lr";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/tools/misc/peruse/default.nix b/pkgs/tools/misc/peruse/default.nix
index a3fdca001d9..38cab5cf862 100644
--- a/pkgs/tools/misc/peruse/default.nix
+++ b/pkgs/tools/misc/peruse/default.nix
@@ -1,37 +1,30 @@
 {
   mkDerivation, fetchFromGitHub, fetchurl, lib,
   extra-cmake-modules, kdoctools, wrapGAppsHook,
-  baloo, karchive, kconfig, kcrash, kfilemetadata, kinit, kirigami, knewstuff, plasma-framework
+  baloo, karchive, kconfig, kcrash, kfilemetadata, kinit, kirigami2, knewstuff, plasma-framework
 }:
 
 let
   pname = "peruse";
-  version = "1.2";
-  unarr = fetchFromGitHub {
-    owner  = "zeniko";
-    repo   = "unarr";
-    rev    = "d1be8c43a82a4320306c8e835a86fdb7b2574ca7";
-    sha256 = "03ds5da69zipa25rsp76l6xqivrh3wcgygwyqa5x2rgcz3rjnlpr";
-  };
+  version = "1.2.20180219";
+
 in mkDerivation rec {
   name = "${pname}-${version}";
 
-  src = fetchurl {
-    url = "mirror://kde/stable/${pname}/${name}.tar.xz";
-    sha256 = "1ik2627xynkichsq9x28rkczqn3l3p06q6vw5jdafdh3hisccmjq";
+  # The last formal release from 2016 uses kirigami1 which is deprecated
+  src = fetchFromGitHub {
+    owner  = "KDE";
+    repo   = pname;
+    rev    = "4125d3149c45d196600258686610de701130113d";
+    sha256 = "1x8in7z17gzgiibshw7xfs6m6bhr3n5fys3nlpab77nm0dl3f4r5";
   };
 
   nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook ];
 
-  propagatedBuildInputs = [ baloo karchive kconfig kcrash kfilemetadata kinit kirigami knewstuff plasma-framework ];
+  propagatedBuildInputs = [ baloo karchive kconfig kcrash kfilemetadata kinit kirigami2 knewstuff plasma-framework ];
 
   pathsToLink = [ "/etc/xdg/peruse.knsrc"];
 
-  preConfigure = ''
-    rm -rf src/qtquick/karchive-rar/external/unarr
-    ln -s ${unarr} src/qtquick/karchive-rar/external/unarr
-  '';
-
   meta = with lib; {
     license = licenses.gpl2;
     maintainers = with maintainers; [ peterhoeg ];
diff --git a/pkgs/tools/misc/pick/default.nix b/pkgs/tools/misc/pick/default.nix
index 0afd28b3c91..45b0da6f8db 100644
--- a/pkgs/tools/misc/pick/default.nix
+++ b/pkgs/tools/misc/pick/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "pick-${version}";
-  version = "2.0.1";
+  version = "2.0.2";
 
   src = fetchFromGitHub {
     owner = "calleerlandsson";
     repo = "pick";
     rev = "v${version}";
-    sha256 = "0ypawbzpw188rxgv8x044iib3a517j5grgqnxy035ax5zzjavsrr";
+    sha256 = "0wm3220gqrwldiq0rjdraq5mw3i7d58zwzls8234sx9maf59h0k0";
   };
 
   buildInputs = [ ncurses ];
diff --git a/pkgs/tools/networking/mailutils/default.nix b/pkgs/tools/networking/mailutils/default.nix
index c85aaea6f3b..26bfd27bf9a 100644
--- a/pkgs/tools/networking/mailutils/default.nix
+++ b/pkgs/tools/networking/mailutils/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, fetchpatch, autoreconfHook, dejagnu, gettext, pkgconfig
 , gdbm, pam, readline, ncurses, gnutls, guile, texinfo, gnum4, sasl, fribidi, nettools
-, python, gss, mysql }:
+, python, gss, mysql, sendmailPath ? "/run/wrappers/bin/sendmail" }:
 
 let
   p = "https://raw.githubusercontent.com/gentoo/gentoo/9c921e89d51876fd876f250324893fd90c019326/net-mail/mailutils/files";
@@ -41,6 +41,7 @@ in stdenv.mkDerivation rec {
     "--with-gssapi"
     "--with-gsasl"
     "--with-mysql"
+    "--with-path-sendmail=${sendmailPath}"
   ];
 
   readmsg-tests = stdenv.lib.optionals doCheck [
diff --git a/pkgs/tools/networking/miniupnpd/default.nix b/pkgs/tools/networking/miniupnpd/default.nix
index a9e67701eb0..129db56dc55 100644
--- a/pkgs/tools/networking/miniupnpd/default.nix
+++ b/pkgs/tools/networking/miniupnpd/default.nix
@@ -3,11 +3,11 @@
 assert stdenv.isLinux;
 
 stdenv.mkDerivation rec {
-  name = "miniupnpd-2.0.20180222";
+  name = "miniupnpd-2.0.20180410";
 
   src = fetchurl {
     url = "http://miniupnp.free.fr/files/download.php?file=${name}.tar.gz";
-    sha256 = "1hdpyvz1z6crpa7as3srmbl64fx0k4wjra57jw7qaysdsb1b2kqr";
+    sha256 = "1w4crmsmrygagh0v9phx8aicbyh6nypfjh2fdmknijngvx05biaq";
     name = "${name}.tar.gz";
   };
 
diff --git a/pkgs/tools/networking/shadowsocks-libev/default.nix b/pkgs/tools/networking/shadowsocks-libev/default.nix
index 46fd9e54950..cbbc36b383b 100644
--- a/pkgs/tools/networking/shadowsocks-libev/default.nix
+++ b/pkgs/tools/networking/shadowsocks-libev/default.nix
@@ -1,47 +1,32 @@
-{ withMbedTLS ? true
-, enableSystemSharedLib ? true
-, stdenv, fetchurl, zlib
-, openssl ? null
-, mbedtls ? null
-, libev ? null
-, libsodium ? null
-, udns ? null
-, asciidoc
-, xmlto
-, docbook_xml_dtd_45
-, docbook_xsl
-, libxslt
-, pcre
+{ stdenv, fetchurl, fetchgit, cmake
+, libsodium, mbedtls, libev, c-ares, pcre
+, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt
 }:
 
-let
-
-  version = "2.5.5";
-  sha256 = "46a72367b7301145906185f1e4136e39d6792d27643826e409ab708351b6d0dd";
-
-in
-
-with stdenv.lib;
-
 stdenv.mkDerivation rec {
   name = "shadowsocks-libev-${version}";
-  src = fetchurl {
-    url = "https://github.com/shadowsocks/shadowsocks-libev/archive/v${version}.tar.gz";
-    inherit sha256;
+  version = "3.1.3";
+
+  # Git tag includes CMake build files which are much more convenient.
+  # fetchgit because submodules.
+  src = fetchgit {
+    url = "https://github.com/shadowsocks/shadowsocks-libev";
+    rev = "refs/tags/v${version}";
+    sha256 = "16q91xh6ixfv7b5rl31an11101irv08119klfx5qgj4i6h7c41s7";
   };
 
-  buildInputs = [ zlib asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt pcre ]
-                ++ optional (!withMbedTLS) openssl
-                ++ optional withMbedTLS mbedtls
-                ++ optionals enableSystemSharedLib [libev libsodium udns];
+  buildInputs = [ libsodium mbedtls libev c-ares pcre ];
+  nativeBuildInputs = [ cmake asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt ];
+
+  cmakeFlags = [ "-DWITH_STATIC=OFF" ];
 
-  configureFlags = optional withMbedTLS
-                     [ "--with-crypto-library=mbedtls"
-                       "--with-mbedtls=${mbedtls}"
-                     ]
-                   ++ optional enableSystemSharedLib "--enable-system-shared-lib";
+  postInstall = ''
+    cp lib/* $out/lib
+    chmod +x $out/bin/*
+    mv $out/pkgconfig $out/lib
+  '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A lightweight secured SOCKS5 proxy";
     longDescription = ''
       Shadowsocks-libev is a lightweight secured SOCKS5 proxy for embedded devices and low-end boxes.
@@ -50,6 +35,6 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/shadowsocks/shadowsocks-libev;
     license = licenses.gpl3Plus;
     maintainers = [ maintainers.nfjinjing ];
-    platforms = platforms.all;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/tools/security/pinentry-mac/default.nix b/pkgs/tools/security/pinentry-mac/default.nix
index 074d71c0830..e555889d1ab 100644
--- a/pkgs/tools/security/pinentry-mac/default.nix
+++ b/pkgs/tools/security/pinentry-mac/default.nix
@@ -12,11 +12,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ xcbuild libiconv Cocoa ncurses ];
 
-  dontUseXcbuild = true;
-
   installPhase = ''
     mkdir -p $out/Applications
-    mv pinentry-mac-*/Build/Products/Release/pinentry-mac.app $out/Applications
+    mv Products/Release/pinentry-mac.app $out/Applications
   '';
 
   passthru = {
diff --git a/pkgs/tools/security/scallion/default.nix b/pkgs/tools/security/scallion/default.nix
new file mode 100644
index 00000000000..75ea92a786c
--- /dev/null
+++ b/pkgs/tools/security/scallion/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, makeWrapper, mono, openssl, ocl-icd }:
+
+stdenv.mkDerivation rec {
+  version = "2.1";
+  name = "scallion-${version}";
+
+  src = fetchFromGitHub {
+    owner = "lachesis";
+    repo = "scallion";
+    rev = "v${version}";
+    sha256 = "1l9aj101xpsaaa6kmmhmq68m6z8gzli1iaaf8xaxbivq0i7vka9k";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ mono ];
+
+  buildPhase = ''
+    xbuild scallion.sln
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share
+    cp scallion/bin/Debug/* $out/share/
+    makeWrapper ${mono}/bin/mono $out/bin/scallion \
+      --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ openssl ocl-icd ]} \
+      --add-flags $out/share/scallion.exe
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GPU-based tor hidden service name generator";
+    homepage = src.meta.homepage;
+    license = licenses.mit;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ volth ];
+  };
+}
diff --git a/pkgs/tools/system/efivar/default.nix b/pkgs/tools/system/efivar/default.nix
index 7f20e813501..45882044094 100644
--- a/pkgs/tools/system/efivar/default.nix
+++ b/pkgs/tools/system/efivar/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "efivar-${version}";
-  version = "34";
+  version = "35";
 
   src = fetchFromGitHub {
     owner = "rhinstaller";
     repo = "efivar";
     rev = version;
-    sha256 = "0ycrdaz0ijkm3xb9fnwzhwi0pdj5c6s636wj4i6lbjbrijbzn4x5";
+    sha256 = "0hc7l5z0hw5472bm6p4d9n24bbggv9lgw7px1hqrdkfjghqfnlxh";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/tools/system/gotop/default.nix b/pkgs/tools/system/gotop/default.nix
new file mode 100644
index 00000000000..2244f5c90d3
--- /dev/null
+++ b/pkgs/tools/system/gotop/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "gotop-${version}";
+  version = "1.2.9";
+
+  goPackagePath = "github.com/cjbassi/gotop";
+
+  src = fetchFromGitHub {
+    repo = "gotop";
+    owner = "cjbassi";
+    rev = version;
+    sha256 = "07s2f04yhc79vqr1gdh2v974kpn7flp4slnp99mavpa331lv9q8a";
+  };
+
+  meta = with stdenv.lib; {
+    description = "A terminal based graphical activity monitor inspired by gtop and vtop";
+    homepage = https://github.com/cjbassi/gotop;
+    license = licenses.agpl3;
+    maintainers = [ maintainers.magnetophon ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/typesetting/asciidoctor/Gemfile b/pkgs/tools/typesetting/asciidoctor/Gemfile
index 92abd4f5cf2..54509c601e3 100644
--- a/pkgs/tools/typesetting/asciidoctor/Gemfile
+++ b/pkgs/tools/typesetting/asciidoctor/Gemfile
@@ -4,4 +4,6 @@ gem 'asciidoctor-diagram'
 gem 'asciidoctor-bespoke'
 gem 'asciidoctor-pdf'
 gem 'asciidoctor-latex'
+gem 'asciidoctor-mathematical'
+gem 'coderay'
 gem 'pygments.rb'
diff --git a/pkgs/tools/typesetting/asciidoctor/Gemfile.lock b/pkgs/tools/typesetting/asciidoctor/Gemfile.lock
index 25800ed3a1c..6c52a2c416a 100644
--- a/pkgs/tools/typesetting/asciidoctor/Gemfile.lock
+++ b/pkgs/tools/typesetting/asciidoctor/Gemfile.lock
@@ -1,82 +1,93 @@
 GEM
   remote: https://rubygems.org/
   specs:
-    Ascii85 (1.0.2)
-    addressable (2.5.0)
-      public_suffix (~> 2.0, >= 2.0.2)
+    Ascii85 (1.0.3)
+    addressable (2.5.2)
+      public_suffix (>= 2.0.2, < 4.0)
     afm (0.2.2)
-    asciidoctor (1.5.6.1)
+    asciidoctor (1.5.6.2)
     asciidoctor-bespoke (1.0.0.alpha.1)
       asciidoctor (>= 1.5.0)
       slim (~> 3.0.6)
       thread_safe (~> 0.3.5)
-    asciidoctor-diagram (1.5.4)
+    asciidoctor-diagram (1.5.9)
       asciidoctor (~> 1.5.0)
     asciidoctor-latex (1.5.0.17.dev)
       asciidoctor (~> 1.5, >= 1.5.2)
       htmlentities (~> 4.3)
       opal (~> 0.6.3)
+    asciidoctor-mathematical (0.2.2)
+      asciidoctor (~> 1.5, >= 1.5.0)
+      mathematical (~> 1.5, >= 1.5.8)
+      ruby-enum (~> 0.4)
     asciidoctor-pdf (1.5.0.alpha.16)
       asciidoctor (>= 1.5.0)
-      prawn (>= 1.3.0, < 3.0.0)
-      prawn-icon (= 1.2.0)
-      prawn-svg (>= 0.21.0, < 0.26.0)
+      prawn (>= 1.3.0, < 2.3.0)
+      prawn-icon (= 1.3.0)
+      prawn-svg (>= 0.21.0, < 0.28.0)
       prawn-table (= 0.2.2)
-      prawn-templates (= 0.0.3)
+      prawn-templates (>= 0.0.3, <= 0.1.1)
       safe_yaml (~> 1.0.4)
-      thread_safe (~> 0.3.5)
+      thread_safe (~> 0.3.6)
       treetop (= 1.5.3)
-    concurrent-ruby (1.0.4)
-    css_parser (1.4.8)
+    coderay (1.1.2)
+    concurrent-ruby (1.0.5)
+    css_parser (1.6.0)
       addressable
     hashery (2.1.2)
     htmlentities (4.3.4)
-    json (2.0.3)
-    multi_json (1.12.1)
+    i18n (1.0.0)
+      concurrent-ruby (~> 1.0)
+    json (2.1.0)
+    mathematical (1.6.11)
+      ruby-enum (~> 0.4)
+    multi_json (1.13.1)
     opal (0.6.3)
       source_map
       sprockets
-    pdf-core (0.6.1)
-    pdf-reader (1.4.1)
+    pdf-core (0.7.0)
+    pdf-reader (2.1.0)
       Ascii85 (~> 1.0.0)
       afm (~> 0.2.1)
       hashery (~> 2.0)
       ruby-rc4
       ttfunk
     polyglot (0.3.5)
-    prawn (2.1.0)
-      pdf-core (~> 0.6.1)
-      ttfunk (~> 1.4.0)
-    prawn-icon (1.2.0)
+    prawn (2.2.2)
+      pdf-core (~> 0.7.0)
+      ttfunk (~> 1.5)
+    prawn-icon (1.3.0)
       prawn (>= 1.1.0, < 3.0.0)
-    prawn-svg (0.25.2)
+    prawn-svg (0.27.1)
       css_parser (~> 1.3)
       prawn (>= 0.11.1, < 3)
     prawn-table (0.2.2)
       prawn (>= 1.3.0, < 3.0.0)
-    prawn-templates (0.0.3)
-      pdf-reader (~> 1.3)
-      prawn (>= 0.15.0)
-    public_suffix (2.0.5)
-    pygments.rb (1.1.1)
+    prawn-templates (0.1.1)
+      pdf-reader (~> 2.0)
+      prawn (~> 2.2)
+    public_suffix (3.0.2)
+    pygments.rb (1.2.1)
       multi_json (>= 1.0.0)
-    rack (2.0.1)
+    rack (2.0.4)
+    ruby-enum (0.7.2)
+      i18n
     ruby-rc4 (0.1.5)
     safe_yaml (1.0.4)
-    slim (3.0.7)
-      temple (~> 0.7.6)
+    slim (3.0.9)
+      temple (>= 0.7.6, < 0.9)
       tilt (>= 1.3.3, < 2.1)
     source_map (3.0.1)
       json
     sprockets (3.7.1)
       concurrent-ruby (~> 1.0)
       rack (> 1, < 3)
-    temple (0.7.7)
-    thread_safe (0.3.5)
-    tilt (2.0.6)
+    temple (0.8.0)
+    thread_safe (0.3.6)
+    tilt (2.0.8)
     treetop (1.5.3)
       polyglot (~> 0.3)
-    ttfunk (1.4.0)
+    ttfunk (1.5.1)
 
 PLATFORMS
   ruby
@@ -86,8 +97,10 @@ DEPENDENCIES
   asciidoctor-bespoke
   asciidoctor-diagram
   asciidoctor-latex
+  asciidoctor-mathematical
   asciidoctor-pdf
+  coderay
   pygments.rb
 
 BUNDLED WITH
-   1.13.6
+   1.14.6
diff --git a/pkgs/tools/typesetting/asciidoctor/default.nix b/pkgs/tools/typesetting/asciidoctor/default.nix
index 02b57ee3a13..f8cfe44cbd7 100644
--- a/pkgs/tools/typesetting/asciidoctor/default.nix
+++ b/pkgs/tools/typesetting/asciidoctor/default.nix
@@ -1,4 +1,8 @@
-{ stdenv, lib, bundlerApp, ruby, curl }:
+{ stdenv, lib, bundlerApp, ruby, curl
+  # Dependencies of the 'mathematical' package
+, cmake, bison, flex, glib, pkgconfig, cairo
+, pango, gdk_pixbuf, libxml2, python3, patchelf
+}:
 
 bundlerApp {
   inherit ruby;
@@ -11,8 +15,37 @@ bundlerApp {
     "asciidoctor-latex"
     "asciidoctor-pdf"
     "asciidoctor-safe"
+    "asciidoctor-mathematical"
   ];
 
+  gemConfig = {
+    mathematical = attrs: {
+      buildInputs = [
+        cmake
+        bison
+        flex
+        glib
+        pkgconfig
+        cairo
+        pango
+        gdk_pixbuf
+        libxml2
+        python3
+      ];
+
+      # The ruby build script takes care of this
+      dontUseCmakeConfigure = true;
+
+      # For some reason 'mathematical.so' is missing cairo and glib in its RPATH, add them explicitly here
+      postFixup = lib.optionalString stdenv.isLinux ''
+        soPath="$out/lib/ruby/gems/2.4.0/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"
+        ${patchelf}/bin/patchelf \
+          --set-rpath "${lib.makeLibraryPath [ glib cairo ]}:$(${patchelf}/bin/patchelf --print-rpath "$soPath")" \
+          "$soPath"
+      '';
+    };
+  };
+
   meta = with lib; {
     description = "A faster Asciidoc processor written in Ruby";
     homepage = http://asciidoctor.org/;
diff --git a/pkgs/tools/typesetting/asciidoctor/gemset.nix b/pkgs/tools/typesetting/asciidoctor/gemset.nix
index 43011b22b76..4ae146d289b 100644
--- a/pkgs/tools/typesetting/asciidoctor/gemset.nix
+++ b/pkgs/tools/typesetting/asciidoctor/gemset.nix
@@ -1,11 +1,12 @@
 {
   addressable = {
+    dependencies = ["public_suffix"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1j5r0anj8m4qlf2psnldip4b8ha2bsscv11lpdgnfh4nnchzjnxw";
+      sha256 = "0viqszpkggqi8hq87pqp0xykhvz60g99nwmkwsb0v45kc2liwxvk";
       type = "gem";
     };
-    version = "2.5.0";
+    version = "2.5.2";
   };
   afm = {
     source = {
@@ -18,20 +19,21 @@
   Ascii85 = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0j95sbxd18kc8rhcnvl1w37kflqpax1r12h1x47gh4xxn3mz4m7q";
+      sha256 = "0658m37jjjn6drzqg1gk4p6c205mgp7g1jh2d00n4ngghgmz5qvs";
       type = "gem";
     };
-    version = "1.0.2";
+    version = "1.0.3";
   };
   asciidoctor = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "c4371c419306d69152809eb896c291ca09969dc26ca34be36f4eab82914fceca";
+      sha256 = "0zq3az4836nxkc8g5wnnbzmarw7663s1ky6gf8pc04sfpa8n2l3f";
       type = "gem";
     };
-    version = "1.5.6.1";
+    version = "1.5.6.2";
   };
   asciidoctor-bespoke = {
+    dependencies = ["asciidoctor" "slim" "thread_safe"];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1awy933sswxvi2hxpll3rh9phxcvmqhrbb91m6ibjchnf7qsl3zk";
@@ -40,14 +42,16 @@
     version = "1.0.0.alpha.1";
   };
   asciidoctor-diagram = {
+    dependencies = ["asciidoctor"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "06kqlij2yc84zqxmb39bqi9pihapgac7gxyzrwm4kxfnmfdqmxrk";
+      sha256 = "0rj02i00d9hkzqzzrk5al9rn8yv5x0wsnrv9y6j4k8rfylm69c1r";
       type = "gem";
     };
-    version = "1.5.4";
+    version = "1.5.9";
   };
   asciidoctor-latex = {
+    dependencies = ["asciidoctor" "htmlentities" "opal"];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "02qvn1ngp4s9y22vk23zzssd4w1bpyk84akjwiq6nqn8im6s4awz";
@@ -55,29 +59,48 @@
     };
     version = "1.5.0.17.dev";
   };
+  asciidoctor-mathematical = {
+    dependencies = ["asciidoctor" "mathematical" "ruby-enum"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "18igbvs70dnlrzgl62jcc0vfxhlb4r7v9bq3qf1v80l17lvq1x8f";
+      type = "gem";
+    };
+    version = "0.2.2";
+  };
   asciidoctor-pdf = {
+    dependencies = ["asciidoctor" "prawn" "prawn-icon" "prawn-svg" "prawn-table" "prawn-templates" "safe_yaml" "thread_safe" "treetop"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0f6b2a1533577dfba218de5dd886771447e4d1cb670b81d2c3bf3a180e6029a1";
+      sha256 = "1899c071hfmzqg9822v7rg8y8iqlfy3dhpfy32ignzap6cajlsqg";
       type = "gem";
     };
     version = "1.5.0.alpha.16";
   };
+  coderay = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "15vav4bhcc2x3jmi3izb11l4d9f3xv8hp2fszb7iqmpsccv1pz4y";
+      type = "gem";
+    };
+    version = "1.1.2";
+  };
   concurrent-ruby = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0p7ji1h1l407kci9w4b4yspzd58ssmlx7p91npx55kw08836dlpb";
+      sha256 = "183lszf5gx84kcpb779v6a2y0mx9sssy8dgppng1z9a505nj1qcf";
       type = "gem";
     };
-    version = "1.0.4";
+    version = "1.0.5";
   };
   css_parser = {
+    dependencies = ["addressable"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1aqv5ds1109s0g76ybvvaff41a71i03fjy0ix6272r8n0gdnjc3f";
+      sha256 = "0gwvf8mc8gnz4aizfijplv3594998h2j44ydakpzsdmkivs07v61";
       type = "gem";
     };
-    version = "1.4.8";
+    version = "1.6.0";
   };
   hashery = {
     source = {
@@ -95,23 +118,42 @@
     };
     version = "4.3.4";
   };
+  i18n = {
+    dependencies = ["concurrent-ruby"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "191c2xzlvn42sb8dz6gjy0qaigri4chfvflg3d4k6n58flm0yp65";
+      type = "gem";
+    };
+    version = "1.0.0";
+  };
   json = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0cpw154il64w6q20rrnsbjx1cdfz1yrzz1lgdbpn59lcwc6mprql";
+      sha256 = "01v6jjpvh3gnq6sgllpfqahlgxzj50ailwhj9b3cd20hi2dx0vxp";
+      type = "gem";
+    };
+    version = "2.1.0";
+  };
+  mathematical = {
+    dependencies = ["ruby-enum"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "06xkr613hmzbhmm6zv92zlcjyfp0a6i2b3q3hg24lmj4j5l85p21";
       type = "gem";
     };
-    version = "2.0.3";
+    version = "1.6.11";
   };
   multi_json = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1wpc23ls6v2xbk3l1qncsbz16npvmw8p0b38l8czdzri18mp51xk";
+      sha256 = "1rl0qy4inf1mp8mybfk56dfga0mvx97zwpmq5xmiwl5r770171nv";
       type = "gem";
     };
-    version = "1.12.1";
+    version = "1.13.1";
   };
   opal = {
+    dependencies = ["source_map" "sprockets"];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0dmdxhmg43ibd4bsldssslsz8870hzknwcxiv9l1838lh6hd390k";
@@ -122,18 +164,19 @@
   pdf-core = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1s0h0kkddkivgpf7k1jni9nzqxw09d9bgcsvyga407ixbiipkgfy";
+      sha256 = "19llwch2wfg51glb0kff0drfp3n6nb9vim4zlvzckxysksvxpby1";
       type = "gem";
     };
-    version = "0.6.1";
+    version = "0.7.0";
   };
   pdf-reader = {
+    dependencies = ["Ascii85" "afm" "hashery" "ruby-rc4" "ttfunk"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0ivmgm73jjk3hv7896mgld5ki8jhxdvksw766rqxp6i863y9v4jq";
+      sha256 = "1b3ig4wpcgdbqa7yw0ahwbmikkkywn2a22bfmrknl5ls7g066x45";
       type = "gem";
     };
-    version = "1.4.1";
+    version = "2.1.0";
   };
   polyglot = {
     source = {
@@ -144,30 +187,34 @@
     version = "0.3.5";
   };
   prawn = {
+    dependencies = ["pdf-core" "ttfunk"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "18f99v3r0jzym38s68hr0y8anrilv98shmsdf763ascd0gc5dj2n";
+      sha256 = "1qdjf1v6sfl44g3rqxlg8k4jrzkwaxgvh2l4xws97a8f3xv4na4m";
       type = "gem";
     };
-    version = "2.1.0";
+    version = "2.2.2";
   };
   prawn-icon = {
+    dependencies = ["prawn"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "101npavqvv5w44vgphlkqn3gdawxmsnd4j8bk6lzbxz7niqgaqny";
+      sha256 = "1pz8n7ajkfmflw05dib2l9qkzkfzwwbzx63qcvjr14k1dnbpx7qk";
       type = "gem";
     };
-    version = "1.2.0";
+    version = "1.3.0";
   };
   prawn-svg = {
+    dependencies = ["css_parser" "prawn"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "19zc7i6jxycs9m00frvv9g3x98sgzsyb1xf1xnn3h1ki574ibnip";
+      sha256 = "0fykcs10q2j6h04riav1kzrw77mga6gh1rxbh7q0ab6gkr0wamzx";
       type = "gem";
     };
-    version = "0.25.2";
+    version = "0.27.1";
   };
   prawn-table = {
+    dependencies = ["prawn"];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1nxd6qmxqwl850icp18wjh5k0s3amxcajdrkjyzpfgq0kvilcv9k";
@@ -176,36 +223,47 @@
     version = "0.2.2";
   };
   prawn-templates = {
+    dependencies = ["pdf-reader" "prawn"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0d14sq01c5zn0ywzazwcz6lkk235za36km53wqbf1bqabdb1ls10";
+      sha256 = "1gs894sj9zdlwx59h3rk4p0l3y8r18p22zhnfiyx9lngsa56gcrj";
       type = "gem";
     };
-    version = "0.0.3";
+    version = "0.1.1";
   };
   public_suffix = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "040jf98jpp6w140ghkhw2hvc1qx41zvywx5gj7r2ylr1148qnj7q";
+      sha256 = "1x5h1dh1i3gwc01jbg01rly2g6a1qwhynb1s8a30ic507z1nh09s";
       type = "gem";
     };
-    version = "2.0.5";
+    version = "3.0.2";
   };
   "pygments.rb" = {
+    dependencies = ["multi_json"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0g0ipgxqfw0vf2md3s8sqf8y7m5lxqza2gwnr05z3vrf1nc6v6hk";
+      sha256 = "0lbvnwvz770ambm4d6lxgc2097rydn5rcc5d6986bnkzyxfqqjnv";
       type = "gem";
     };
-    version = "1.1.1";
+    version = "1.2.1";
   };
   rack = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "053bqbrxr5gjw5k3rrmh6i35s83kgdycxv292lid072vpwrq1xv1";
+      sha256 = "1mfriw2r2913dv8qf3p87n7yal3qfsrs478x2qz106v8vhmxa017";
       type = "gem";
     };
-    version = "2.0.1";
+    version = "2.0.4";
+  };
+  ruby-enum = {
+    dependencies = ["i18n"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0h62avini866kxpjzqxlqnajma3yvj0y25l6hn9h2mv5pp6fcrhx";
+      type = "gem";
+    };
+    version = "0.7.2";
   };
   ruby-rc4 = {
     source = {
@@ -224,14 +282,16 @@
     version = "1.0.4";
   };
   slim = {
+    dependencies = ["temple" "tilt"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "122hmc2kn3g151m8c41imadw29mghnsjwyzj8wav5zb1q69y4iqp";
+      sha256 = "0zwz083xsbnlrma1pfkzrqc1fqm90fidn915vlifvkzl5fs43pvl";
       type = "gem";
     };
-    version = "3.0.7";
+    version = "3.0.9";
   };
   source_map = {
+    dependencies = ["json"];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0fviv92glr51v2zqy4i5jzi3hzpvjrcwyrxddcfr84ki65zb7pkv";
@@ -240,6 +300,7 @@
     version = "3.0.1";
   };
   sprockets = {
+    dependencies = ["concurrent-ruby" "rack"];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0sv3zk5hwxyjvg7iy9sggjc7k3mfxxif7w8p260rharfyib939ar";
@@ -250,28 +311,29 @@
   temple = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0xlf1if32xj14mkfwh8nxy3zzjzd9lipni0v2bghknp2kfc1hcz6";
+      sha256 = "00nxf610nzi4n1i2lkby43nrnarvl89fcl6lg19406msr0k3ycmq";
       type = "gem";
     };
-    version = "0.7.7";
+    version = "0.8.0";
   };
   thread_safe = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1hq46wqsyylx5afkp6jmcihdpv4ynzzq9ygb6z2pb1cbz5js0gcr";
+      sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy";
       type = "gem";
     };
-    version = "0.3.5";
+    version = "0.3.6";
   };
   tilt = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0qsyzq2k7blyp1rph56xczwfqi8gplns2whswyr67mdfzdi60vvm";
+      sha256 = "0020mrgdf11q23hm1ddd6fv691l51vi10af00f137ilcdb2ycfra";
       type = "gem";
     };
-    version = "2.0.6";
+    version = "2.0.8";
   };
   treetop = {
+    dependencies = ["polyglot"];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0wpl5z33796nz2ah44waflrd1girbra281d9i3m9nz4ylg1ljg5b";
@@ -282,9 +344,9 @@
   ttfunk = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1k725rji58i0qx5xwf7p9d07cmhmjixqkdvhg1wk3rpp1753cf1j";
+      sha256 = "1mgrnqla5n51v4ivn844albsajkck7k6lviphfqa8470r46c58cd";
       type = "gem";
     };
-    version = "1.4.0";
+    version = "1.5.1";
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e36e4af6a77..352b2c87aa4 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -414,6 +414,8 @@ with pkgs;
 
   acct = callPackage ../tools/system/acct { };
 
+  acme-sh = callPackage ../tools/admin/acme.sh { };
+
   acoustidFingerprinter = callPackage ../tools/audio/acoustid-fingerprinter {
     ffmpeg = ffmpeg_1;
   };
@@ -525,14 +527,6 @@ with pkgs;
 
   argyllcms = callPackage ../tools/graphics/argyllcms {};
 
-  arm-frc-linux-gnueabi-eglibc = callPackage ../development/libraries/arm-frc-linux-gnueabi-eglibc {};
-
-  arm-frc-linux-gnueabi-linux-api-headers = callPackage ../development/libraries/arm-frc-linux-gnueabi-linux-api-headers {};
-
-  arm-frc-linux-gnueabi-binutils = callPackage ../development/tools/misc/arm-frc-linux-gnueabi-binutils {};
-
-  arm-frc-linux-gnueabi-gcc = callPackage ../development/compilers/arm-frc-linux-gnueabi-gcc {};
-
   arp-scan = callPackage ../tools/misc/arp-scan { };
 
   inherit (callPackages ../data/fonts/arphic {})
@@ -569,6 +563,8 @@ with pkgs;
 
   aws-vault = callPackage ../tools/admin/aws-vault { };
 
+  iamy = callPackage ../tools/admin/iamy { };
+
   azure-cli = nodePackages.azure-cli;
 
   azure-vhd-utils  = callPackage ../tools/misc/azure-vhd-utils { };
@@ -1126,7 +1122,9 @@ with pkgs;
 
   doitlive = callPackage ../tools/misc/doitlive { };
 
-  dosage = pythonPackages.dosage;
+  dosage = callPackage ../applications/graphics/dosage {
+    pythonPackages = python3Packages;
+  };
 
   dpic = callPackage ../tools/graphics/dpic { };
 
@@ -1344,6 +1342,8 @@ with pkgs;
 
   patdiff = callPackage ../tools/misc/patdiff { };
 
+  pbzx = callPackage ../tools/compression/pbzx { };
+
   playerctl = callPackage ../tools/audio/playerctl { };
 
   ps_mem = callPackage ../tools/system/ps_mem { };
@@ -3495,6 +3495,8 @@ with pkgs;
 
   limesurvey = callPackage ../servers/limesurvey { };
 
+  linuxquota = callPackage ../tools/misc/linuxquota { };
+
   localtime = callPackage ../tools/system/localtime { };
 
   logcheck = callPackage ../tools/system/logcheck {
@@ -4516,7 +4518,7 @@ with pkgs;
 
   quilt = callPackage ../development/tools/quilt { };
 
-  quota = callPackage ../tools/misc/quota { };
+  quota = if stdenv.isLinux then linuxquota else unixtools.quota;
 
   wiggle = callPackage ../development/tools/wiggle { };
 
@@ -4733,6 +4735,8 @@ with pkgs;
 
   sasview = callPackage ../applications/science/misc/sasview {};
 
+  scallion = callPackage ../tools/security/scallion { };
+
   scanbd = callPackage ../tools/graphics/scanbd { };
 
   screen = callPackage ../tools/misc/screen {
@@ -5315,7 +5319,8 @@ with pkgs;
   vcftools = callPackage ../applications/science/biology/vcftools { };
 
   vcsh = callPackage ../applications/version-management/vcsh {
-    inherit (perlPackages) ShellCommand TestMost;
+    inherit (perlPackages) ShellCommand TestMost TestDifferences TestDeep
+      TestException TestWarn;
   };
 
   vcstool = callPackage ../development/tools/vcstool { };
@@ -5917,8 +5922,13 @@ with pkgs;
 
   clang-sierraHack = clang.override {
     name = "clang-wrapper-with-reexport-hack";
-    bintools = clang.bintools.override {
+    bintools = darwin.binutils.override {
       useMacosReexportHack = true;
+      bintools = darwin.binutils.bintools.override {
+        cctools = darwin.cctools.override {
+          enableDumpNormalizedLibArgs = true;
+        };
+      };
     };
   };
 
@@ -9435,6 +9445,8 @@ with pkgs;
 
   jemalloc = callPackage ../development/libraries/jemalloc { };
 
+  jemalloc450 = callPackage ../development/libraries/jemalloc/jemalloc450.nix { };
+
   jshon = callPackage ../development/tools/parsing/jshon { };
 
   json2hcl = callPackage ../development/tools/json2hcl { };
@@ -11119,10 +11131,6 @@ with pkgs;
 
     grantlee = callPackage ../development/libraries/grantlee/5 { };
 
-    inherit (callPackage ../development/libraries/kirigami { })
-      kirigami_1
-      kirigami_2;
-
     kdb = callPackage ../development/libraries/kdb { };
 
     kdiagram = callPackage ../development/libraries/kdiagram { };
@@ -11131,8 +11139,6 @@ with pkgs;
 
     kreport = callPackage ../development/libraries/kreport { };
 
-    kirigami = kirigami_1;
-
     libcommuni = callPackage ../development/libraries/libcommuni { };
 
     libdbusmenu = callPackage ../development/libraries/libdbusmenu-qt/qt-5.5.nix { };
@@ -11298,7 +11304,7 @@ with pkgs;
 
   rlog = callPackage ../development/libraries/rlog { };
 
-  rocksdb = callPackage ../development/libraries/rocksdb { };
+  rocksdb = callPackage ../development/libraries/rocksdb { jemalloc = jemalloc450; };
 
   rocksdb_lite = rocksdb.override { enableLite = true; };
 
@@ -12972,9 +12978,6 @@ with pkgs;
 
   bluez5 = callPackage ../os-specific/linux/bluez { };
 
-  # Needed for LibreOffice
-  bluez5_28 = lowPrio (callPackage ../os-specific/linux/bluez/bluez5_28.nix { });
-
   bluez = bluez5;
 
   inherit (python3Packages) bedup;
@@ -13347,6 +13350,7 @@ with pkgs;
         # when adding a new linux version
         # kernelPatches.cpu-cgroup-v2."4.11"
         kernelPatches.modinst_arg_list_too_long
+        kernelPatches.bcm2835_mmal_v4l2_camera_driver # Only needed for 4.16!
       ]
       ++ lib.optionals ((platform.kernelArch or null) == "mips")
       [ kernelPatches.mips_fpureg_emu
@@ -13761,6 +13765,8 @@ with pkgs;
 
   gotools = callPackage ../development/tools/gotools { };
 
+  gotop = callPackage ../tools/system/gotop { };
+
   gomodifytags = callPackage ../development/tools/gomodifytags { };
 
   go-langserver = callPackage ../development/tools/go-langserver { };
@@ -16042,8 +16048,7 @@ with pkgs;
   };
 
   guake = callPackage ../applications/misc/guake {
-    gconf = gnome2.GConf;
-    vte = gnome2.vte.override { pythonSupport = true; };
+    inherit (gnome3) vte;
   };
 
   guitone = callPackage ../applications/version-management/guitone {
@@ -16488,7 +16493,6 @@ with pkgs;
       inherit (gnome2) GConf ORBit2 gnome_vfs;
       inherit (gnome3) defaultIconTheme;
       zip = zip.override { enableNLS = false; };
-      bluez5 = bluez5_28;
       fontsConf = makeFontsConf {
         fontDirectories = [
           carlito dejavu_fonts
@@ -16503,6 +16507,7 @@ with pkgs;
         withIcu = true; withGraphite2 = true;
       };
       # checking whether g++ supports C++14 or C++11... configure: error: no
+      # Still relevant: 2018-04-13
       stdenv = overrideCC stdenv gcc5;
   };});
 
@@ -16512,11 +16517,13 @@ with pkgs;
       inherit (gnome2) GConf ORBit2 gnome_vfs;
       inherit (gnome3) defaultIconTheme;
       zip = zip.override { enableNLS = false; };
-      bluez5 = bluez5_28;
       poppler = poppler_0_61;
       fontsConf = makeFontsConf {
         fontDirectories = [
+          carlito dejavu_fonts
           freefont_ttf xorg.fontmiscmisc
+          liberation_ttf_v1_binary
+          liberation_ttf_v2_binary
         ];
       };
       clucene_core = clucene_core_2;
@@ -16524,8 +16531,8 @@ with pkgs;
       harfbuzz = harfbuzz.override {
         withIcu = true; withGraphite2 = true;
       };
-      icu = icu58;
       # checking whether g++ supports C++14 or C++11... configure: error: no
+      # Still relevant: 2018-04-13; gcc6 is not enough!
       stdenv = overrideCC stdenv gcc5;
   };});
 
@@ -17242,6 +17249,8 @@ with pkgs;
 
   pidgin-window-merge = callPackage ../applications/networking/instant-messengers/pidgin-plugins/window-merge { };
 
+  purple-discord = callPackage ../applications/networking/instant-messengers/pidgin-plugins/purple-discord { };
+
   purple-hangouts = callPackage ../applications/networking/instant-messengers/pidgin-plugins/purple-hangouts { };
 
   purple-matrix = callPackage ../applications/networking/instant-messengers/pidgin-plugins/purple-matrix { };
@@ -17350,7 +17359,7 @@ with pkgs;
     inherit (darwin.stubs) rez setfile;
   };
 
-  qemu-riscv = callPackage ../applications/virtualization/qemu/riscv.nix {};
+  qemu-riscv = lowPrio (callPackage ../applications/virtualization/qemu/riscv.nix {});
 
   qgis = callPackage ../applications/gis/qgis {
     inherit (darwin.apple_sdk.frameworks) IOKit ApplicationServices;
@@ -17796,6 +17805,9 @@ with pkgs;
     inherit (gnome2) GConf;
     libgcrypt = libgcrypt_1_5;
     libpng = libpng12;
+    curl = curl.override {
+      sslSupport = false; gnutlsSupport = true;
+    };
   };
 
   libspotify = callPackage ../development/libraries/libspotify {
@@ -17936,9 +17948,7 @@ with pkgs;
 
   terminal-notifier = callPackage ../applications/misc/terminal-notifier {};
 
-  terminator = callPackage ../applications/misc/terminator {
-    vte = gnome2.vte.override { pythonSupport = true; };
-  };
+  terminator = callPackage ../applications/misc/terminator { };
 
   terminus = callPackage ../applications/misc/terminus { inherit (gnome2) GConf; };
 
@@ -19488,6 +19498,13 @@ with pkgs;
 
   xsokoban = callPackage ../games/xsokoban { };
 
+  inherit (callPackage ../games/quake2/yquake2 { })
+    yquake2
+    yquake2-ctf
+    yquake2-ground-zero
+    yquake2-the-reckoning
+    yquake2-all-games;
+
   zandronum = callPackage ../games/zandronum { };
 
   zandronum-server = zandronum.override {
@@ -19600,7 +19617,7 @@ with pkgs;
 
   numix-gtk-theme = callPackage ../misc/themes/numix { };
 
-  numix-solarized-gtk-theme = callPackage ../misc/themes/gtk3/numix-solarized-gtk-theme {  };
+  numix-solarized-gtk-theme = callPackage ../misc/themes/numix-solarized { };
 
   numix-sx-gtk-theme = callPackage ../misc/themes/numix-sx { };
 
@@ -19758,6 +19775,8 @@ with pkgs;
 
   clblas = callPackage ../development/libraries/science/math/clblas { };
 
+  cliquer = callPackage ../development/libraries/science/math/cliquer { };
+
   jags = callPackage ../applications/science/math/jags { };
 
 
@@ -19774,6 +19793,10 @@ with pkgs;
 
   liblbfgs = callPackage ../development/libraries/science/math/liblbfgs { };
 
+  m4ri = callPackage ../development/libraries/science/math/m4ri { };
+
+  m4rie = callPackage ../development/libraries/science/math/m4rie { };
+
   nasc = callPackage ../applications/science/math/nasc { };
 
   openblas = callPackage ../development/libraries/science/math/openblas { };
@@ -20133,6 +20156,7 @@ with pkgs;
   };
   maxima-ecl = callPackage ../applications/science/math/maxima {
     ecl = ecl_16_1_2;
+    ecl-fasl = true;
     sbcl = null;
   };
 
@@ -20160,13 +20184,7 @@ with pkgs;
     inherit (gnome3) gtksourceview;
   };
 
-  singular = callPackage ../applications/science/math/singular {
-    stdenv = overrideCC stdenv gcc5;
-  };
-  libsingular = callPackage ../applications/science/math/singular {
-    asLibsingular = true;
-    stdenv = overrideCC stdenv gcc5;
-  };
+  singular = callPackage ../applications/science/math/singular { };
 
   scilab = callPackage ../applications/science/math/scilab {
     withXaw3d = false;
@@ -20486,6 +20504,8 @@ with pkgs;
 
   helm = callPackage ../applications/audio/helm { };
 
+  heptio-ark = callPackage ../applications/networking/cluster/heptio-ark { };
+
   hplip = callPackage ../misc/drivers/hplip { };
 
   hplipWithPlugin = hplip.override { withPlugin = true; };
@@ -21231,7 +21251,7 @@ with pkgs;
 
   # Unix tools
   unixtools = recurseIntoAttrs (callPackages ./unix-tools.nix { });
-  inherit (unixtools) hexdump ps logger eject modprobe umount
+  inherit (unixtools) hexdump ps logger eject umount
                       mount wall hostname more sysctl getconf
                       getent;
 }
diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix
index 1f8039010d7..d1d5aa470bc 100644
--- a/pkgs/top-level/darwin-packages.nix
+++ b/pkgs/top-level/darwin-packages.nix
@@ -57,12 +57,16 @@ in
 
   stubs = callPackages ../os-specific/darwin/stubs { };
 
-  swift-corefoundation = callPackage ../os-specific/darwin/swift-corefoundation { };
-
   trash = callPackage ../os-specific/darwin/trash { inherit (darwin.apple_sdk) frameworks; };
 
   usr-include = callPackage ../os-specific/darwin/usr-include { };
 
   xcode = callPackage ../os-specific/darwin/xcode { };
 
+  CoreSymbolication = callPackage ../os-specific/darwin/CoreSymbolication { };
+
+  swift-corelibs = callPackages ../os-specific/darwin/swift-corelibs { };
+
+  darling = callPackage ../os-specific/darwin/darling/default.nix { };
+
 })
diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix
index a23de670836..3da44309803 100644
--- a/pkgs/top-level/lua-packages.nix
+++ b/pkgs/top-level/lua-packages.nix
@@ -738,7 +738,7 @@ let
       owner = "libmpack";
       repo = "libmpack-lua";
       rev = version;
-      sha256 = "1nydi6xbmxwl1fmi32v5v8n74msnmzblzqaqnb102w6vkinampsb";
+      sha256 = "0l4k7qmwaa0zpxrlp27yp4pbbyiz3zgxywkm543q6wkzn6wmq8l8";
     };
 
     nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 8ab8def15c6..2034fd81c87 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -13549,6 +13549,7 @@ let self = _self // overrides; _self = with self; {
     };
     setOutputFlags = false;
     buildInputs = [ pkgs.which ];
+    patches = [ ../development/perl-modules/Socket6-sv_undef.patch ];
     meta = {
       description = "IPv6 related part of the C socket.h defines and structure manipulators";
       license = stdenv.lib.licenses.bsd3;
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 35aaf60179c..6fee2dcd65b 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -410,6 +410,8 @@ in {
 
   rhpl = disabledIf isPy3k (callPackage ../development/python-modules/rhpl {});
 
+  rlp = callPackage ../development/python-modules/rlp { };
+
   rx = callPackage ../development/python-modules/rx { };
 
   salmon-mail = callPackage ../development/python-modules/salmon-mail { };
@@ -1177,32 +1179,12 @@ in {
 
   cx_oracle = callPackage ../development/python-modules/cx_oracle {};
 
-  cvxopt = buildPythonPackage rec {
-    name = "${pname}-${version}";
-    pname = "cvxopt";
-    version = "1.1.7";
-    disabled = isPyPy;
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/c/${pname}/${name}.tar.gz";
-      sha256 = "f856ea2e9e2947abc1a6557625cc6b0e45228984f397a90c420b2f468dc4cb97";
-    };
-    doCheck = false;
-    buildInputs = with pkgs; [ openblasCompat ];
-    preConfigure = ''
-      export CVXOPT_BLAS_LIB_DIR=${pkgs.openblasCompat}/lib
-      export CVXOPT_BLAS_LIB=openblas
-      export CVXOPT_LAPACK_LIB=openblas
-    '';
-    meta = {
-      homepage = "http://cvxopt.org/";
-      description = "Python Software for Convex Optimization";
-      maintainers = with maintainers; [ edwtjo ];
-      license = licenses.gpl3Plus;
-    };
-  };
+  cvxopt = callPackage ../development/python-modules/cvxopt { };
 
   cycler = callPackage ../development/python-modules/cycler { };
 
+  cysignals = callPackage ../development/python-modules/cysignals { };
+
   dlib = buildPythonPackage rec {
     inherit (pkgs.dlib) name src nativeBuildInputs meta;
 
@@ -1217,29 +1199,6 @@ in {
 
   defusedxml = callPackage ../development/python-modules/defusedxml {};
 
-  dosage = buildPythonPackage rec {
-    name = "${pname}-${version}";
-    pname = "dosage";
-    version = "2016.03.17";
-    PBR_VERSION = version;
-    src = pkgs.fetchFromGitHub {
-      owner = "webcomics";
-      repo = "dosage";
-      rev = "1af022895e5f86bc43da95754c4c4ed305790f5b";
-      sha256 = "1bkqhlzigy656pam0znp2ddp1y5sqzyhw3c4fyy58spcafldq4j6";
-    };
-    buildInputs = with self; [ pytest ];
-    propagatedBuildInputs = with self; [ requests lxml pbr ];
-    # prompt_toolkit doesn't work on 3.5 on OSX.
-    doCheck = !isPy35;
-
-    meta = {
-      description = "A comic strip downloader and archiver";
-      homepage = http://dosage.rocks/;
-      broken = true; # ctypes error
-    };
-  };
-
   dugong = callPackage ../development/python-modules/dugong {};
 
   iowait = callPackage ../development/python-modules/iowait {};
@@ -1687,6 +1646,8 @@ in {
 
   curtsies = callPackage ../development/python-modules/curtsies { };
 
+  envs = callPackage ../development/python-modules/envs { };
+
   jsonrpc-async = callPackage ../development/python-modules/jsonrpc-async { };
 
   jsonrpc-base = callPackage ../development/python-modules/jsonrpc-base { };
@@ -2589,6 +2550,8 @@ in {
 
   fpdf = callPackage ../development/python-modules/fpdf { };
 
+  fpylll = callPackage ../development/python-modules/fpylll { };
+
   fritzconnection = callPackage ../development/python-modules/fritzconnection { };
 
   frozendict = buildPythonPackage rec {
@@ -2981,7 +2944,6 @@ in {
         wrapProgram $out/bin/gtimelog \
           --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
           --prefix LD_LIBRARY_PATH ":" "${pkgs.gtk3.out}/lib" \
-
     '';
 
     meta = {
@@ -8453,7 +8415,15 @@ in {
     name = "sleekxmpp-${version}";
     version = "1.3.3";
 
-    propagatedBuildInputs = with self; [ dnspython pyasn1 gevent ];
+    patches = [
+      # Fix https://github.com/etingof/pyasn1/issues/112
+      (pkgs.fetchpatch {
+        url = "https://github.com/kdschlosser/SleekXMPP/commit/597014ba5ca258763e96ee37729ac933c5af1602.patch";
+        sha256 = "176v3f3pr0bx48wv1kf9jn2pwxdn7qpqyc2chwv1m8gbppsfaikf";
+      })
+    ];
+
+    propagatedBuildInputs = with self; [ dnspython pyasn1 pyasn1-modules gevent ];
     checkInputs = [ pkgs.gnupg ];
     checkPhase = "${python.interpreter} testall.py";
     doCheck = false; # Tests failed all this time and upstream doesn't seem to care.
@@ -11851,12 +11821,12 @@ in {
 
   python-wifi = buildPythonPackage rec {
     name = "python-wifi-${version}";
-    version = "0.6.0";
+    version = "0.6.1";
     disabled = ! (isPy26 || isPy27 );
 
     src = pkgs.fetchurl {
       url = "mirror://pypi/p/python-wifi/${name}.tar.bz2";
-      sha256 = "504639e5953eaec0e41758900fbe143d33d82ea86762b19b659a118c77d8403d";
+      sha256 = "149c3dznb63d82143cz5hqdim0mqjysz6p3yk0zv271vq3xnmzvv";
     };
 
     meta = {
@@ -12477,28 +12447,7 @@ in {
 
   rpmfluff = callPackage ../development/python-modules/rpmfluff {};
 
-  rpy2 = buildPythonPackage rec {
-    name = "rpy2-2.8.2";
-    disabled = isPyPy;
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/r/rpy2/${name}.tar.gz";
-      sha256 = "2c1a313df4e64236dcfe1078ce847b8e3c180656c894928d3a4b391aacb9b24c";
-    };
-    buildInputs = with pkgs; [ readline R pcre lzma bzip2 zlib icu ];
-    propagatedBuildInputs = with self; [ singledispatch six ];
-
-    # According to manual this is how the testsuite should be invoked
-    checkPhase = ''
-      ${python.interpreter}  -m rpy2.tests
-    '';
-    meta = {
-      homepage = http://rpy.sourceforge.net/rpy2;
-      description = "Python interface to R";
-      license = licenses.gpl2Plus;
-      maintainers = with maintainers; [ joelmo ];
-      broken = true;
-    };
-  };
+  rpy2 = callPackage ../development/python-modules/rpy2 {};
 
   rpyc = buildPythonPackage rec {
     name = "rpyc-${version}";
@@ -18328,6 +18277,8 @@ EOF
 
   sseclient = callPackage ../development/python-modules/sseclient { };
 
+  warrant = callPackage ../development/python-modules/warrant { };
+
   textacy = callPackage ../development/python-modules/textacy { };
 
   pyemd  = callPackage ../development/python-modules/pyemd { };
@@ -18353,6 +18304,8 @@ EOF
   wsproto = callPackage ../development/python-modules/wsproto { };
 
   h11 = callPackage ../development/python-modules/h11 { };
+
+  python-docx = callPackage ../development/python-modules/python-docx { };
 });
 
 in fix' (extends overrides packages)
diff --git a/pkgs/top-level/unix-tools.nix b/pkgs/top-level/unix-tools.nix
index 955fa37d6c7..9946bb1c4dc 100644
--- a/pkgs/top-level/unix-tools.nix
+++ b/pkgs/top-level/unix-tools.nix
@@ -13,7 +13,7 @@
 let
 
   singleBinary = cmd: providers: let
-      provider = "${providers.${hostPlatform.parsed.kernel.name} or "missing-package"}/bin/${cmd}";
+      provider = "${lib.getBin providers.${hostPlatform.parsed.kernel.name}}/bin/${cmd}";
     in runCommand cmd {
       meta.platforms = map (n: { kernel.name = n; }) (pkgs.lib.attrNames providers);
     } ''
@@ -41,6 +41,10 @@ in rec {
     linux = pkgs.nettools;
     darwin = pkgs.darwin.network_cmds;
   };
+  col = singleBinary "col" {
+    linux = pkgs.utillinux;
+    darwin = pkgs.darwin.text_cmds;
+  };
   eject = singleBinary "eject" {
     linux = pkgs.utillinux;
   };
@@ -58,6 +62,14 @@ in rec {
     linux = pkgs.utillinux;
     darwin = pkgs.getopt;
   };
+  fdisk = singleBinary "fdisk" {
+    linux = pkgs.utillinux;
+    darwin = pkgs.darwin.diskdev_cmds;
+  };
+  fsck = singleBinary "fsck" {
+    linux = pkgs.utillinux;
+    darwin = pkgs.darwin.diskdev_cmds;
+  };
   hexdump = singleBinary "hexdump" {
     linux = pkgs.utillinux;
     darwin = pkgs.darwin.shell_cmds;
@@ -73,15 +85,13 @@ in rec {
   logger = singleBinary "logger" {
     linux = pkgs.utillinux;
   };
-  modprobe = singleBinary "modprobe" {
-    linux = pkgs.utillinux;
-  };
   more = singleBinary "more" {
     linux = pkgs.utillinux;
     darwin = more_compat;
   };
   mount = singleBinary "mount" {
     linux = pkgs.utillinux;
+    darwin = pkgs.darwin.diskdev_cmds;
   };
   netstat = singleBinary "netstat" {
     linux = pkgs.nettools;
@@ -95,6 +105,10 @@ in rec {
     linux = pkgs.procps;
     darwin = pkgs.darwin.ps;
   };
+  quota = singleBinary "quota" {
+    linux = pkgs.linuxquota;
+    darwin = pkgs.darwin.diskdev_cmds;
+  };
   route = singleBinary "route" {
     linux = pkgs.nettools;
     darwin = pkgs.darwin.network_cmds;
@@ -107,8 +121,13 @@ in rec {
     linux = pkgs.procps;
     darwin = pkgs.darwin.system_cmds;
   };
+  top = singleBinary "top" {
+    linux = pkgs.procps;
+    darwin = pkgs.darwin.top;
+  };
   umount = singleBinary "umount" {
     linux = pkgs.utillinux;
+    darwin = pkgs.darwin.diskdev_cmds;
   };
   whereis = singleBinary "whereis" {
     linux = pkgs.utillinux;
@@ -127,16 +146,17 @@ in rec {
 
   procps = buildEnv {
     name = "procps-compat";
-    paths = [ sysctl ps ];
+    paths = [ ps sysctl top ];
   };
 
   utillinux = buildEnv {
     name = "utillinux-compat";
-    paths = [ getopt hexdump script whereis write ];
+    paths = [ fsck fdisk getopt hexdump mount
+              script umount whereis write col ];
   };
 
   nettools = buildEnv {
     name = "nettools-compat";
-    paths = [ arp hostname netstat route ];
+    paths = [ arp hostname ifconfig netstat route ];
   };
 }