summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/X11/xwinwrap/default.nix6
-rw-r--r--pkgs/tools/admin/awscli/default.nix6
-rw-r--r--pkgs/tools/admin/bluemix-cli/default.nix2
-rw-r--r--pkgs/tools/admin/google-cloud-sdk/default.nix2
-rw-r--r--pkgs/tools/archivers/gnutar/default.nix2
-rw-r--r--pkgs/tools/archivers/zpaq/zpaqd.nix12
-rw-r--r--pkgs/tools/backup/bareos/default.nix4
-rw-r--r--pkgs/tools/bootloaders/refind/default.nix2
-rw-r--r--pkgs/tools/compression/bzip2/default.nix2
-rw-r--r--pkgs/tools/filesystems/bcachefs-tools/default.nix6
-rw-r--r--pkgs/tools/filesystems/buttersink/default.nix30
-rw-r--r--pkgs/tools/filesystems/sshfs-fuse/default.nix2
-rw-r--r--pkgs/tools/graphics/gmic/default.nix6
-rw-r--r--pkgs/tools/graphics/optipng/default.nix5
-rw-r--r--pkgs/tools/graphics/pngout/default.nix10
-rw-r--r--pkgs/tools/misc/bandwidth/default.nix10
-rw-r--r--pkgs/tools/misc/bat/default.nix4
-rw-r--r--pkgs/tools/misc/bdf2psf/default.nix4
-rw-r--r--pkgs/tools/misc/byobu/default.nix4
-rw-r--r--pkgs/tools/misc/colord/default.nix10
-rw-r--r--pkgs/tools/misc/coreutils/default.nix25
-rw-r--r--pkgs/tools/misc/cutecom/default.nix4
-rw-r--r--pkgs/tools/misc/execline/default.nix2
-rw-r--r--pkgs/tools/misc/findutils/default.nix9
-rw-r--r--pkgs/tools/misc/grub/2.0x.nix12
-rw-r--r--pkgs/tools/misc/grub/pvgrub_image/default.nix8
-rw-r--r--pkgs/tools/misc/grub/trusted.nix4
-rw-r--r--pkgs/tools/misc/lolcat/Gemfile.lock6
-rw-r--r--pkgs/tools/misc/lolcat/gemset.nix8
-rw-r--r--pkgs/tools/misc/mongodb-compass/default.nix4
-rw-r--r--pkgs/tools/misc/mprime/default.nix14
-rw-r--r--pkgs/tools/misc/ocz-ssd-guru/default.nix2
-rw-r--r--pkgs/tools/misc/os-prober/default.nix2
-rw-r--r--pkgs/tools/misc/otfcc/default.nix4
-rw-r--r--pkgs/tools/misc/pspg/default.nix4
-rw-r--r--pkgs/tools/misc/s6-portable-utils/default.nix2
-rw-r--r--pkgs/tools/misc/staruml/default.nix2
-rw-r--r--pkgs/tools/misc/ttyrec/default.nix4
-rw-r--r--pkgs/tools/misc/youtube-dl/default.nix4
-rw-r--r--pkgs/tools/networking/airfield/default.nix2
-rw-r--r--pkgs/tools/networking/filegive/default.nix2
-rw-r--r--pkgs/tools/networking/logmein-hamachi/default.nix10
-rw-r--r--pkgs/tools/networking/ngrok-2/default.nix2
-rw-r--r--pkgs/tools/networking/s6-dns/default.nix2
-rw-r--r--pkgs/tools/networking/s6-networking/default.nix2
-rw-r--r--pkgs/tools/networking/strongswan/default.nix2
-rw-r--r--pkgs/tools/package-management/cargo-edit/cargo-edit.nix2
-rw-r--r--pkgs/tools/package-management/cargo-update/cargo-update.nix6
-rw-r--r--pkgs/tools/package-management/checkinstall/default.nix2
-rw-r--r--pkgs/tools/package-management/nix/default.nix5
-rw-r--r--pkgs/tools/package-management/nixui/default.nix2
-rw-r--r--pkgs/tools/security/afl/default.nix6
-rw-r--r--pkgs/tools/security/afl/qemu.nix8
-rw-r--r--pkgs/tools/security/encryptr/default.nix12
-rw-r--r--pkgs/tools/security/enpass/default.nix7
-rw-r--r--pkgs/tools/security/pcsc-scm-scl011/default.nix6
-rw-r--r--pkgs/tools/security/sshuttle/default.nix2
-rw-r--r--pkgs/tools/system/at/default.nix4
-rw-r--r--pkgs/tools/system/facter/default.nix4
-rw-r--r--pkgs/tools/system/incron/default.nix36
-rw-r--r--pkgs/tools/system/incron/default_path.patch36
-rw-r--r--pkgs/tools/system/s6-rc/default.nix2
-rw-r--r--pkgs/tools/system/s6/default.nix2
-rw-r--r--pkgs/tools/system/storebrowse/default.nix2
-rw-r--r--pkgs/tools/text/gawk/default.nix2
-rw-r--r--pkgs/tools/text/gnupatch/default.nix5
-rw-r--r--pkgs/tools/text/html-tidy/default.nix6
-rw-r--r--pkgs/tools/text/xidel/default.nix6
-rw-r--r--pkgs/tools/typesetting/asciidoctor/Gemfile.lock10
-rw-r--r--pkgs/tools/typesetting/asciidoctor/default.nix2
-rw-r--r--pkgs/tools/typesetting/asciidoctor/gemset.nix104
-rw-r--r--pkgs/tools/typesetting/kindlegen/default.nix4
-rw-r--r--pkgs/tools/virtualization/awsebcli/default.nix10
73 files changed, 371 insertions, 193 deletions
diff --git a/pkgs/tools/X11/xwinwrap/default.nix b/pkgs/tools/X11/xwinwrap/default.nix
index cc2eb50ce1fd..dbbdb0c04e91 100644
--- a/pkgs/tools/X11/xwinwrap/default.nix
+++ b/pkgs/tools/X11/xwinwrap/default.nix
@@ -16,11 +16,11 @@ stdenv.mkDerivation {
     xlibsWrapper
   ];
 
-  buildPhase = if stdenv.system == "x86_64-linux" then ''
+  buildPhase = if stdenv.hostPlatform.system == "x86_64-linux" then ''
     make all64
-  '' else if stdenv.system == "i686-linux" then ''
+  '' else if stdenv.hostPlatform.system == "i686-linux" then ''
     make all32
-  '' else throw "xwinwrap is not supported on ${stdenv.system}";
+  '' else throw "xwinwrap is not supported on ${stdenv.hostPlatform.system}";
 
   installPhase = ''
     mkdir -p $out/bin
diff --git a/pkgs/tools/admin/awscli/default.nix b/pkgs/tools/admin/awscli/default.nix
index 92e5459df49d..ccd9f05a3351 100644
--- a/pkgs/tools/admin/awscli/default.nix
+++ b/pkgs/tools/admin/awscli/default.nix
@@ -19,11 +19,11 @@ let
 
 in py.pkgs.buildPythonApplication rec {
   pname = "awscli";
-  version = "1.16.1";
+  version = "1.15.66";
 
   src = py.pkgs.fetchPypi {
     inherit pname version;
-    sha256 = "5068efde694e24462646d271335fdef3dde8a0fbbfb986fab0ce7e5368a7df8d";
+    sha256 = "004fbd3bb8932465205675a7de94460b5c2d45ddd6916138a2c867e4d0f2a4c4";
   };
 
   # No tests included
@@ -44,7 +44,7 @@ in py.pkgs.buildPythonApplication rec {
 
   postPatch = ''
     for i in {py,cfg}; do
-      substituteInPlace setup.$i --replace "botocore==1.10.10" "botocore>=1.10.9,<=1.11"
+      substituteInPlace setup.$i --replace "botocore==1.10.65" "botocore>=1.10.9,<=1.11"
     done
   '';
 
diff --git a/pkgs/tools/admin/bluemix-cli/default.nix b/pkgs/tools/admin/bluemix-cli/default.nix
index 7ae54aab4b9d..8b6395d85d04 100644
--- a/pkgs/tools/admin/bluemix-cli/default.nix
+++ b/pkgs/tools/admin/bluemix-cli/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
   version = "0.8.0";
 
   src =
-    if stdenv.system == "i686-linux" then
+    if stdenv.hostPlatform.system == "i686-linux" then
       fetchurl {
         name = "linux32-${version}.tar.gz";
         url = "https://clis.ng.bluemix.net/download/bluemix-cli/${version}/linux32";
diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix
index c2f73cea9558..8b98636b3475 100644
--- a/pkgs/tools/admin/google-cloud-sdk/default.nix
+++ b/pkgs/tools/admin/google-cloud-sdk/default.nix
@@ -32,7 +32,7 @@ in stdenv.mkDerivation rec {
   name = "google-cloud-sdk-${version}";
   version = "206.0.0";
 
-  src = fetchurl (sources name stdenv.system);
+  src = fetchurl (sources name stdenv.hostPlatform.system);
 
   buildInputs = [ python makeWrapper ];
 
diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix
index 7532cd899cc6..0cde72069848 100644
--- a/pkgs/tools/archivers/gnutar/default.nix
+++ b/pkgs/tools/archivers/gnutar/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
 
   # May have some issues with root compilation because the bootstrap tool
   # cannot be used as a login shell for now.
-  FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux" || stdenv.isSunOS) "1";
+  FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.hostPlatform.system == "armv7l-linux" || stdenv.isSunOS) "1";
 
   preConfigure = if stdenv.isCygwin then ''
     sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
diff --git a/pkgs/tools/archivers/zpaq/zpaqd.nix b/pkgs/tools/archivers/zpaq/zpaqd.nix
index 0d60e7962460..344f08890906 100644
--- a/pkgs/tools/archivers/zpaq/zpaqd.nix
+++ b/pkgs/tools/archivers/zpaq/zpaqd.nix
@@ -1,6 +1,4 @@
-{ stdenv, fetchurl, unzip
-, hostPlatform
-}:
+{ stdenv, fetchurl, unzip }:
 
 let
   # Generated upstream information
@@ -14,10 +12,10 @@ let
   };
 
   compileFlags = stdenv.lib.concatStringsSep " " ([ "-O3" "-mtune=generic" "-DNDEBUG" ]
-    ++ stdenv.lib.optional (hostPlatform.isUnix) "-Dunix -pthread"
-    ++ stdenv.lib.optional (hostPlatform.isi686) "-march=i686"
-    ++ stdenv.lib.optional (hostPlatform.isx86_64) "-march=nocona"
-    ++ stdenv.lib.optional (!hostPlatform.isx86) "-DNOJIT");
+    ++ stdenv.lib.optional (stdenv.hostPlatform.isUnix) "-Dunix -pthread"
+    ++ stdenv.lib.optional (stdenv.hostPlatform.isi686) "-march=i686"
+    ++ stdenv.lib.optional (stdenv.hostPlatform.isx86_64) "-march=nocona"
+    ++ stdenv.lib.optional (!stdenv.hostPlatform.isx86) "-DNOJIT");
 in
 stdenv.mkDerivation {
   inherit (s) name version;
diff --git a/pkgs/tools/backup/bareos/default.nix b/pkgs/tools/backup/bareos/default.nix
index e93b02e062e2..9d82777da817 100644
--- a/pkgs/tools/backup/bareos/default.nix
+++ b/pkgs/tools/backup/bareos/default.nix
@@ -12,14 +12,14 @@ let
 in
 stdenv.mkDerivation rec {
   name = "bareos-${version}";
-  version = "17.2.5";
+  version = "17.2.7";
 
   src = fetchFromGitHub {
     owner = "bareos";
     repo = "bareos";
     rev = "Release/${version}";
     name = "${name}-src";
-    sha256 = "1mgh25lhd05m26sq1sj5ir2b4n7560x93ib25cvf9vmmypm1c7pn";
+    sha256 = "1awf5i4mw2nfd7z0dmqnywapnx9nz6xwqv8rxp0y2mnrhzdpbrbz";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/tools/bootloaders/refind/default.nix b/pkgs/tools/bootloaders/refind/default.nix
index 73463bbef897..5f4d77e34b6a 100644
--- a/pkgs/tools/bootloaders/refind/default.nix
+++ b/pkgs/tools/bootloaders/refind/default.nix
@@ -7,7 +7,7 @@ let
   };
 
   inherit
-    (archids.${stdenv.system} or (throw "unsupported system: ${stdenv.system}"))
+    (archids.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}"))
     hostarch efiPlatform;
 in
 
diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix
index 4b127417ca8d..4a2ba2fcb94c 100644
--- a/pkgs/tools/compression/bzip2/default.nix
+++ b/pkgs/tools/compression/bzip2/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl
-, linkStatic ? (stdenv.system == "i686-cygwin")
+, linkStatic ? (stdenv.hostPlatform.system == "i686-cygwin")
 }:
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/tools/filesystems/bcachefs-tools/default.nix b/pkgs/tools/filesystems/bcachefs-tools/default.nix
index b919d5808756..ee1ee2e61789 100644
--- a/pkgs/tools/filesystems/bcachefs-tools/default.nix
+++ b/pkgs/tools/filesystems/bcachefs-tools/default.nix
@@ -2,12 +2,12 @@
 , liburcu, zlib, libaio, zstd, lz4 }:
 
 stdenv.mkDerivation rec {
-  name = "bcachefs-tools-unstable-2018-07-21";
+  name = "bcachefs-tools-unstable-2018-08-22";
 
   src = fetchgit {
     url = "https://evilpiepirate.org/git/bcachefs-tools.git";
-    rev = "cecf7e05e151499a3e96dc05f97f37c14162e94b";
-    sha256 = "18vmyrjwza1iv0apkykbqsnnic5lrqlwfsrj85pgrpwzii36i8i0";
+    rev = "ebf97e8e01a8e76ff4bec23f29106430852c3081";
+    sha256 = "0f2ycin0gmi1a4fm7qln0c10zn451gljfbc2piy1fm768xqqrmld";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/tools/filesystems/buttersink/default.nix b/pkgs/tools/filesystems/buttersink/default.nix
new file mode 100644
index 000000000000..791d59b7ac27
--- /dev/null
+++ b/pkgs/tools/filesystems/buttersink/default.nix
@@ -0,0 +1,30 @@
+{ lib, python2 }:
+
+python2.pkgs.buildPythonApplication rec {
+  pname = "buttersink";
+  version = "0.6.9";
+
+  src = python2.pkgs.fetchPypi {
+    inherit pname version;
+    sha256 = "a797b6e92ad2acdf41e033c1368ab365aa268f4d8458b396a5770fa6c2bc3f54";
+  };
+
+  propagatedBuildInputs = with python2.pkgs; [ boto crcmod psutil ];
+
+  # No tests implemented
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Synchronise btrfs snapshots";
+    longDescription = ''
+      ButterSink is like rsync, but for btrfs subvolumes instead of files,
+      which makes it much more efficient for things like archiving backup
+      snapshots. It is built on top of btrfs send and receive capabilities.
+      Sources and destinations can be local btrfs file systems, remote btrfs
+      file systems over SSH, or S3 buckets.
+    '';
+    homepage = https://github.com/AmesCornish/buttersink/wiki;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/filesystems/sshfs-fuse/default.nix b/pkgs/tools/filesystems/sshfs-fuse/default.nix
index 183cfb2ddbe4..ddec6b7eff89 100644
--- a/pkgs/tools/filesystems/sshfs-fuse/default.nix
+++ b/pkgs/tools/filesystems/sshfs-fuse/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   checkInputs = [ which python3Packages.pytest ];
 
   NIX_CFLAGS_COMPILE = stdenv.lib.optional
-    (stdenv.system == "i686-linux")
+    (stdenv.hostPlatform.system == "i686-linux")
     "-D_FILE_OFFSET_BITS=64";
 
   postInstall = ''
diff --git a/pkgs/tools/graphics/gmic/default.nix b/pkgs/tools/graphics/gmic/default.nix
index c267695dd784..51212a3ea946 100644
--- a/pkgs/tools/graphics/gmic/default.nix
+++ b/pkgs/tools/graphics/gmic/default.nix
@@ -32,16 +32,12 @@ in stdenv.mkDerivation rec {
     "-DBUILD_LIB_STATIC=OFF"
     "-DBUILD_PLUGIN=${if withGimpPlugin then "ON" else "OFF"}"
     "-DENABLE_DYNAMIC_LINKING=ON"
-  ];
+  ] ++ stdenv.lib.optional withGimpPlugin "-DPLUGIN_INSTALL_PREFIX=${placeholder "gimpPlugin"}/${gimp.targetPluginDir}";
 
   postPatch = ''
     cp ${CMakeLists} CMakeLists.txt
   '';
 
-  preConfigure = stdenv.lib.optionalString withGimpPlugin ''
-    cmakeFlags="$cmakeFlags -DPLUGIN_INSTALL_PREFIX=$gimpPlugin/${gimp.targetPluginDir}"
-  '';
-
   meta = with stdenv.lib; {
     description = "G'MIC is an open and full-featured framework for image processing";
     homepage = http://gmic.eu/;
diff --git a/pkgs/tools/graphics/optipng/default.nix b/pkgs/tools/graphics/optipng/default.nix
index fd0b0caea4ca..bc849b21117f 100644
--- a/pkgs/tools/graphics/optipng/default.nix
+++ b/pkgs/tools/graphics/optipng/default.nix
@@ -1,5 +1,4 @@
 { stdenv, fetchurl, libpng, static ? false
-, buildPlatform, hostPlatform
 }:
 
 # This package comes with its own copy of zlib, libpng and pngxtern
@@ -26,11 +25,11 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--with-system-zlib"
     "--with-system-libpng"
-  ] ++ stdenv.lib.optionals (hostPlatform != buildPlatform) [
+  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     #"-prefix=$out"
   ];
 
-  postInstall = if hostPlatform != buildPlatform && hostPlatform.isWindows then ''
+  postInstall = if stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isWindows then ''
     mv "$out"/bin/optipng{,.exe}
   '' else null;
 
diff --git a/pkgs/tools/graphics/pngout/default.nix b/pkgs/tools/graphics/pngout/default.nix
index afc1a2519fe1..333e5f600765 100644
--- a/pkgs/tools/graphics/pngout/default.nix
+++ b/pkgs/tools/graphics/pngout/default.nix
@@ -1,9 +1,9 @@
 {stdenv, fetchurl}:
 
 let
-  folder = if stdenv.system == "i686-linux" then "i686"
-  else if stdenv.system == "x86_64-linux" then "x86_64"
-  else throw "Unsupported system: ${stdenv.system}";
+  folder = if stdenv.hostPlatform.system == "i686-linux" then "i686"
+  else if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64"
+  else throw "Unsupported system: ${stdenv.hostPlatform.system}";
 in
 stdenv.mkDerivation {
   name = "pngout-20130221";
@@ -17,9 +17,9 @@ stdenv.mkDerivation {
     mkdir -p $out/bin
     cp ${folder}/pngout $out/bin
     
-    ${if stdenv.system == "i686-linux" then ''
+    ${if stdenv.hostPlatform.system == "i686-linux" then ''
         patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/bin/pngout
-      '' else if stdenv.system == "x86_64-linux" then ''
+      '' else if stdenv.hostPlatform.system == "x86_64-linux" then ''
         patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2 $out/bin/pngout
       '' else ""}
   '';
diff --git a/pkgs/tools/misc/bandwidth/default.nix b/pkgs/tools/misc/bandwidth/default.nix
index e8ea9117bc5a..e50faaca8995 100644
--- a/pkgs/tools/misc/bandwidth/default.nix
+++ b/pkgs/tools/misc/bandwidth/default.nix
@@ -2,11 +2,11 @@
 
 let
   arch =
-    if      stdenv.system == "x86_64-linux" then "bandwidth64"
-    else if stdenv.system == "i686-linux" then "bandwidth32"
-    else if stdenv.system == "x86_64-darwin" then "bandwidth-mac64"
-    else if stdenv.system == "i686-darwin" then "bandwidth-mac32"
-    else if stdenv.system == "i686-cygwin" then "bandwidth-win32"
+    if      stdenv.hostPlatform.system == "x86_64-linux" then "bandwidth64"
+    else if stdenv.hostPlatform.system == "i686-linux" then "bandwidth32"
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then "bandwidth-mac64"
+    else if stdenv.hostPlatform.system == "i686-darwin" then "bandwidth-mac32"
+    else if stdenv.hostPlatform.system == "i686-cygwin" then "bandwidth-win32"
     else throw "Unknown architecture";
 in
 stdenv.mkDerivation rec {
diff --git a/pkgs/tools/misc/bat/default.nix b/pkgs/tools/misc/bat/default.nix
index 6503dadf4573..03895f6c8478 100644
--- a/pkgs/tools/misc/bat/default.nix
+++ b/pkgs/tools/misc/bat/default.nix
@@ -2,13 +2,13 @@
 
 rustPlatform.buildRustPackage rec {
   name    = "bat-${version}";
-  version = "0.6.0";
+  version = "0.6.1";
 
   src = fetchFromGitHub {
     owner  = "sharkdp";
     repo   = "bat";
     rev    = "v${version}";
-    sha256 = "04ip0h1n7wavd7j7r7ppcy3v4987yv44mgw8qm8d56pcw67f9vwk";
+    sha256 = "19xmj3a3npx4v1mlvd31r3icml73mxjq6la5qifb2i35ciqnx9bd";
     fetchSubmodules = true;
   };
 
diff --git a/pkgs/tools/misc/bdf2psf/default.nix b/pkgs/tools/misc/bdf2psf/default.nix
index 5e4b6994094a..c9775ac6ae35 100644
--- a/pkgs/tools/misc/bdf2psf/default.nix
+++ b/pkgs/tools/misc/bdf2psf/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "bdf2psf-${version}";
-  version = "1.184";
+  version = "1.185";
 
   src = fetchurl {
     url = "mirror://debian/pool/main/c/console-setup/bdf2psf_${version}_all.deb";
-    sha256 = "0lyxiwm0586b8gyl13ks2rqqa6abkqaxc4i08hvwyza1k1cqm2jc";
+    sha256 = "0i8ppqj6yhdkvjkwfl588f2zpaybj61pq64bhlnmc8c4snwpn1z6";
   };
 
   buildInputs = [ dpkg ];
diff --git a/pkgs/tools/misc/byobu/default.nix b/pkgs/tools/misc/byobu/default.nix
index 931058cca2f8..0cd23a907d8b 100644
--- a/pkgs/tools/misc/byobu/default.nix
+++ b/pkgs/tools/misc/byobu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python, perl, textual-window-manager }:
+{ stdenv, fetchurl, python3, perl, textual-window-manager }:
 
 stdenv.mkDerivation rec {
   version = "5.127";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  buildInputs = [ python perl ];
+  buildInputs = [ python3 perl ];
   propagatedBuildInputs = [ textual-window-manager ];
 
   meta = {
diff --git a/pkgs/tools/misc/colord/default.nix b/pkgs/tools/misc/colord/default.nix
index a5d71a9487cc..e442850fbaaf 100644
--- a/pkgs/tools/misc/colord/default.nix
+++ b/pkgs/tools/misc/colord/default.nix
@@ -29,11 +29,11 @@ stdenv.mkDerivation rec {
     glib-compile-schemas $out/share/glib-2.0/schemas
   '';
 
-  PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "lib/systemd/system";
-  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "lib/systemd/user";
-  PKG_CONFIG_SYSTEMD_TMPFILESDIR = "lib/tmpfiles.d";
-  PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR= "share/bash-completion/completions";
-  PKG_CONFIG_UDEV_UDEVDIR = "lib/udev";
+  PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system";
+  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
+  PKG_CONFIG_SYSTEMD_TMPFILESDIR = "${placeholder "out"}/lib/tmpfiles.d";
+  PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR= "${placeholder "out"}/share/bash-completion/completions";
+  PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev";
 
   postFixup = ''
     wrapProgram "$out/libexec/colord-session" \
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 99a3b922901e..582f8d8f05f9 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -1,6 +1,5 @@
 { stdenv, lib, buildPackages
 , autoreconfHook, texinfo, fetchurl, perl, xz, libiconv, gmp ? null
-, hostPlatform, buildPlatform
 , aclSupport ? stdenv.isLinux, acl ? null
 , attrSupport ? stdenv.isLinux, attr ? null
 , selinuxSupport? false, libselinux ? null, libsepol ? null
@@ -24,10 +23,10 @@ stdenv.mkDerivation rec {
     sha256 = "0mxhw43d4wpqmvg0l4znk1vm10fy92biyh90lzdnqjcic2lb6cg8";
   };
 
-  patches = optional hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch;
+  patches = optional stdenv.hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch;
 
   # The test tends to fail on btrfs and maybe other unusual filesystems.
-  postPatch = optionalString (!hostPlatform.isDarwin) ''
+  postPatch = optionalString (!stdenv.hostPlatform.isDarwin) ''
     sed '2i echo Skipping dd sparse test && exit 0' -i ./tests/dd/sparse.sh
     sed '2i echo Skipping cp sparse test && exit 0' -i ./tests/cp/sparse.sh
     sed '2i echo Skipping rm deep-2 test && exit 0' -i ./tests/rm/deep-2.sh
@@ -45,9 +44,9 @@ stdenv.mkDerivation rec {
     ++ optional (singleBinary != false)
       ("--enable-single-binary" + optionalString (isString singleBinary) "=${singleBinary}")
     ++ optional withOpenssl "--with-openssl"
-    ++ optional hostPlatform.isSunOS "ac_cv_func_inotify_init=no"
+    ++ optional stdenv.hostPlatform.isSunOS "ac_cv_func_inotify_init=no"
     ++ optional withPrefix "--program-prefix=g"
-    ++ optionals (hostPlatform != buildPlatform && hostPlatform.libc == "glibc") [
+    ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc == "glibc") [
       # TODO(19b98110126fde7cbb1127af7e3fe1568eacad3d): Needed for fstatfs() I
       # don't know why it is not properly detected cross building with glibc.
       "fu_cv_sys_stat_statfs2_bsize=yes"
@@ -58,37 +57,37 @@ stdenv.mkDerivation rec {
     ++ optional aclSupport acl
     ++ optional attrSupport attr
     ++ optional withOpenssl openssl
-    ++ optionals hostPlatform.isCygwin [ autoreconfHook texinfo ]   # due to patch
+    ++ optionals stdenv.hostPlatform.isCygwin [ autoreconfHook texinfo ]   # due to patch
     ++ optionals selinuxSupport [ libselinux libsepol ]
        # TODO(@Ericson2314): Investigate whether Darwin could benefit too
-    ++ optional (hostPlatform != buildPlatform && hostPlatform.libc != "glibc") libiconv;
+    ++ optional (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc != "glibc") libiconv;
 
   # The tests are known broken on Cygwin
   # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
   # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),
   # and {Open,Free}BSD.
   # With non-standard storeDir: https://github.com/NixOS/nix/issues/512
-  doCheck = hostPlatform == buildPlatform
-    && hostPlatform.libc == "glibc"
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform
+    && stdenv.hostPlatform.libc == "glibc"
     && builtins.storeDir == "/nix/store";
 
   # Prevents attempts of running 'help2man' on cross-built binaries.
-  PERL = if hostPlatform == buildPlatform then null else "missing";
+  PERL = if stdenv.hostPlatform == stdenv.buildPlatform then null else "missing";
 
   # Saw random failures like ‘help2man: can't get '--help' info from
   # man/sha512sum.td/sha512sum’.
   enableParallelBuilding = false;
 
   NIX_LDFLAGS = optionalString selinuxSupport "-lsepol";
-  FORCE_UNSAFE_CONFIGURE = optionalString hostPlatform.isSunOS "1";
+  FORCE_UNSAFE_CONFIGURE = optionalString stdenv.hostPlatform.isSunOS "1";
 
   # Works around a bug with 8.26:
   # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually).  Stop.
-  preInstall = optionalString (hostPlatform != buildPlatform) ''
+  preInstall = optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     sed -i Makefile -e 's|^INSTALL =.*|INSTALL = ${buildPackages.coreutils}/bin/install -c|'
   '';
 
-  postInstall = optionalString (hostPlatform != buildPlatform && !minimal) ''
+  postInstall = optionalString (stdenv.hostPlatform != stdenv.buildPlatform && !minimal) ''
     rm $out/share/man/man1/*
     cp ${buildPackages.coreutils}/share/man/man1/* $out/share/man/man1
   ''
diff --git a/pkgs/tools/misc/cutecom/default.nix b/pkgs/tools/misc/cutecom/default.nix
index 3d6d2328da1e..94f36adcf9b0 100644
--- a/pkgs/tools/misc/cutecom/default.nix
+++ b/pkgs/tools/misc/cutecom/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "cutecom-${version}";
-  version = "0.45.0";
+  version = "0.50.0";
   src = fetchFromGitHub {
     owner = "neundorf";
     repo = "CuteCom";
     rev = "v${version}";
-    sha256 = "07h1r7bcz86fvcvxq6g5zyh7fsginx27jbp81a7hjhhhn6v0dsmh";
+    sha256 = "0zjmbjrwwan9z5cphqjcq2h71cm4mw88j457lzdqb29cg4bdn3ag";
   };
 
   preConfigure = ''
diff --git a/pkgs/tools/misc/execline/default.nix b/pkgs/tools/misc/execline/default.nix
index 0b606882a5c3..360808f4280b 100644
--- a/pkgs/tools/misc/execline/default.nix
+++ b/pkgs/tools/misc/execline/default.nix
@@ -32,7 +32,7 @@ in stdenv.mkDerivation rec {
     "--with-dynlib=${skalibs.lib}/lib"
   ]
   ++ (if stdenv.isDarwin then [ "--disable-shared" ] else [ "--enable-shared" ])
-  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.system}");
+  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.hostPlatform.system}");
 
   postInstall = ''
     mkdir -p $doc/share/doc/execline
diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix
index 66b7ef4c2919..d6eca100411b 100644
--- a/pkgs/tools/misc/findutils/default.nix
+++ b/pkgs/tools/misc/findutils/default.nix
@@ -1,6 +1,5 @@
 { stdenv, fetchurl
 , coreutils
-, buildPlatform, hostPlatform
 }:
 
 stdenv.mkDerivation rec {
@@ -17,10 +16,10 @@ stdenv.mkDerivation rec {
 
   # Since glibc-2.25 the i686 tests hang reliably right after test-sleep.
   doCheck
-    =  !hostPlatform.isDarwin
-    && !(hostPlatform.libc == "glibc" && hostPlatform.isi686)
-    && (hostPlatform.libc != "musl")
-    && hostPlatform == buildPlatform;
+    =  !stdenv.hostPlatform.isDarwin
+    && !(stdenv.hostPlatform.libc == "glibc" && stdenv.hostPlatform.isi686)
+    && (stdenv.hostPlatform.libc != "musl")
+    && stdenv.hostPlatform == stdenv.buildPlatform;
 
   outputs = [ "out" "info" ];
 
diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix
index 63511782f00b..481a07ef491b 100644
--- a/pkgs/tools/misc/grub/2.0x.nix
+++ b/pkgs/tools/misc/grub/2.0x.nix
@@ -28,8 +28,8 @@ let
     "aarch64-linux".target = "arm64";
   };
 
-  canEfi = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) efiSystemsBuild);
-  inPCSystems = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) pcSystems);
+  canEfi = any (system: stdenv.hostPlatform.system == system) (mapAttrsToList (name: _: name) efiSystemsBuild);
+  inPCSystems = any (system: stdenv.hostPlatform.system == system) (mapAttrsToList (name: _: name) pcSystems);
 
   version = "2.02";
 
@@ -86,14 +86,14 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--enable-grub-mount" ] # dep of os-prober
     ++ optional zfsSupport "--enable-libzfs"
-    ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.system}.target}" "--program-prefix=" ]
-    ++ optionals xenSupport [ "--with-platform=xen" "--target=${efiSystemsBuild.${stdenv.system}.target}"];
+    ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" "--program-prefix=" ]
+    ++ optionals xenSupport [ "--with-platform=xen" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}"];
 
   # save target that grub is compiled for
   grubTarget = if efiSupport
-               then "${efiSystemsInstall.${stdenv.system}.target}-efi"
+               then "${efiSystemsInstall.${stdenv.hostPlatform.system}.target}-efi"
                else if inPCSystems
-                    then "${pcSystems.${stdenv.system}.target}-pc"
+                    then "${pcSystems.${stdenv.hostPlatform.system}.target}-pc"
                     else "";
 
   doCheck = false;
diff --git a/pkgs/tools/misc/grub/pvgrub_image/default.nix b/pkgs/tools/misc/grub/pvgrub_image/default.nix
index df5e3f15e95a..19d8afb18575 100644
--- a/pkgs/tools/misc/grub/pvgrub_image/default.nix
+++ b/pkgs/tools/misc/grub/pvgrub_image/default.nix
@@ -22,11 +22,11 @@ stdenv.mkDerivation rec {
     tar -cf memdisk.tar grub.cfg
     # We include all modules except all_video.mod as otherwise grub will fail printing "no symbol table"
     # if we include it.
-    grub-mkimage -O "${efiSystemsBuild.${stdenv.system}.target}-xen" -c grub-bootstrap.cfg \
-      -m memdisk.tar -o "grub-${efiSystemsBuild.${stdenv.system}.target}-xen.bin" \
-      $(ls "${grub2_xen}/lib/grub/${efiSystemsBuild.${stdenv.system}.target}-xen/" |grep 'mod''$'|grep -v '^all_video\.mod''$')
+    grub-mkimage -O "${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen" -c grub-bootstrap.cfg \
+      -m memdisk.tar -o "grub-${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen.bin" \
+      $(ls "${grub2_xen}/lib/grub/${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen/" |grep 'mod''$'|grep -v '^all_video\.mod''$')
     mkdir -p "$out/lib/grub-xen"
-    cp "grub-${efiSystemsBuild.${stdenv.system}.target}-xen.bin" $out/lib/grub-xen/
+    cp "grub-${efiSystemsBuild.${stdenv.hostPlatform.system}.target}-xen.bin" $out/lib/grub-xen/
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/misc/grub/trusted.nix b/pkgs/tools/misc/grub/trusted.nix
index 63a73658e0ac..0e867d7cffd0 100644
--- a/pkgs/tools/misc/grub/trusted.nix
+++ b/pkgs/tools/misc/grub/trusted.nix
@@ -10,7 +10,7 @@ let
     "x86_64-linux".target = "i386";
   };
 
-  inPCSystems = any (system: stdenv.system == system) (mapAttrsToList (name: _: name) pcSystems);
+  inPCSystems = any (system: stdenv.hostPlatform.system == system) (mapAttrsToList (name: _: name) pcSystems);
 
   version = if for_HP_laptop then "1.2.1" else "1.2.0";
 
@@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
 
   # save target that grub is compiled for
   grubTarget = if inPCSystems
-               then "${pcSystems.${stdenv.system}.target}-pc"
+               then "${pcSystems.${stdenv.hostPlatform.system}.target}-pc"
                else "";
 
   doCheck = false;
diff --git a/pkgs/tools/misc/lolcat/Gemfile.lock b/pkgs/tools/misc/lolcat/Gemfile.lock
index 3c4646ddf48f..58f62b64e718 100644
--- a/pkgs/tools/misc/lolcat/Gemfile.lock
+++ b/pkgs/tools/misc/lolcat/Gemfile.lock
@@ -1,13 +1,13 @@
 GEM
   remote: http://rubygems.org/
   specs:
-    lolcat (99.9.11)
+    lolcat (99.9.19)
       manpages (~> 0.6.1)
       paint (~> 2.0.0)
-      trollop (~> 2.1.2)
+      trollop (~> 2.1.3)
     manpages (0.6.1)
     paint (2.0.1)
-    trollop (2.1.2)
+    trollop (2.1.3)
 
 PLATFORMS
   ruby
diff --git a/pkgs/tools/misc/lolcat/gemset.nix b/pkgs/tools/misc/lolcat/gemset.nix
index 86069f7ecc0e..3e68f307530e 100644
--- a/pkgs/tools/misc/lolcat/gemset.nix
+++ b/pkgs/tools/misc/lolcat/gemset.nix
@@ -3,10 +3,10 @@
     dependencies = ["manpages" "paint" "trollop"];
     source = {
       remotes = ["http://rubygems.org"];
-      sha256 = "1z0j354sj2qm2srgz3i28s347fwylvv1j614806cr33zcd1j4mwp";
+      sha256 = "05zm92ad0ws9fklpz1xk94hy95argwana01c6rr2xbx2q4mcil9m";
       type = "gem";
     };
-    version = "99.9.11";
+    version = "99.9.19";
   };
   manpages = {
     source = {
@@ -27,9 +27,9 @@
   trollop = {
     source = {
       remotes = ["http://rubygems.org"];
-      sha256 = "0415y63df86sqj43c0l82and65ia5h64if7n0znkbrmi6y0jwhl8";
+      sha256 = "1rzx9rkacpq58dsvbbzs4cpybls1v1h36xskkfs5q2askpdr00wq";
       type = "gem";
     };
-    version = "2.1.2";
+    version = "2.1.3";
   };
 }
\ No newline at end of file
diff --git a/pkgs/tools/misc/mongodb-compass/default.nix b/pkgs/tools/misc/mongodb-compass/default.nix
index f8475ee2e0e0..840d4eacd378 100644
--- a/pkgs/tools/misc/mongodb-compass/default.nix
+++ b/pkgs/tools/misc/mongodb-compass/default.nix
@@ -43,13 +43,13 @@ let
   ] + ":${stdenv.cc.cc.lib}/lib64";
 
   src =
-    if stdenv.system == "x86_64-linux" then
+    if stdenv.hostPlatform.system == "x86_64-linux" then
       fetchurl {
         url = "https://downloads.mongodb.com/compass/mongodb-compass_${version}_amd64.deb";
         sha256 = "0x23jshnr0rafm5sn2vhq2y2gryg8mksahzyv5fszblgaxay234p";
       }
     else
-      throw "MongoDB compass is not supported on ${stdenv.system}";
+      throw "MongoDB compass is not supported on ${stdenv.hostPlatform.system}";
 
 in stdenv.mkDerivation {
   name = "mongodb-compass-${version}";
diff --git a/pkgs/tools/misc/mprime/default.nix b/pkgs/tools/misc/mprime/default.nix
index 850ed32998b4..e18e9020e1da 100644
--- a/pkgs/tools/misc/mprime/default.nix
+++ b/pkgs/tools/misc/mprime/default.nix
@@ -2,15 +2,15 @@
 
 let
   srcDir =
-    if stdenv.system == "x86_64-linux" then "linux64"
-    else if stdenv.system == "i686-linux" then "linux"
-    else if stdenv.system == "x86_64-darwin" then "macosx64"
+    if stdenv.hostPlatform.system == "x86_64-linux" then "linux64"
+    else if stdenv.hostPlatform.system == "i686-linux" then "linux"
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then "macosx64"
     else throwSystem;
-  throwSystem = throw "Unsupported system: ${stdenv.system}";
+  throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
   gwnum =
-    if stdenv.system == "x86_64-linux" then "make64"
-    else if stdenv.system == "i686-linux" then "makefile"
-    else if stdenv.system == "x86_64-darwin" then "makemac"
+    if stdenv.hostPlatform.system == "x86_64-linux" then "make64"
+    else if stdenv.hostPlatform.system == "i686-linux" then "makefile"
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then "makemac"
     else throwSystem;
 in
 
diff --git a/pkgs/tools/misc/ocz-ssd-guru/default.nix b/pkgs/tools/misc/ocz-ssd-guru/default.nix
index afe7a81ebac8..9ffb89aca6b1 100644
--- a/pkgs/tools/misc/ocz-ssd-guru/default.nix
+++ b/pkgs/tools/misc/ocz-ssd-guru/default.nix
@@ -1,7 +1,7 @@
 { fetchurl, stdenv, xorg, freetype, fontconfig, libGLU_combined, glibc, makeWrapper }:
 
 let
-  system = if stdenv.system == "x86_64-linux" then "linux64" else "linux32";
+  system = if stdenv.hostPlatform.system == "x86_64-linux" then "linux64" else "linux32";
 in
 stdenv.mkDerivation rec {
   name = "ocz-ssd-guru-${version}";
diff --git a/pkgs/tools/misc/os-prober/default.nix b/pkgs/tools/misc/os-prober/default.nix
index 6211c863bd49..59a60e356b80 100644
--- a/pkgs/tools/misc/os-prober/default.nix
+++ b/pkgs/tools/misc/os-prober/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     install -Dt $out/share common.sh
 
     # probes
-    case "${stdenv.system}" in
+    case "${stdenv.hostPlatform.system}" in
         i686*|x86_64*) ARCH=x86;;
         powerpc*) ARCH=powerpc;;
         arm*) ARCH=arm;;
diff --git a/pkgs/tools/misc/otfcc/default.nix b/pkgs/tools/misc/otfcc/default.nix
index 052999033a1e..acf46a58a6bf 100644
--- a/pkgs/tools/misc/otfcc/default.nix
+++ b/pkgs/tools/misc/otfcc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, premake5, ninja, hostPlatform }:
+{ stdenv, fetchFromGitHub, premake5, ninja }:
 
 stdenv.mkDerivation rec {
   name = "otfcc-${version}";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     premake5 ninja
   '';
 
-  ninjaFlags = let x = if hostPlatform.isi686 then "x86" else "x64"; in
+  ninjaFlags = let x = if stdenv.hostPlatform.isi686 then "x86" else "x64"; in
     [ "-C" "build/ninja" "otfccdump_release_${x}" "otfccbuild_release_${x}" ];
 
   installPhase = ''
diff --git a/pkgs/tools/misc/pspg/default.nix b/pkgs/tools/misc/pspg/default.nix
index a1492259e8c4..21d81507dee0 100644
--- a/pkgs/tools/misc/pspg/default.nix
+++ b/pkgs/tools/misc/pspg/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "pspg-${version}";
-  version = "1.3.0";
+  version = "1.4.2";
 
   src = fetchFromGitHub {
     owner = "okbob";
     repo = "pspg";
     rev = "${version}";
-    sha256 = "1m63bhhglrpc2g68i5bigrzlpvg98qs83jgvf2gsbc4gnx9hywk5";
+    sha256 = "0hmx9p5pbydnf8sil4vqpmly5mq2rvcj8a33s9fvfisnxxsqz73v";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/tools/misc/s6-portable-utils/default.nix b/pkgs/tools/misc/s6-portable-utils/default.nix
index 014e000eabdb..5f56daf3a48d 100644
--- a/pkgs/tools/misc/s6-portable-utils/default.nix
+++ b/pkgs/tools/misc/s6-portable-utils/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   # Explicitly setting target ensures code can be compiled against a skalibs
   # binary built on a different version of darwin.
   # http://www.skarnet.org/cgi-bin/archive.cgi?1:mss:623:heiodchokfjdkonfhdph
-  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.system}");
+  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.hostPlatform.system}");
 
   postInstall = ''
     mkdir -p $doc/share/doc/s6-portable-utils/
diff --git a/pkgs/tools/misc/staruml/default.nix b/pkgs/tools/misc/staruml/default.nix
index 2a06400b411f..486634452ae9 100644
--- a/pkgs/tools/misc/staruml/default.nix
+++ b/pkgs/tools/misc/staruml/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   name = "staruml-${version}";
 
   src =
-    if stdenv.system == "i686-linux" then fetchurl {
+    if stdenv.hostPlatform.system == "i686-linux" then fetchurl {
       url = "http://staruml.io/download/release/v${version}/StarUML-v${version}-32-bit.deb";
       sha256 = "0vb3k9m3l6pmsid4shlk0xdjsriq3gxzm8q7l04didsppg0vvq1n";
     } else fetchurl {
diff --git a/pkgs/tools/misc/ttyrec/default.nix b/pkgs/tools/misc/ttyrec/default.nix
index c7cd71ffb6d7..ca6651718117 100644
--- a/pkgs/tools/misc/ttyrec/default.nix
+++ b/pkgs/tools/misc/ttyrec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, buildPlatform }:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "ttyrec-${version}";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./clang-fixes.patch ];
 
-  makeFlags = stdenv.lib.optional buildPlatform.isLinux "CFLAGS=-DSVR4"
+  makeFlags = stdenv.lib.optional stdenv.buildPlatform.isLinux "CFLAGS=-DSVR4"
     ++ stdenv.lib.optional stdenv.cc.isClang "CC=clang";
 
   installPhase = ''
diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix
index ebdd08b23a84..7ed8f3bfd71b 100644
--- a/pkgs/tools/misc/youtube-dl/default.nix
+++ b/pkgs/tools/misc/youtube-dl/default.nix
@@ -15,11 +15,11 @@
 buildPythonPackage rec {
 
   pname = "youtube-dl";
-  version = "2018.08.04";
+  version = "2018.08.28";
 
   src = fetchurl {
     url = "https://yt-dl.org/downloads/${version}/${pname}-${version}.tar.gz";
-    sha256 = "1hcx99qbbyigc8k98c8bcc6a2wnhq6493fmrkl7rysc8krlxr0pm";
+    sha256 = "1swdp4czvm0752psbi8a4qw5i9x18s7nhivh7iw92274pmqxq9wi";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/tools/networking/airfield/default.nix b/pkgs/tools/networking/airfield/default.nix
index 6f6009c107ba..70005038f99d 100644
--- a/pkgs/tools/networking/airfield/default.nix
+++ b/pkgs/tools/networking/airfield/default.nix
@@ -6,7 +6,7 @@
 let
   nodePackages = import ./node.nix {
     inherit pkgs;
-    system = stdenv.system;
+    system = stdenv.hostPlatform.system;
   };
 
   runtimeEnv = buildEnv {
diff --git a/pkgs/tools/networking/filegive/default.nix b/pkgs/tools/networking/filegive/default.nix
index 6fef6a9e7fa9..a76519b36b57 100644
--- a/pkgs/tools/networking/filegive/default.nix
+++ b/pkgs/tools/networking/filegive/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ go ];
 
   buildPhase = ''
-    ${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "export GOARM=5"}
+    ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "export GOARM=5"}
 
     mkdir $TMPDIR/go
     export GOPATH=$TMPDIR/go
diff --git a/pkgs/tools/networking/logmein-hamachi/default.nix b/pkgs/tools/networking/logmein-hamachi/default.nix
index 2e045ad8de91..c5c7e18ba6d2 100644
--- a/pkgs/tools/networking/logmein-hamachi/default.nix
+++ b/pkgs/tools/networking/logmein-hamachi/default.nix
@@ -4,13 +4,13 @@ with stdenv.lib;
 
 let
   arch =
-    if stdenv.system == "x86_64-linux" then "x64"
-    else if stdenv.system == "i686-linux" then "x86"
+    if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
+    else if stdenv.hostPlatform.system == "i686-linux" then "x86"
     else throwSystem;
-  throwSystem = throw "Unsupported system: ${stdenv.system}";
+  throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
   sha256 =
-    if stdenv.system == "x86_64-linux" then "11mxa4kls5xjj3462ycrfvfxb1xkk23p5m9iirvwsi0zdmhpnwm8"
-    else if stdenv.system == "i686-linux" then "03ml9xv19km99f0z7fpr21b1zkxvw7q39kjzd8wpb2pds51wnc62"
+    if stdenv.hostPlatform.system == "x86_64-linux" then "11mxa4kls5xjj3462ycrfvfxb1xkk23p5m9iirvwsi0zdmhpnwm8"
+    else if stdenv.hostPlatform.system == "i686-linux" then "03ml9xv19km99f0z7fpr21b1zkxvw7q39kjzd8wpb2pds51wnc62"
     else throwSystem;
   libraries = stdenv.lib.makeLibraryPath [ stdenv.cc.cc ];
 
diff --git a/pkgs/tools/networking/ngrok-2/default.nix b/pkgs/tools/networking/ngrok-2/default.nix
index 23725fb2d874..fdf9067dfee9 100644
--- a/pkgs/tools/networking/ngrok-2/default.nix
+++ b/pkgs/tools/networking/ngrok-2/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   } else if stdenv.isDarwin then fetchurl {
     url = "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-darwin-386.zip";
     sha256 = "0yfd250b55wcpgqd00rqfaa7a82f35fmybb31q5xwdbgc2i47pbh";
-  } else throw "platform ${stdenv.system} not supported!";
+  } else throw "platform ${stdenv.hostPlatform.system} not supported!";
 
   sourceRoot = ".";
 
diff --git a/pkgs/tools/networking/s6-dns/default.nix b/pkgs/tools/networking/s6-dns/default.nix
index db2071ab17da..29d66e4be2ce 100644
--- a/pkgs/tools/networking/s6-dns/default.nix
+++ b/pkgs/tools/networking/s6-dns/default.nix
@@ -33,7 +33,7 @@ in stdenv.mkDerivation rec {
     "--with-dynlib=${skalibs.lib}/lib"
   ]
   ++ (if stdenv.isDarwin then [ "--disable-shared" ] else [ "--enable-shared" ])
-  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.system}");
+  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.hostPlatform.system}");
 
   postInstall = ''
     mkdir -p $doc/share/doc/s6-dns/
diff --git a/pkgs/tools/networking/s6-networking/default.nix b/pkgs/tools/networking/s6-networking/default.nix
index 1971bbffa406..f7278d5c6a24 100644
--- a/pkgs/tools/networking/s6-networking/default.nix
+++ b/pkgs/tools/networking/s6-networking/default.nix
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
        "--with-include=${lib.getDev sslLibs.${sslSupport}}/include"
        "--with-lib=${lib.getLib sslLibs.${sslSupport}}/lib"
      ])
-  ++ (lib.optional stdenv.isDarwin "--build=${stdenv.system}");
+  ++ (lib.optional stdenv.isDarwin "--build=${stdenv.hostPlatform.system}");
 
   postInstall = ''
     mkdir -p $doc/share/doc/s6-networking/
diff --git a/pkgs/tools/networking/strongswan/default.nix b/pkgs/tools/networking/strongswan/default.nix
index 74405a472f8a..2f19294784ec 100644
--- a/pkgs/tools/networking/strongswan/default.nix
+++ b/pkgs/tools/networking/strongswan/default.nix
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
       "--enable-af-alg" "--enable-xauth-pam" "--enable-chapoly"
       "--enable-curl" ]
     ++ optionals stdenv.isx86_64 [ "--enable-aesni" "--enable-rdrand" ]
-    ++ optional (stdenv.system == "i686-linux") "--enable-padlock"
+    ++ optional (stdenv.hostPlatform.system == "i686-linux") "--enable-padlock"
     ++ optionals enableTNC [
          "--disable-gmp" "--disable-aes" "--disable-md5" "--disable-sha1" "--disable-sha2" "--disable-fips-prf"
          "--enable-eap-tnc" "--enable-eap-ttls" "--enable-eap-dynamic" "--enable-tnccs-20"
diff --git a/pkgs/tools/package-management/cargo-edit/cargo-edit.nix b/pkgs/tools/package-management/cargo-edit/cargo-edit.nix
index 67aa52f47894..7224c11f183f 100644
--- a/pkgs/tools/package-management/cargo-edit/cargo-edit.nix
+++ b/pkgs/tools/package-management/cargo-edit/cargo-edit.nix
@@ -2,7 +2,7 @@
 { pkgs }:
 
 with pkgs;
-let kernel = buildPlatform.parsed.kernel.name;
+let kernel = stdenv.buildPlatform.parsed.kernel.name;
     updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
     mapFeatures = features: map (fun: fun { features = features; });
     mkFeatures = feat: lib.lists.foldl (features: featureName:
diff --git a/pkgs/tools/package-management/cargo-update/cargo-update.nix b/pkgs/tools/package-management/cargo-update/cargo-update.nix
index 83fdaad5bfdb..1bd8aadf4982 100644
--- a/pkgs/tools/package-management/cargo-update/cargo-update.nix
+++ b/pkgs/tools/package-management/cargo-update/cargo-update.nix
@@ -1,7 +1,7 @@
 # Generated by carnix 0.6.6: carnix -o cargo-update.nix --src ./. Cargo.lock --standalone
-{ lib, buildPlatform, buildRustCrate, fetchgit }:
-let kernel = buildPlatform.parsed.kernel.name;
-    abi = buildPlatform.parsed.abi.name;
+{ lib, stdenv, buildRustCrate, fetchgit }:
+let kernel = stdenv.hostPlatform.parsed.kernel.name;
+    abi = stdenv.hostPlatform.parsed.abi.name;
     include = includedFiles: src: builtins.filterSource (path: type:
       lib.lists.any (f:
         let p = toString (src + ("/" + f)); in
diff --git a/pkgs/tools/package-management/checkinstall/default.nix b/pkgs/tools/package-management/checkinstall/default.nix
index fea6ccedd34f..df1bf794062f 100644
--- a/pkgs/tools/package-management/checkinstall/default.nix
+++ b/pkgs/tools/package-management/checkinstall/default.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
     ./set-buildroot.patch
   ]
 
-  ++ stdenv.lib.optional (stdenv.system == "x86_64-linux") 
+  ++ stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-linux") 
     # Force use of old memcpy so that installwatch works on Glibc <
     # 2.14.
     ./use-old-memcpy.patch;
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index c06a4f41afb1..bc07dd457f38 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -2,7 +2,6 @@
 , pkgconfig, boehmgc, perlPackages, libsodium, aws-sdk-cpp, brotli, boost
 , autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook_xsl_ns
 , busybox-sandbox-shell
-, hostPlatform, buildPlatform
 , storeDir ? "/nix/store"
 , stateDir ? "/nix/var"
 , confDir ? "/etc"
@@ -73,8 +72,8 @@ let
         "--with-sandbox-shell=${sh}/bin/busybox"
       ]
       ++ lib.optional (
-          hostPlatform != buildPlatform && hostPlatform ? nix && hostPlatform.nix ? system
-      ) ''--with-system=${hostPlatform.nix.system}''
+          stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform ? nix && stdenv.hostPlatform.nix ? system
+      ) ''--with-system=${stdenv.hostPlatform.nix.system}''
          # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
       ++ lib.optional (!libseccomp.meta.available) "--disable-seccomp-sandboxing";
 
diff --git a/pkgs/tools/package-management/nixui/default.nix b/pkgs/tools/package-management/nixui/default.nix
index 6f46b39e65b1..804bbbdf8d71 100644
--- a/pkgs/tools/package-management/nixui/default.nix
+++ b/pkgs/tools/package-management/nixui/default.nix
@@ -9,7 +9,7 @@ let
   };
   nixui = (import ./nixui.nix {
     inherit pkgs;
-    inherit (stdenv) system;
+    inherit (stdenv.hostPlatform) system;
   })."nixui-git://github.com/matejc/nixui.git#0.2.1";
   script = writeScript "nixui" ''
     #! ${stdenv.shell}
diff --git a/pkgs/tools/security/afl/default.nix b/pkgs/tools/security/afl/default.nix
index c61cbeb32682..3476606049d1 100644
--- a/pkgs/tools/security/afl/default.nix
+++ b/pkgs/tools/security/afl/default.nix
@@ -4,9 +4,9 @@
 
 let
   afl-qemu = callPackage ./qemu.nix {};
-  qemu-exe-name = if stdenv.system == "x86_64-linux" then "qemu-x86_64"
-    else if stdenv.system == "i686-linux" then "qemu-i386"
-    else throw "afl: no support for ${stdenv.system}!";
+  qemu-exe-name = if stdenv.hostPlatform.system == "x86_64-linux" then "qemu-x86_64"
+    else if stdenv.hostPlatform.system == "i686-linux" then "qemu-i386"
+    else throw "afl: no support for ${stdenv.hostPlatform.system}!";
 in
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/tools/security/afl/qemu.nix b/pkgs/tools/security/afl/qemu.nix
index 7637dcf246af..82de6474e598 100644
--- a/pkgs/tools/security/afl/qemu.nix
+++ b/pkgs/tools/security/afl/qemu.nix
@@ -16,9 +16,9 @@ let
   aflTypesFile = writeText "afl-types.h"
     (builtins.readFile ./qemu-patches/afl-types.h);
 
-  cpuTarget = if stdenv.system == "x86_64-linux" then "x86_64-linux-user"
-    else if stdenv.system == "i686-linux" then "i386-linux-user"
-    else throw "afl: no support for ${stdenv.system}!";
+  cpuTarget = if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux-user"
+    else if stdenv.hostPlatform.system == "i686-linux" then "i386-linux-user"
+    else throw "afl: no support for ${stdenv.hostPlatform.system}!";
 in
 stdenv.mkDerivation rec {
   name = "afl-${n}";
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
       vde2 texinfo libuuid flex bison lzo snappy autoconf
       libcap_ng gnutls
     ]
-    ++ optionals (hasSuffix "linux" stdenv.system) [ libaio ];
+    ++ optionals (hasSuffix "linux" stdenv.hostPlatform.system) [ libaio ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/tools/security/encryptr/default.nix b/pkgs/tools/security/encryptr/default.nix
index 2cf07c63a84a..8d0c78764319 100644
--- a/pkgs/tools/security/encryptr/default.nix
+++ b/pkgs/tools/security/encryptr/default.nix
@@ -5,13 +5,13 @@
 }:
 
 let
-  arch = if stdenv.system == "x86_64-linux" then "amd"
-    else if stdenv.system == "i686-linux" then "i386"
-    else throw "Encryptr for ${stdenv.system} not supported!";
+  arch = if stdenv.hostPlatform.system == "x86_64-linux" then "amd"
+    else if stdenv.hostPlatform.system == "i686-linux" then "i386"
+    else throw "Encryptr for ${stdenv.hostPlatform.system} not supported!";
 
-  sha256 = if stdenv.system == "x86_64-linux" then "1j3g467g7ar86hpnh6q9mf7mh2h4ia94mwhk1283zh739s2g53q2"
-    else if stdenv.system == "i686-linux" then "02j9hg9b1jlv25q1sjfhv8d46mii33f94dj0ccn83z9z18q4y2cm"
-    else throw "Encryptr for ${stdenv.system} not supported!";
+  sha256 = if stdenv.hostPlatform.system == "x86_64-linux" then "1j3g467g7ar86hpnh6q9mf7mh2h4ia94mwhk1283zh739s2g53q2"
+    else if stdenv.hostPlatform.system == "i686-linux" then "02j9hg9b1jlv25q1sjfhv8d46mii33f94dj0ccn83z9z18q4y2cm"
+    else throw "Encryptr for ${stdenv.hostPlatform.system} not supported!";
 
 in stdenv.mkDerivation rec {
   name = "encryptr-${version}";
diff --git a/pkgs/tools/security/enpass/default.nix b/pkgs/tools/security/enpass/default.nix
index b99087e475d2..0f0c4233ca9d 100644
--- a/pkgs/tools/security/enpass/default.nix
+++ b/pkgs/tools/security/enpass/default.nix
@@ -1,8 +1,9 @@
-{stdenv, system, fetchurl, dpkg, openssl, xorg
+{ stdenv, fetchurl, dpkg, openssl, xorg
 , glib, libGLU_combined, libpulseaudio, zlib, dbus, fontconfig, freetype
 , gtk2, pango, atk, cairo, gdk_pixbuf, jasper, xkeyboardconfig
 , makeWrapper , python, pythonPackages, lib
-, libredirect, lsof}:
+, libredirect, lsof
+}:
 
 let
   all_data = builtins.fromJSON (builtins.readFile ./data.json);
@@ -11,7 +12,7 @@ let
     x86_64-linux = "amd64";
   };
 
-  data = all_data.${system_map.${system} or (throw "Unsupported platform")};
+  data = all_data.${system_map.${stdenv.hostPlatform.system} or (throw "Unsupported platform")};
 
   baseUrl = http://repo.sinew.in;
 
diff --git a/pkgs/tools/security/pcsc-scm-scl011/default.nix b/pkgs/tools/security/pcsc-scm-scl011/default.nix
index 1418a4ead580..88ca8a3d1b1a 100644
--- a/pkgs/tools/security/pcsc-scm-scl011/default.nix
+++ b/pkgs/tools/security/pcsc-scm-scl011/default.nix
@@ -1,9 +1,9 @@
 { stdenv, fetchurl, unzip, libusb }:
 
 let
-  arch = if stdenv.system == "i686-linux" then "32"
-  else if stdenv.system == "x86_64-linux" then "64"
-  else throw "Unsupported system: ${stdenv.system}";
+  arch = if stdenv.hostPlatform.system == "i686-linux" then "32"
+  else if stdenv.hostPlatform.system == "x86_64-linux" then "64"
+  else throw "Unsupported system: ${stdenv.hostPlatform.system}";
 in
 stdenv.mkDerivation rec {
   name = "pcsc-scm-scl-${version}";
diff --git a/pkgs/tools/security/sshuttle/default.nix b/pkgs/tools/security/sshuttle/default.nix
index f7878df228f2..c701b9dba73d 100644
--- a/pkgs/tools/security/sshuttle/default.nix
+++ b/pkgs/tools/security/sshuttle/default.nix
@@ -12,7 +12,7 @@ python3Packages.buildPythonApplication rec {
 
   patches = [ ./sudo.patch ];
 
-  nativeBuildInputs = [ makeWrapper python3Packages.setuptools_scm ] ++ stdenv.lib.optional (stdenv.system != "i686-linux") pandoc;
+  nativeBuildInputs = [ makeWrapper python3Packages.setuptools_scm ] ++ stdenv.lib.optional (stdenv.hostPlatform.system != "i686-linux") pandoc;
   buildInputs =
     [ coreutils openssh procps nettools ]
     ++ stdenv.lib.optionals stdenv.isLinux [ iptables ];
diff --git a/pkgs/tools/system/at/default.nix b/pkgs/tools/system/at/default.nix
index baac00bfa763..1e3bf0c0050c 100644
--- a/pkgs/tools/system/at/default.nix
+++ b/pkgs/tools/system/at/default.nix
@@ -5,12 +5,12 @@
 
 stdenv.mkDerivation rec {
   name = "at-${version}";
-  version = "3.1.20";
+  version = "3.1.23";
 
   src = fetchurl {
     # Debian is apparently the last location where it can be found.
     url = "mirror://debian/pool/main/a/at/at_${version}.orig.tar.gz";
-    sha256 = "1fgsrqpx0r6qcjxmlsqnwilydhfxn976c870mjc0n1bkmcy94w88";
+    sha256 = "040pr2ivfbrhvrhzis97cpwfkzpr7nin33nc301aga5aajlhlicp";
   };
 
   patches = [
diff --git a/pkgs/tools/system/facter/default.nix b/pkgs/tools/system/facter/default.nix
index c603d7c1c958..300778c0935e 100644
--- a/pkgs/tools/system/facter/default.nix
+++ b/pkgs/tools/system/facter/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   name = "facter-${version}";
-  version = "3.11.3";
+  version = "3.11.4";
 
   src = fetchFromGitHub {
-    sha256 = "1lkbcg6vlyrahgqhyp2a9jb91az1w4wgxiirfnyr9wzk2bbmmz7n";
+    sha256 = "1v134lnh035fpgqqqb7cxvyssvvgxvc42649qzqmsw459di9iqv0";
     rev = version;
     repo = "facter";
     owner = "puppetlabs";
diff --git a/pkgs/tools/system/incron/default.nix b/pkgs/tools/system/incron/default.nix
new file mode 100644
index 000000000000..2afbed2f9bb2
--- /dev/null
+++ b/pkgs/tools/system/incron/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, bash }:
+
+stdenv.mkDerivation rec {
+  name = "incron-0.5.12";
+  src = fetchFromGitHub {
+    owner = "ar-";
+    repo = "incron";
+    rev = name;
+    sha256 = "11d5f98cjafiv9h9zzzrw2s06s2fvdg8gp64km7mdprd2xmy6dih";
+  };
+
+  patches = [ ./default_path.patch ];
+
+  prePatch = ''
+    sed -i "s|/bin/bash|${bash}/bin/bash|g" usertable.cpp
+  '';
+
+  installFlags = [ "PREFIX=$(out)" ];
+  installTargets = [ "install-man" ];
+
+  preInstall = ''
+    mkdir -p $out/bin
+
+    # make install doesn't work because setuid and permissions
+    # just manually install the binaries instead
+    cp incrond incrontab $out/bin/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A cron-like daemon which handles filesystem events.";
+    homepage = https://github.com/ar-/incron;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.aanderse ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/system/incron/default_path.patch b/pkgs/tools/system/incron/default_path.patch
new file mode 100644
index 000000000000..ae173ea29e62
--- /dev/null
+++ b/pkgs/tools/system/incron/default_path.patch
@@ -0,0 +1,36 @@
+diff --git usertable.cpp usertable.cpp
+index 11fd04b..a8681bd 100644
+--- a/usertable.cpp
++++ b/usertable.cpp
+@@ -43,9 +43,6 @@
+ #define DONT_FOLLOW(mask) (false)
+ #endif // IN_DONT_FOLLOW
+ 
+-// this is not enough, but...
+-#define DEFAULT_PATH "/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin"
+-
+ 
+ PROC_MAP UserTable::s_procMap;
+ 
+@@ -597,12 +594,20 @@ void UserTable::RunAsUser(std::string cmd) const
+     if (clearenv() != 0)
+       goto failed;
+ 
++    // try to recreate the user path as best as possible
++    std::string DEFAULT_PATH;
++    DEFAULT_PATH += "/run/wrappers/bin:";
++    DEFAULT_PATH += pwd->pw_dir;
++    DEFAULT_PATH += "/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/etc/profiles/per-user/";
++    DEFAULT_PATH += pwd->pw_name;
++    DEFAULT_PATH += "/bin";
++
+     if (    setenv("LOGNAME",   pwd->pw_name,   1) != 0
+         ||  setenv("USER",      pwd->pw_name,   1) != 0
+         ||  setenv("USERNAME",  pwd->pw_name,   1) != 0
+         ||  setenv("HOME",      pwd->pw_dir,    1) != 0
+         ||  setenv("SHELL",     pwd->pw_shell,  1) != 0
+-        ||  setenv("PATH",      DEFAULT_PATH,   1) != 0)
++        ||  setenv("PATH",      DEFAULT_PATH.c_str(),   1) != 0)
+     {
+       goto failed;
+     }
diff --git a/pkgs/tools/system/s6-rc/default.nix b/pkgs/tools/system/s6-rc/default.nix
index f6eed5671cea..40c999d80f13 100644
--- a/pkgs/tools/system/s6-rc/default.nix
+++ b/pkgs/tools/system/s6-rc/default.nix
@@ -39,7 +39,7 @@ in stdenv.mkDerivation rec {
     "--with-dynlib=${s6.out}/lib"
   ]
   ++ (if stdenv.isDarwin then [ "--disable-shared" ] else [ "--enable-shared" ])
-  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.system}");
+  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.hostPlatform.system}");
 
   postInstall = ''
     mkdir -p $doc/share/doc/s6-rc/
diff --git a/pkgs/tools/system/s6/default.nix b/pkgs/tools/system/s6/default.nix
index 035d4280494c..d7ade3cdb290 100644
--- a/pkgs/tools/system/s6/default.nix
+++ b/pkgs/tools/system/s6/default.nix
@@ -40,7 +40,7 @@ in stdenv.mkDerivation rec {
     "--with-dynlib=${execline.lib}/lib"
   ]
   ++ (if stdenv.isDarwin then [ "--disable-shared" ] else [ "--enable-shared" ])
-  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.system}");
+  ++ (stdenv.lib.optional stdenv.isDarwin "--build=${stdenv.hostPlatform.system}");
 
   postInstall = ''
     mkdir -p $doc/share/doc/s6/
diff --git a/pkgs/tools/system/storebrowse/default.nix b/pkgs/tools/system/storebrowse/default.nix
index e56919acc5d5..e3b58a50c925 100644
--- a/pkgs/tools/system/storebrowse/default.nix
+++ b/pkgs/tools/system/storebrowse/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     mkdir $TMPDIR/go
     export GOPATH=$TMPDIR/go
 
-    ${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "export GOARM=5"}
+    ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "export GOARM=5"}
 
     GOSQLITE=$GOPATH/src/code.google.com/p/gosqlite
     mkdir -p $GOSQLITE
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix
index c0c06813dc94..15d54f4a2a4d 100644
--- a/pkgs/tools/text/gawk/default.nix
+++ b/pkgs/tools/text/gawk/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl
 # TODO: links -lsigsegv but loses the reference for some reason
-, withSigsegv ? (false && stdenv.system != "x86_64-cygwin"), libsigsegv
+, withSigsegv ? (false && stdenv.hostPlatform.system != "x86_64-cygwin"), libsigsegv
 , interactive ? false, readline
 
 /* Test suite broke on:
diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix
index 0ad2a18236f6..e22850a63f01 100644
--- a/pkgs/tools/text/gnupatch/default.nix
+++ b/pkgs/tools/text/gnupatch/default.nix
@@ -1,6 +1,5 @@
 { stdenv, fetchurl
 , ed, autoreconfHook
-, buildPlatform, hostPlatform
 }:
 
 stdenv.mkDerivation rec {
@@ -27,11 +26,11 @@ stdenv.mkDerivation rec {
   buildInputs = stdenv.lib.optional doCheck ed;
   nativeBuildInputs = [ autoreconfHook ];
 
-  configureFlags = stdenv.lib.optionals (hostPlatform != buildPlatform) [
+  configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_strnlen_working=yes"
   ];
 
-  doCheck = hostPlatform.libc != "musl"; # not cross;
+  doCheck = stdenv.hostPlatform.libc != "musl"; # not cross;
 
   meta = {
     description = "GNU Patch, a program to apply differences to files";
diff --git a/pkgs/tools/text/html-tidy/default.nix b/pkgs/tools/text/html-tidy/default.nix
index ccd927002464..51ce4baa0beb 100644
--- a/pkgs/tools/text/html-tidy/default.nix
+++ b/pkgs/tools/text/html-tidy/default.nix
@@ -1,6 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libxslt
-, hostPlatform
-}:
+{ stdenv, fetchFromGitHub, cmake, libxslt }:
 
 stdenv.mkDerivation rec {
   name = "html-tidy-${version}";
@@ -16,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake libxslt/*manpage*/ ];
 
   cmakeFlags = stdenv.lib.optional
-    (hostPlatform.libc or null == "msvcrt") "-DCMAKE_SYSTEM_NAME=Windows";
+    (stdenv.hostPlatform.libc or null == "msvcrt") "-DCMAKE_SYSTEM_NAME=Windows";
 
   # ATM bin/tidy is statically linked, as upstream provides no other option yet.
   # https://github.com/htacg/tidy-html5/issues/326#issuecomment-160322107
diff --git a/pkgs/tools/text/xidel/default.nix b/pkgs/tools/text/xidel/default.nix
index e1a0a5abf965..66dfa1c6b348 100644
--- a/pkgs/tools/text/xidel/default.nix
+++ b/pkgs/tools/text/xidel/default.nix
@@ -11,17 +11,17 @@ stdenv.mkDerivation rec {
   #};
 
   src =
-    if stdenv.system == "x86_64-linux" then
+    if stdenv.hostPlatform.system == "x86_64-linux" then
       fetchurl {
         url = "mirror://sourceforge/videlibri/Xidel/Xidel%20${version}/xidel_${version}-1_amd64.deb";
         sha256 = "0hskc74y7p4j1x33yx0w4fvr610p2yimas8pxhr6bs7mb9b300h7";
       }
-    else if stdenv.system == "i686-linux" then
+    else if stdenv.hostPlatform.system == "i686-linux" then
       fetchurl {
         url = "mirror://sourceforge/videlibri/Xidel/Xidel%20${version}/xidel_${version}-1_i386.deb";
         sha256 = "07yk5sk1p4jm0jmgjwdm2wq8d2wybi1wkn1qq5j5y03z1pdc3fi6";
       }
-    else throw "xidel is not supported on ${stdenv.system}";
+    else throw "xidel is not supported on ${stdenv.hostPlatform.system}";
 
   buildInputs = [ dpkg ];
 
diff --git a/pkgs/tools/typesetting/asciidoctor/Gemfile.lock b/pkgs/tools/typesetting/asciidoctor/Gemfile.lock
index 6c52a2c416a1..04f9029e6e5a 100644
--- a/pkgs/tools/typesetting/asciidoctor/Gemfile.lock
+++ b/pkgs/tools/typesetting/asciidoctor/Gemfile.lock
@@ -5,7 +5,7 @@ GEM
     addressable (2.5.2)
       public_suffix (>= 2.0.2, < 4.0)
     afm (0.2.2)
-    asciidoctor (1.5.6.2)
+    asciidoctor (1.5.7.1)
     asciidoctor-bespoke (1.0.0.alpha.1)
       asciidoctor (>= 1.5.0)
       slim (~> 3.0.6)
@@ -36,7 +36,7 @@ GEM
       addressable
     hashery (2.1.2)
     htmlentities (4.3.4)
-    i18n (1.0.0)
+    i18n (1.1.0)
       concurrent-ruby (~> 1.0)
     json (2.1.0)
     mathematical (1.6.11)
@@ -66,10 +66,10 @@ GEM
     prawn-templates (0.1.1)
       pdf-reader (~> 2.0)
       prawn (~> 2.2)
-    public_suffix (3.0.2)
+    public_suffix (3.0.3)
     pygments.rb (1.2.1)
       multi_json (>= 1.0.0)
-    rack (2.0.4)
+    rack (2.0.5)
     ruby-enum (0.7.2)
       i18n
     ruby-rc4 (0.1.5)
@@ -79,7 +79,7 @@ GEM
       tilt (>= 1.3.3, < 2.1)
     source_map (3.0.1)
       json
-    sprockets (3.7.1)
+    sprockets (3.7.2)
       concurrent-ruby (~> 1.0)
       rack (> 1, < 3)
     temple (0.8.0)
diff --git a/pkgs/tools/typesetting/asciidoctor/default.nix b/pkgs/tools/typesetting/asciidoctor/default.nix
index 1f6a7054b9e3..7001b6e36423 100644
--- a/pkgs/tools/typesetting/asciidoctor/default.nix
+++ b/pkgs/tools/typesetting/asciidoctor/default.nix
@@ -37,7 +37,7 @@ bundlerApp {
 
       # 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"
+        soPath="$out/${ruby.gemPath}/gems/mathematical-${attrs.version}/lib/mathematical/mathematical.so"
         ${patchelf}/bin/patchelf \
           --set-rpath "${lib.makeLibraryPath [ glib cairo ]}:$(${patchelf}/bin/patchelf --print-rpath "$soPath")" \
           "$soPath"
diff --git a/pkgs/tools/typesetting/asciidoctor/gemset.nix b/pkgs/tools/typesetting/asciidoctor/gemset.nix
index 4ae146d289ba..8b960fa3d930 100644
--- a/pkgs/tools/typesetting/asciidoctor/gemset.nix
+++ b/pkgs/tools/typesetting/asciidoctor/gemset.nix
@@ -1,6 +1,8 @@
 {
   addressable = {
     dependencies = ["public_suffix"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0viqszpkggqi8hq87pqp0xykhvz60g99nwmkwsb0v45kc2liwxvk";
@@ -9,6 +11,8 @@
     version = "2.5.2";
   };
   afm = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "06kj9hgd0z8pj27bxp2diwqh6fv7qhwwm17z64rhdc4sfn76jgn8";
@@ -17,6 +21,8 @@
     version = "0.2.2";
   };
   Ascii85 = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0658m37jjjn6drzqg1gk4p6c205mgp7g1jh2d00n4ngghgmz5qvs";
@@ -25,15 +31,19 @@
     version = "1.0.3";
   };
   asciidoctor = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0zq3az4836nxkc8g5wnnbzmarw7663s1ky6gf8pc04sfpa8n2l3f";
+      sha256 = "0v52bzc72cvg7zfgq27pa4mgyf29dx9m20fghrw1xmvwgd519n1w";
       type = "gem";
     };
-    version = "1.5.6.2";
+    version = "1.5.7.1";
   };
   asciidoctor-bespoke = {
     dependencies = ["asciidoctor" "slim" "thread_safe"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1awy933sswxvi2hxpll3rh9phxcvmqhrbb91m6ibjchnf7qsl3zk";
@@ -43,6 +53,8 @@
   };
   asciidoctor-diagram = {
     dependencies = ["asciidoctor"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0rj02i00d9hkzqzzrk5al9rn8yv5x0wsnrv9y6j4k8rfylm69c1r";
@@ -52,6 +64,8 @@
   };
   asciidoctor-latex = {
     dependencies = ["asciidoctor" "htmlentities" "opal"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "02qvn1ngp4s9y22vk23zzssd4w1bpyk84akjwiq6nqn8im6s4awz";
@@ -61,6 +75,8 @@
   };
   asciidoctor-mathematical = {
     dependencies = ["asciidoctor" "mathematical" "ruby-enum"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "18igbvs70dnlrzgl62jcc0vfxhlb4r7v9bq3qf1v80l17lvq1x8f";
@@ -70,6 +86,8 @@
   };
   asciidoctor-pdf = {
     dependencies = ["asciidoctor" "prawn" "prawn-icon" "prawn-svg" "prawn-table" "prawn-templates" "safe_yaml" "thread_safe" "treetop"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1899c071hfmzqg9822v7rg8y8iqlfy3dhpfy32ignzap6cajlsqg";
@@ -78,6 +96,8 @@
     version = "1.5.0.alpha.16";
   };
   coderay = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "15vav4bhcc2x3jmi3izb11l4d9f3xv8hp2fszb7iqmpsccv1pz4y";
@@ -86,6 +106,8 @@
     version = "1.1.2";
   };
   concurrent-ruby = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "183lszf5gx84kcpb779v6a2y0mx9sssy8dgppng1z9a505nj1qcf";
@@ -95,6 +117,8 @@
   };
   css_parser = {
     dependencies = ["addressable"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0gwvf8mc8gnz4aizfijplv3594998h2j44ydakpzsdmkivs07v61";
@@ -103,6 +127,8 @@
     version = "1.6.0";
   };
   hashery = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0qj8815bf7q6q7llm5rzdz279gzmpqmqqicxnzv066a020iwqffj";
@@ -111,6 +137,8 @@
     version = "2.1.2";
   };
   htmlentities = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1nkklqsn8ir8wizzlakncfv42i32wc0w9hxp00hvdlgjr7376nhj";
@@ -120,14 +148,18 @@
   };
   i18n = {
     dependencies = ["concurrent-ruby"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "191c2xzlvn42sb8dz6gjy0qaigri4chfvflg3d4k6n58flm0yp65";
+      sha256 = "0ppvmla21hssvrfm8g1n2fnb4lxn4yhy9qmmba0imanflgldrjmr";
       type = "gem";
     };
-    version = "1.0.0";
+    version = "1.1.0";
   };
   json = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "01v6jjpvh3gnq6sgllpfqahlgxzj50ailwhj9b3cd20hi2dx0vxp";
@@ -137,6 +169,8 @@
   };
   mathematical = {
     dependencies = ["ruby-enum"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "06xkr613hmzbhmm6zv92zlcjyfp0a6i2b3q3hg24lmj4j5l85p21";
@@ -145,6 +179,8 @@
     version = "1.6.11";
   };
   multi_json = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1rl0qy4inf1mp8mybfk56dfga0mvx97zwpmq5xmiwl5r770171nv";
@@ -154,6 +190,8 @@
   };
   opal = {
     dependencies = ["source_map" "sprockets"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0dmdxhmg43ibd4bsldssslsz8870hzknwcxiv9l1838lh6hd390k";
@@ -162,6 +200,8 @@
     version = "0.6.3";
   };
   pdf-core = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "19llwch2wfg51glb0kff0drfp3n6nb9vim4zlvzckxysksvxpby1";
@@ -171,6 +211,8 @@
   };
   pdf-reader = {
     dependencies = ["Ascii85" "afm" "hashery" "ruby-rc4" "ttfunk"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1b3ig4wpcgdbqa7yw0ahwbmikkkywn2a22bfmrknl5ls7g066x45";
@@ -179,6 +221,8 @@
     version = "2.1.0";
   };
   polyglot = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1bqnxwyip623d8pr29rg6m8r0hdg08fpr2yb74f46rn1wgsnxmjr";
@@ -188,6 +232,8 @@
   };
   prawn = {
     dependencies = ["pdf-core" "ttfunk"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1qdjf1v6sfl44g3rqxlg8k4jrzkwaxgvh2l4xws97a8f3xv4na4m";
@@ -197,6 +243,8 @@
   };
   prawn-icon = {
     dependencies = ["prawn"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1pz8n7ajkfmflw05dib2l9qkzkfzwwbzx63qcvjr14k1dnbpx7qk";
@@ -206,6 +254,8 @@
   };
   prawn-svg = {
     dependencies = ["css_parser" "prawn"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0fykcs10q2j6h04riav1kzrw77mga6gh1rxbh7q0ab6gkr0wamzx";
@@ -215,6 +265,8 @@
   };
   prawn-table = {
     dependencies = ["prawn"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1nxd6qmxqwl850icp18wjh5k0s3amxcajdrkjyzpfgq0kvilcv9k";
@@ -224,6 +276,8 @@
   };
   prawn-templates = {
     dependencies = ["pdf-reader" "prawn"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1gs894sj9zdlwx59h3rk4p0l3y8r18p22zhnfiyx9lngsa56gcrj";
@@ -232,15 +286,19 @@
     version = "0.1.1";
   };
   public_suffix = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1x5h1dh1i3gwc01jbg01rly2g6a1qwhynb1s8a30ic507z1nh09s";
+      sha256 = "08q64b5br692dd3v0a9wq9q5dvycc6kmiqmjbdxkxbfizggsvx6l";
       type = "gem";
     };
-    version = "3.0.2";
+    version = "3.0.3";
   };
   "pygments.rb" = {
     dependencies = ["multi_json"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0lbvnwvz770ambm4d6lxgc2097rydn5rcc5d6986bnkzyxfqqjnv";
@@ -249,15 +307,19 @@
     version = "1.2.1";
   };
   rack = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1mfriw2r2913dv8qf3p87n7yal3qfsrs478x2qz106v8vhmxa017";
+      sha256 = "158hbn7rlc3czp2vivvam44dv6vmzz16qrh5dbzhfxbfsgiyrqw1";
       type = "gem";
     };
-    version = "2.0.4";
+    version = "2.0.5";
   };
   ruby-enum = {
     dependencies = ["i18n"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0h62avini866kxpjzqxlqnajma3yvj0y25l6hn9h2mv5pp6fcrhx";
@@ -266,6 +328,8 @@
     version = "0.7.2";
   };
   ruby-rc4 = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "00vci475258mmbvsdqkmqadlwn6gj9m01sp7b5a3zd90knil1k00";
@@ -274,6 +338,8 @@
     version = "0.1.5";
   };
   safe_yaml = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1hly915584hyi9q9vgd968x2nsi5yag9jyf5kq60lwzi5scr7094";
@@ -283,6 +349,8 @@
   };
   slim = {
     dependencies = ["temple" "tilt"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0zwz083xsbnlrma1pfkzrqc1fqm90fidn915vlifvkzl5fs43pvl";
@@ -292,6 +360,8 @@
   };
   source_map = {
     dependencies = ["json"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0fviv92glr51v2zqy4i5jzi3hzpvjrcwyrxddcfr84ki65zb7pkv";
@@ -301,14 +371,18 @@
   };
   sprockets = {
     dependencies = ["concurrent-ruby" "rack"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0sv3zk5hwxyjvg7iy9sggjc7k3mfxxif7w8p260rharfyib939ar";
+      sha256 = "182jw5a0fbqah5w9jancvfmjbk88h8bxdbwnl4d3q809rpxdg8ay";
       type = "gem";
     };
-    version = "3.7.1";
+    version = "3.7.2";
   };
   temple = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "00nxf610nzi4n1i2lkby43nrnarvl89fcl6lg19406msr0k3ycmq";
@@ -317,6 +391,8 @@
     version = "0.8.0";
   };
   thread_safe = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy";
@@ -325,6 +401,8 @@
     version = "0.3.6";
   };
   tilt = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0020mrgdf11q23hm1ddd6fv691l51vi10af00f137ilcdb2ycfra";
@@ -334,6 +412,8 @@
   };
   treetop = {
     dependencies = ["polyglot"];
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "0wpl5z33796nz2ah44waflrd1girbra281d9i3m9nz4ylg1ljg5b";
@@ -342,6 +422,8 @@
     version = "1.5.3";
   };
   ttfunk = {
+    groups = ["default"];
+    platforms = [];
     source = {
       remotes = ["https://rubygems.org"];
       sha256 = "1mgrnqla5n51v4ivn844albsajkck7k6lviphfqa8470r46c58cd";
@@ -349,4 +431,4 @@
     };
     version = "1.5.1";
   };
-}
+}
\ No newline at end of file
diff --git a/pkgs/tools/typesetting/kindlegen/default.nix b/pkgs/tools/typesetting/kindlegen/default.nix
index 4e9a40239bfe..fc43ed0abe27 100644
--- a/pkgs/tools/typesetting/kindlegen/default.nix
+++ b/pkgs/tools/typesetting/kindlegen/default.nix
@@ -11,7 +11,7 @@ let
     "i686-darwin"   = "0zniyn0s41fxqrajbgwxbcsj5vzf9m7a6yvdz2b11mphr00kpbbs";
     "x86_64-cygwin" = "02slfh1bbpijay4skj85cjiv7z43ha8vm5aa1lwiqjk86qbl1f3h";
     "i686-cygwin"   = "02slfh1bbpijay4skj85cjiv7z43ha8vm5aa1lwiqjk86qbl1f3h";
-  }."${stdenv.system}" or (throw "system #{stdenv.system.} is not supported");
+  }."${stdenv.hostPlatform.system}" or (throw "system #{stdenv.hostPlatform.system.} is not supported");
 
   url = {
     "x86_64-linux"  = "http://kindlegen.s3.amazonaws.com/kindlegen_linux_2.6_i386_v${fileVersion}.tar.gz";
@@ -20,7 +20,7 @@ let
     "i686-darwin"   = "http://kindlegen.s3.amazonaws.com/KindleGen_Mac_i386_v${fileVersion}.zip";
     "x86_64-cygwin" = "http://kindlegen.s3.amazonaws.com/kindlegen_win32_v${fileVersion}.zip";
     "i686-cygwin"   = "http://kindlegen.s3.amazonaws.com/kindlegen_win32_v${fileVersion}.zip";
-  }."${stdenv.system}" or (throw "system #{stdenv.system.} is not supported");
+  }."${stdenv.hostPlatform.system}" or (throw "system #{stdenv.hostPlatform.system.} is not supported");
 
 in stdenv.mkDerivation rec {
   name = "kindlegen-${version}";
diff --git a/pkgs/tools/virtualization/awsebcli/default.nix b/pkgs/tools/virtualization/awsebcli/default.nix
index b55ac457305b..b1693bd262fe 100644
--- a/pkgs/tools/virtualization/awsebcli/default.nix
+++ b/pkgs/tools/virtualization/awsebcli/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, python }:
+{ stdenv, python3, glibcLocales }:
 let
 
-  localPython = python.override {
+  localPython = python3.override {
     packageOverrides = self: super: {
       cement = super.cement.overridePythonAttrs (oldAttrs: rec {
         version = "2.8.2";
@@ -61,6 +61,12 @@ in with localPython.pkgs; buildPythonApplication rec {
     sha256 = "128dgxyz2bgl3r4jdkbmjs280004bm0dwzln7p6ly3yjs2x37jl6";
   };
 
+  buildInputs = [
+    glibcLocales
+  ];
+
+  LC_ALL = "en_US.UTF-8";
+
   checkInputs = [
     pytest mock nose pathspec colorama requests docutils
   ];