summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/arduino/arduino-core/default.nix18
-rw-r--r--pkgs/development/compilers/ccl/default.nix2
-rw-r--r--pkgs/development/compilers/clean/default.nix4
-rw-r--r--pkgs/development/compilers/cmucl/binary.nix2
-rw-r--r--pkgs/development/compilers/crystal/default.nix4
-rw-r--r--pkgs/development/compilers/fpc/binary.nix6
-rw-r--r--pkgs/development/compilers/fpc/default.nix2
-rw-r--r--pkgs/development/compilers/ghcjs-ng/default.nix2
-rw-r--r--pkgs/development/compilers/go/1.10.nix6
-rw-r--r--pkgs/development/compilers/go/1.11.nix10
-rw-r--r--pkgs/development/compilers/go/1.4.nix6
-rw-r--r--pkgs/development/compilers/go/1.9.nix6
-rw-r--r--pkgs/development/compilers/jetbrains-jdk/default.nix4
-rw-r--r--pkgs/development/compilers/julia/default.nix2
-rw-r--r--pkgs/development/compilers/mlton/default.nix6
-rw-r--r--pkgs/development/compilers/mozart/binary.nix2
-rw-r--r--pkgs/development/compilers/nvidia-cg-toolkit/default.nix6
-rw-r--r--pkgs/development/compilers/opendylan/bin.nix6
-rw-r--r--pkgs/development/compilers/opendylan/default.nix6
-rw-r--r--pkgs/development/compilers/openjdk/10.nix2
-rw-r--r--pkgs/development/compilers/oraclejdk/jdk-linux-base.nix6
-rw-r--r--pkgs/development/compilers/orc/default.nix2
-rw-r--r--pkgs/development/compilers/picat/default.nix4
-rw-r--r--pkgs/development/compilers/rust/bootstrap.nix14
-rw-r--r--pkgs/development/compilers/sbcl/bootstrap.nix4
-rw-r--r--pkgs/development/compilers/sbcl/default.nix2
-rw-r--r--pkgs/development/interpreters/dart/default.nix2
-rw-r--r--pkgs/development/interpreters/spidermonkey/1.8.5.nix2
-rw-r--r--pkgs/development/libraries/apr/default.nix2
-rw-r--r--pkgs/development/libraries/audio/libbass/default.nix4
-rw-r--r--pkgs/development/libraries/bootil/default.nix2
-rw-r--r--pkgs/development/libraries/crypto++/default.nix7
-rw-r--r--pkgs/development/libraries/gpgme/default.nix5
-rw-r--r--pkgs/development/libraries/gsl/default.nix2
-rw-r--r--pkgs/development/libraries/java/jzmq/default.nix2
-rw-r--r--pkgs/development/libraries/java/swt/default.nix2
-rw-r--r--pkgs/development/libraries/libspotify/default.nix12
-rw-r--r--pkgs/development/libraries/live555/default.nix2
-rw-r--r--pkgs/development/libraries/mesa/default.nix2
-rw-r--r--pkgs/development/libraries/nettle/generic.nix4
-rw-r--r--pkgs/development/libraries/opencv/3.x.nix6
-rw-r--r--pkgs/development/libraries/oracle-instantclient/default.nix6
-rw-r--r--pkgs/development/libraries/physics/geant4/fetch.nix2
-rw-r--r--pkgs/development/libraries/science/math/openblas/default.nix6
-rw-r--r--pkgs/development/libraries/scmccid/default.nix4
-rw-r--r--pkgs/development/libraries/skalibs/default.nix2
-rw-r--r--pkgs/development/libraries/tachyon/default.nix18
-rw-r--r--pkgs/development/libraries/v8/3.14.nix2
-rw-r--r--pkgs/development/libraries/vigra/default.nix2
-rw-r--r--pkgs/development/libraries/vxl/default.nix2
-rw-r--r--pkgs/development/libraries/wtk/default.nix2
-rw-r--r--pkgs/development/misc/amdapp-sdk/default.nix4
-rw-r--r--pkgs/development/mobile/androidenv/androidndk.nix4
-rw-r--r--pkgs/development/mobile/androidenv/androidndk_r8e.nix6
-rw-r--r--pkgs/development/mobile/androidenv/androidsdk.nix18
-rw-r--r--pkgs/development/mobile/androidenv/build-tools.nix8
-rw-r--r--pkgs/development/mobile/androidenv/default.nix6
-rw-r--r--pkgs/development/mobile/androidenv/platform-tools.nix8
-rw-r--r--pkgs/development/mobile/titaniumenv/build-app.nix2
-rw-r--r--pkgs/development/mobile/titaniumenv/default.nix2
-rw-r--r--pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix12
-rw-r--r--pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix10
-rw-r--r--pkgs/development/node-packages/default-v10.nix5
-rw-r--r--pkgs/development/node-packages/default-v6.nix5
-rw-r--r--pkgs/development/node-packages/default-v8.nix5
-rw-r--r--pkgs/development/ruby-modules/testing/stubs.nix2
-rw-r--r--pkgs/development/tools/analysis/cov-build/default.nix2
-rw-r--r--pkgs/development/tools/analysis/valgrind/default.nix2
-rw-r--r--pkgs/development/tools/electron/default.nix4
-rw-r--r--pkgs/development/tools/github/github-release/default.nix6
-rw-r--r--pkgs/development/tools/google-app-engine-go-sdk/default.nix2
-rw-r--r--pkgs/development/tools/misc/cflow/default.nix2
-rw-r--r--pkgs/development/tools/misc/iozone/default.nix10
-rw-r--r--pkgs/development/tools/misc/kibana/5.x.nix4
-rw-r--r--pkgs/development/tools/misc/kibana/default.nix4
-rw-r--r--pkgs/development/tools/misc/lsof/default.nix2
-rw-r--r--pkgs/development/tools/misc/saleae-logic/default.nix4
-rw-r--r--pkgs/development/tools/neoload/default.nix2
-rw-r--r--pkgs/development/tools/node-webkit/nw12.nix2
-rw-r--r--pkgs/development/tools/nwjs/default.nix2
-rw-r--r--pkgs/development/tools/phantomjs/default.nix4
-rw-r--r--pkgs/development/tools/sauce-connect/default.nix4
-rw-r--r--pkgs/development/tools/selenium/chromedriver/default.nix4
-rw-r--r--pkgs/development/web/remarkjs/default.nix2
84 files changed, 203 insertions, 192 deletions
diff --git a/pkgs/development/arduino/arduino-core/default.nix b/pkgs/development/arduino/arduino-core/default.nix
index a427023df56..269df6a07cd 100644
--- a/pkgs/development/arduino/arduino-core/default.nix
+++ b/pkgs/development/arduino/arduino-core/default.nix
@@ -13,15 +13,19 @@ assert withTeensyduino -> withGui;
 # xdotool script; the cause of this hang is not yet known.
 # TODO: There is a fair chance that Teensyduino works with arm-linux, but it
 # has not yet been tested.
-if withTeensyduino && (stdenv.system != "x86_64-linux") then throw
+if withTeensyduino && (stdenv.hostPlatform.system != "x86_64-linux") then throw
   "Teensyduino is only supported on x86_64-linux at this time (patches welcome)."
 else
 let
-  externalDownloads = import ./downloads.nix {inherit fetchurl; inherit (lib) optionalAttrs; inherit (stdenv) system;};
+  externalDownloads = import ./downloads.nix {
+    inherit fetchurl;
+    inherit (lib) optionalAttrs;
+    inherit (stdenv.hostPlatform) system;
+  };
   # Some .so-files are later copied from .jar-s to $HOME, so patch them beforehand
   patchelfInJars =
-       lib.optional (stdenv.system == "x86_64-linux") {jar = "share/arduino/lib/jssc-2.8.0-arduino1.jar"; file = "libs/linux/libjSSC-2.8_x86_64.so";}
-    ++ lib.optional (stdenv.system == "i686-linux") {jar = "share/arduino/lib/jssc-2.8.0-arduino1.jar"; file = "libs/linux/libjSSC-2.8_x86.so";}
+       lib.optional (stdenv.hostPlatform.system == "x86_64-linux") {jar = "share/arduino/lib/jssc-2.8.0-arduino1.jar"; file = "libs/linux/libjSSC-2.8_x86_64.so";}
+    ++ lib.optional (stdenv.hostPlatform.system == "i686-linux") {jar = "share/arduino/lib/jssc-2.8.0-arduino1.jar"; file = "libs/linux/libjSSC-2.8_x86.so";}
   ;
   # abiVersion 6 is default, but we need 5 for `avrdude_bin` executable
   ncurses5 = ncurses.override { abiVersion = "5"; };
@@ -46,9 +50,9 @@ let
     zlib
   ];
   teensy_architecture =
-      lib.optionalString (stdenv.system == "x86_64-linux") "linux64"
-      + lib.optionalString (stdenv.system == "i686-linux") "linux32"
-      + lib.optionalString (stdenv.system == "arm-linux") "linuxarm";
+      lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "linux64"
+      + lib.optionalString (stdenv.hostPlatform.system == "i686-linux") "linux32"
+      + lib.optionalString (stdenv.hostPlatform.system == "arm-linux") "linuxarm";
 
   flavor = (if withTeensyduino then "teensyduino" else "arduino")
              + stdenv.lib.optionalString (!withGui) "-core";
diff --git a/pkgs/development/compilers/ccl/default.nix b/pkgs/development/compilers/ccl/default.nix
index 9570b0eead8..ae6af8dd4b4 100644
--- a/pkgs/development/compilers/ccl/default.nix
+++ b/pkgs/development/compilers/ccl/default.nix
@@ -29,7 +29,7 @@ let
     };
     armv6l-linux = armv7l-linux;
   };
-  cfg = options."${stdenv.system}" or (throw "missing source url for platform ${stdenv.system}");
+  cfg = options."${stdenv.hostPlatform.system}" or (throw "missing source url for platform ${stdenv.hostPlatform.system}");
 in
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/development/compilers/clean/default.nix b/pkgs/development/compilers/clean/default.nix
index 16ac8b78721..cc6197922fd 100644
--- a/pkgs/development/compilers/clean/default.nix
+++ b/pkgs/development/compilers/clean/default.nix
@@ -4,11 +4,11 @@ stdenv.mkDerivation rec {
   name = "clean-2.4";
 
   src =
-    if stdenv.system == "i686-linux" then (fetchurl {
+    if stdenv.hostPlatform.system == "i686-linux" then (fetchurl {
       url = "http://clean.cs.ru.nl/download/Clean24/linux/clean2.4_boot.tar.gz";
       sha256 = "1w8vvmkwzq8g51639r62apcy75sj69nm08082a34xvqm9ymfgkq5";
     })
-    else if stdenv.system == "x86_64-linux" then (fetchurl {
+    else if stdenv.hostPlatform.system == "x86_64-linux" then (fetchurl {
         url = "https://clean.cs.ru.nl/download/Clean24/linux/clean2.4_64_boot.tar.gz";
         sha256 = "08gsa1pjl5wyzh4ah8ccfx8a7mdcn6ycsn1lzkrr9adygv1gmm7r";
     })
diff --git a/pkgs/development/compilers/cmucl/binary.nix b/pkgs/development/compilers/cmucl/binary.nix
index 2833c5378c1..9e3184c42eb 100644
--- a/pkgs/development/compilers/cmucl/binary.nix
+++ b/pkgs/development/compilers/cmucl/binary.nix
@@ -1,7 +1,7 @@
 {stdenv, fetchurl}:
 
 let
-  inherit (stdenv) system;
+  inherit (stdenv.hostPlatform) system;
   version = "21b";
   downloadUrl = arch:
     "http://common-lisp.net/project/cmucl/downloads/release/" +
diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix
index ce487c3c0e2..aa1c85ebcb0 100644
--- a/pkgs/development/compilers/crystal/default.nix
+++ b/pkgs/development/compilers/crystal/default.nix
@@ -15,14 +15,14 @@ stdenv.mkDerivation rec {
     "x86_64-linux" = "linux-x86_64";
     "i686-linux" = "linux-i686";
     "x86_64-darwin" = "darwin-x86_64";
-  }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
+  }."${stdenv.hostPlatform.system}" or (throw "system ${stdenv.hostPlatform.system} not supported");
   in fetchurl {
     url = "https://github.com/crystal-lang/crystal/releases/download/0.26.0/${prebuiltName}-${arch}.tar.gz";
     sha256 = {
       "x86_64-linux" = "1xban102yiiwmlklxvn3xp3q546bp8hlxxpakayajkhhnpl6yv45";
       "i686-linux" = "1igspf1lrv7wpmz0pfrkbx8m1ykvnv4zhic53cav4nicppm2v0ic";
       "x86_64-darwin" = "0hzc65ccajr0yhmvi5vbdgbzbp1gbjy56da24ds3zwwkam1ddk0k";
-    }."${stdenv.system}";
+    }."${stdenv.hostPlatform.system}";
   };
 
   unpackPhase = ''
diff --git a/pkgs/development/compilers/fpc/binary.nix b/pkgs/development/compilers/fpc/binary.nix
index 0ecf4437c9a..cf13ab6f595 100644
--- a/pkgs/development/compilers/fpc/binary.nix
+++ b/pkgs/development/compilers/fpc/binary.nix
@@ -4,17 +4,17 @@ stdenv.mkDerivation {
   name = "fpc-2.6.0-binary";
 
   src =
-    if stdenv.system == "i686-linux" then
+    if stdenv.hostPlatform.system == "i686-linux" then
       fetchurl {
         url = "mirror://sourceforge/project/freepascal/Linux/2.6.0/fpc-2.6.0.i386-linux.tar";
         sha256 = "08yklvrfxvk59bxsd4rh1i6s3cjn0q06dzjs94h9fbq3n1qd5zdf";
       }
-    else if stdenv.system == "x86_64-linux" then
+    else if stdenv.hostPlatform.system == "x86_64-linux" then
       fetchurl {
         url = "mirror://sourceforge/project/freepascal/Linux/2.6.0/fpc-2.6.0.x86_64-linux.tar";
         sha256 = "0k9vi75k39y735fng4jc2vppdywp82j4qhzn7x4r6qjkad64d8lx";
       }
-    else throw "Not supported on ${stdenv.system}.";
+    else throw "Not supported on ${stdenv.hostPlatform.system}.";
 
   builder = ./binary-builder.sh;
 
diff --git a/pkgs/development/compilers/fpc/default.nix b/pkgs/development/compilers/fpc/default.nix
index 51544783d8c..b516019ffc9 100644
--- a/pkgs/development/compilers/fpc/default.nix
+++ b/pkgs/development/compilers/fpc/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ startFPC gawk ];
 
   preConfigure =
-    if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then ''
+    if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then ''
       sed -e "s@'/lib/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
       sed -e "s@'/lib64/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas
     '' else "";
diff --git a/pkgs/development/compilers/ghcjs-ng/default.nix b/pkgs/development/compilers/ghcjs-ng/default.nix
index ddabb7ca6bf..5db2777c8bb 100644
--- a/pkgs/development/compilers/ghcjs-ng/default.nix
+++ b/pkgs/development/compilers/ghcjs-ng/default.nix
@@ -59,7 +59,7 @@ let
   };
 
   bootGhcjs = haskellLib.justStaticExecutables passthru.bootPkgs.ghcjs;
-  libexec = "${bootGhcjs}/libexec/${builtins.replaceStrings ["darwin" "i686"] ["osx" "i386"] stdenv.system}-${passthru.bootPkgs.ghc.name}/${bootGhcjs.name}";
+  libexec = "${bootGhcjs}/libexec/${builtins.replaceStrings ["darwin" "i686"] ["osx" "i386"] stdenv.buildPlatform.system}-${passthru.bootPkgs.ghc.name}/${bootGhcjs.name}";
 
 in stdenv.mkDerivation {
     name = bootGhcjs.name;
diff --git a/pkgs/development/compilers/go/1.10.nix b/pkgs/development/compilers/go/1.10.nix
index 513d0307f6b..fa4b4abafde 100644
--- a/pkgs/development/compilers/go/1.10.nix
+++ b/pkgs/development/compilers/go/1.10.nix
@@ -134,12 +134,12 @@ stdenv.mkDerivation rec {
 
   GOOS = if stdenv.isDarwin then "darwin" else "linux";
   GOARCH = if stdenv.isDarwin then "amd64"
-           else if stdenv.system == "i686-linux" then "386"
-           else if stdenv.system == "x86_64-linux" then "amd64"
+           else if stdenv.hostPlatform.system == "i686-linux" then "386"
+           else if stdenv.hostPlatform.system == "x86_64-linux" then "amd64"
            else if stdenv.isAarch32 then "arm"
            else if stdenv.isAarch64 then "arm64"
            else throw "Unsupported system";
-  GOARM = optionalString (stdenv.system == "armv5tel-linux") "5";
+  GOARM = optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "5";
   GO386 = 387; # from Arch: don't assume sse2 on i686
   CGO_ENABLED = 1;
   GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";
diff --git a/pkgs/development/compilers/go/1.11.nix b/pkgs/development/compilers/go/1.11.nix
index eddd16dc199..55cc654b0aa 100644
--- a/pkgs/development/compilers/go/1.11.nix
+++ b/pkgs/development/compilers/go/1.11.nix
@@ -134,12 +134,12 @@ stdenv.mkDerivation rec {
 
   GOOS = if stdenv.isDarwin then "darwin" else "linux";
   GOARCH = if stdenv.isDarwin then "amd64"
-           else if stdenv.system == "i686-linux" then "386"
-           else if stdenv.system == "x86_64-linux" then "amd64"
-           else if stdenv.isAarch32 then "arm"
-           else if stdenv.isAarch64 then "arm64"
+           else if stdenv.targetPlatform.isi686 then "386"
+           else if stdenv.targetPlatform.isx86_64 then "amd64"
+           else if stdenv.targetPlatform.isAarch32 then "arm"
+           else if stdenv.targetPlatform.isAarch64 then "arm64"
            else throw "Unsupported system";
-  GOARM = optionalString (stdenv.system == "armv5tel-linux") "5";
+  GOARM = stdenv.targetPlatform.parsed.cpu.version or "";
   GO386 = 387; # from Arch: don't assume sse2 on i686
   CGO_ENABLED = 1;
   GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";
diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix
index 32eb0d98d18..40fd3f15786 100644
--- a/pkgs/development/compilers/go/1.4.nix
+++ b/pkgs/development/compilers/go/1.4.nix
@@ -128,11 +128,11 @@ stdenv.mkDerivation rec {
 
   GOOS = if stdenv.isDarwin then "darwin" else "linux";
   GOARCH = if stdenv.isDarwin then "amd64"
-           else if stdenv.system == "i686-linux" then "386"
-           else if stdenv.system == "x86_64-linux" then "amd64"
+           else if stdenv.hostPlatform.system == "i686-linux" then "386"
+           else if stdenv.hostPlatform.system == "x86_64-linux" then "amd64"
            else if stdenv.isAarch32 then "arm"
            else throw "Unsupported system";
-  GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
+  GOARM = stdenv.lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "5";
   GO386 = 387; # from Arch: don't assume sse2 on i686
   CGO_ENABLED = 0;
 
diff --git a/pkgs/development/compilers/go/1.9.nix b/pkgs/development/compilers/go/1.9.nix
index d46e40f460b..48f16c3ffa5 100644
--- a/pkgs/development/compilers/go/1.9.nix
+++ b/pkgs/development/compilers/go/1.9.nix
@@ -134,12 +134,12 @@ stdenv.mkDerivation rec {
 
   GOOS = if stdenv.isDarwin then "darwin" else "linux";
   GOARCH = if stdenv.isDarwin then "amd64"
-           else if stdenv.system == "i686-linux" then "386"
-           else if stdenv.system == "x86_64-linux" then "amd64"
+           else if stdenv.hostPlatform.system == "i686-linux" then "386"
+           else if stdenv.hostPlatform.system == "x86_64-linux" then "amd64"
            else if stdenv.isAarch32 then "arm"
            else if stdenv.isAarch64 then "arm64"
            else throw "Unsupported system";
-  GOARM = optionalString (stdenv.system == "armv5tel-linux") "5";
+  GOARM = optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "5";
   GO386 = 387; # from Arch: don't assume sse2 on i686
   CGO_ENABLED = 1;
   GOROOT_BOOTSTRAP = "${goBootstrap}/share/go";
diff --git a/pkgs/development/compilers/jetbrains-jdk/default.nix b/pkgs/development/compilers/jetbrains-jdk/default.nix
index 1c62f79f907..39fab8b25d8 100644
--- a/pkgs/development/compilers/jetbrains-jdk/default.nix
+++ b/pkgs/development/compilers/jetbrains-jdk/default.nix
@@ -10,13 +10,13 @@ let drv = stdenv.mkDerivation rec {
   version = "152b1248.6";
   name = pname + "-" + version;
 
-  src = if stdenv.system == "x86_64-linux" then
+  src = if stdenv.hostPlatform.system == "x86_64-linux" then
     fetchurl {
       url = "https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbsdk8u${version}_linux_x64.tar.gz";
       sha256 = "12l81g8zhaymh4rzyfl9nyzmpkgzc7wrphm3j4plxx129yn9i7d7";
     }
   else
-    throw "unsupported system: ${stdenv.system}";
+    throw "unsupported system: ${stdenv.hostPlatform.system}";
 
   nativeBuildInputs = [ file ];
 
diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix
index 84fdf8f9786..086570f5ce2 100644
--- a/pkgs/development/compilers/julia/default.nix
+++ b/pkgs/development/compilers/julia/default.nix
@@ -101,7 +101,7 @@ stdenv.mkDerivation rec {
 
   makeFlags =
     let
-      arch = head (splitString "-" stdenv.system);
+      arch = head (splitString "-" stdenv.hostPlatform.system);
       march = { "x86_64" = "x86-64"; "i686" = "pentium4"; }."${arch}"
               or (throw "unsupported architecture: ${arch}");
       # Julia requires Pentium 4 (SSE2) or better
diff --git a/pkgs/development/compilers/mlton/default.nix b/pkgs/development/compilers/mlton/default.nix
index 583f6f80137..6b6907b0b2e 100644
--- a/pkgs/development/compilers/mlton/default.nix
+++ b/pkgs/development/compilers/mlton/default.nix
@@ -14,15 +14,15 @@ stdenv.mkDerivation rec {
   name = "mlton-${version}";
 
   binSrc =
-    if stdenv.system == "i686-linux" then (fetchurl {
+    if stdenv.hostPlatform.system == "i686-linux" then (fetchurl {
       url = "mirror://sourceforge/project/mlton/mlton/${version}/${name}-1.x86-linux.tgz";
       sha256 = "1kxjjmnw4xk2d9hpvz43w9dvyhb3025k4zvjx785c33nrwkrdn4j";
     })
-    else if stdenv.system == "x86_64-linux" then (fetchurl {
+    else if stdenv.hostPlatform.system == "x86_64-linux" then (fetchurl {
         url = "mirror://sourceforge/project/mlton/mlton/${version}/${name}-1.amd64-linux.tgz";
         sha256 = "0fyhwxb4nmpirjbjcvk9f6w67gmn2gkz7xcgz0xbfih9kc015ygn";
     })
-    else if stdenv.system == "x86_64-darwin" then (fetchurl {
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then (fetchurl {
         url = "mirror://sourceforge/project/mlton/mlton/${version}/${name}-1.amd64-darwin.gmp-macports.tgz";
         sha256 = "044wnh9hhg6if886xy805683k0as347xd37r0r1yi4x7qlxzzgx9";
     })
diff --git a/pkgs/development/compilers/mozart/binary.nix b/pkgs/development/compilers/mozart/binary.nix
index ebe562fcde3..ef6cd1160b3 100644
--- a/pkgs/development/compilers/mozart/binary.nix
+++ b/pkgs/development/compilers/mozart/binary.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
 
   preferLocalBuild = true;
 
-  src = binaries."${stdenv.system}" or (throw "unsupported system: ${stdenv.system}");
+  src = binaries."${stdenv.hostPlatform.system}" or (throw "unsupported system: ${stdenv.hostPlatform.system}");
 
   libPath = stdenv.lib.makeLibraryPath
     [ stdenv.cc.cc
diff --git a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix
index 21ccf77e4a2..b6e2aea7eca 100644
--- a/pkgs/development/compilers/nvidia-cg-toolkit/default.nix
+++ b/pkgs/development/compilers/nvidia-cg-toolkit/default.nix
@@ -10,17 +10,17 @@ stdenv.mkDerivation rec {
   name = "nvidia-cg-toolkit-${version}";
 
   src =
-    if stdenv.system == "x86_64-linux" then
+    if stdenv.hostPlatform.system == "x86_64-linux" then
       fetchurl {
         url = "https://developer.download.nvidia.com/cg/Cg_${version}/Cg-${version}_${date}_x86_64.tgz";
         sha256 = "e8ff01e6cc38d1b3fd56a083f5860737dbd2f319a39037528fb1a74a89ae9878";
       }
-    else if stdenv.system == "i686-linux" then
+    else if stdenv.hostPlatform.system == "i686-linux" then
       fetchurl {
         url = "http://developer.download.nvidia.com/cg/Cg_${version}/Cg-${version}_${date}_x86.tgz";
         sha256 = "cef3591e436f528852db0e8c145d3842f920e0c89bcfb219c466797cb7b18879";
       }
-    else throw "nvidia-cg-toolkit does not support platform ${stdenv.system}";
+    else throw "nvidia-cg-toolkit does not support platform ${stdenv.hostPlatform.system}";
 
   installPhase = ''
     for b in cgc cgfxcat cginfo
diff --git a/pkgs/development/compilers/opendylan/bin.nix b/pkgs/development/compilers/opendylan/bin.nix
index 1abf44f2349..9b721312bb7 100644
--- a/pkgs/development/compilers/opendylan/bin.nix
+++ b/pkgs/development/compilers/opendylan/bin.nix
@@ -5,15 +5,15 @@
 stdenv.mkDerivation {
   name = "opendylan-2013.2";
 
-  src = if stdenv.system == "x86_64-linux" then fetchurl {
+  src = if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl {
       url = https://opendylan.org/downloads/opendylan/2013.2/opendylan-2013.2-x86_64-linux.tar.bz2;
       sha256 = "035brbw3hm7zrs593q4zc42yglj1gmmkw3b1r7zzlw3ks4i2lg7h";
     }
-    else if stdenv.system == "i686-linux" then fetchurl {
+    else if stdenv.hostPlatform.system == "i686-linux" then fetchurl {
       url = https://opendylan.org/downloads/opendylan/2013.2/opendylan-2013.2-x86-linux.tar.bz2;
       sha256 = "0c61ihvblcsjrw6ncr8x8ylhskcrqs8pajs4mg5di36cvqw12nq5";
     }
-    else throw "platform ${stdenv.system} not supported.";
+    else throw "platform ${stdenv.hostPlatform.system} not supported.";
 
   buildInputs = [ patchelf boehmgc gnused makeWrapper ];
 
diff --git a/pkgs/development/compilers/opendylan/default.nix b/pkgs/development/compilers/opendylan/default.nix
index 17d474359da..8e732d7d8bf 100644
--- a/pkgs/development/compilers/opendylan/default.nix
+++ b/pkgs/development/compilers/opendylan/default.nix
@@ -11,11 +11,11 @@ stdenv.mkDerivation {
     fetchSubmodules = true;
   };
 
-  buildInputs = (if stdenv.system == "i686-linux" then [ mps ] else [ boehmgc ]) ++ [
+  buildInputs = (if stdenv.hostPlatform.system == "i686-linux" then [ mps ] else [ boehmgc ]) ++ [
     opendylan-bootstrap boehmgc gnused autoconf automake perl makeWrapper
   ];
 
-  preConfigure = if stdenv.system == "i686-linux" then ''
+  preConfigure = if stdenv.hostPlatform.system == "i686-linux" then ''
     mkdir -p $TMPDIR/mps
     tar --strip-components=1 -xf ${mps.src} -C $TMPDIR/mps
     ./autogen.sh
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
   '';
 
   configureFlags = [
-    (if stdenv.system == "i686-linux" then "--with-mps=$(TMPDIR)/mps" else "--with-gc=${boehmgc.out}")
+    (if stdenv.hostPlatform.system == "i686-linux" then "--with-mps=$(TMPDIR)/mps" else "--with-gc=${boehmgc.out}")
   ];
   buildPhase = "make 3-stage-bootstrap";
 
diff --git a/pkgs/development/compilers/openjdk/10.nix b/pkgs/development/compilers/openjdk/10.nix
index 6e8d9003bf4..750a4efe496 100644
--- a/pkgs/development/compilers/openjdk/10.nix
+++ b/pkgs/development/compilers/openjdk/10.nix
@@ -13,7 +13,7 @@ let
    * The JRE libraries are in directories that depend on the CPU.
    */
   architecture =
-    if stdenv.system == "i686-linux" then
+    if stdenv.hostPlatform.system == "i686-linux" then
       "i386"
     else "amd64";
 
diff --git a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
index baa136b798d..5d55e0554e5 100644
--- a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
+++ b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
@@ -46,7 +46,7 @@ let
     x86_64-linux  = "amd64";
     armv7l-linux  = "arm";
     aarch64-linux = "aarch64";
-  }.${stdenv.system};
+  }.${stdenv.hostPlatform.system};
 
   jce =
     if installjce then
@@ -77,9 +77,9 @@ let result = stdenv.mkDerivation rec {
       x86_64-linux  = "jdk-${productVersion}u${patchVersion}-linux-x64.tar.gz";
       armv7l-linux  = "jdk-${productVersion}u${patchVersion}-linux-arm32-vfp-hflt.tar.gz";
       aarch64-linux = "jdk-${productVersion}u${patchVersion}-linux-arm64-vfp-hflt.tar.gz";
-    }.${stdenv.system};
+    }.${stdenv.hostPlatform.system};
     url = downloadUrl;
-    sha256 = sha256.${stdenv.system};
+    sha256 = sha256.${stdenv.hostPlatform.system};
   };
 
   nativeBuildInputs = [ file ]
diff --git a/pkgs/development/compilers/orc/default.nix b/pkgs/development/compilers/orc/default.nix
index 9fc9007abb9..3f3db48828d 100644
--- a/pkgs/development/compilers/orc/default.nix
+++ b/pkgs/development/compilers/orc/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   '';
 
   # https://bugzilla.gnome.org/show_bug.cgi?id=728129#c15
-  doCheck = stdenv.system != "i686-linux"; # not sure about cross-compiling
+  doCheck = stdenv.hostPlatform.system != "i686-linux"; # not sure about cross-compiling
 
   meta = with stdenv.lib; {
     description = "The Oil Runtime Compiler";
diff --git a/pkgs/development/compilers/picat/default.nix b/pkgs/development/compilers/picat/default.nix
index 8ee904a6ed6..b520a5e703c 100644
--- a/pkgs/development/compilers/picat/default.nix
+++ b/pkgs/development/compilers/picat/default.nix
@@ -8,8 +8,8 @@ stdenv.mkDerivation {
     sha256 = "0wvl95gf4pjs93632g4wi0mw1glzzhjp9g4xg93ll2zxggbxibli";
   };
 
-  ARCH = if stdenv.system == "i686-linux" then "linux32"
-         else if stdenv.system == "x86_64-linux" then "linux64"
+  ARCH = if stdenv.hostPlatform.system == "i686-linux" then "linux32"
+         else if stdenv.hostPlatform.system == "x86_64-linux" then "linux64"
          else throw "Unsupported system";
 
   hardeningDisable = [ "format" ];
diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix
index 563250097ae..901675ff31b 100644
--- a/pkgs/development/compilers/rust/bootstrap.nix
+++ b/pkgs/development/compilers/rust/bootstrap.nix
@@ -16,19 +16,19 @@ let
   };
 
   platform =
-    if stdenv.system == "i686-linux"
+    if stdenv.hostPlatform.system == "i686-linux"
     then "i686-unknown-linux-gnu"
-    else if stdenv.system == "x86_64-linux"
+    else if stdenv.hostPlatform.system == "x86_64-linux"
     then "x86_64-unknown-linux-gnu"
-    else if stdenv.system == "armv7l-linux"
+    else if stdenv.hostPlatform.system == "armv7l-linux"
     then "armv7-unknown-linux-gnueabihf"
-    else if stdenv.system == "aarch64-linux"
+    else if stdenv.hostPlatform.system == "aarch64-linux"
     then "aarch64-unknown-linux-gnu"
-    else if stdenv.system == "i686-darwin"
+    else if stdenv.hostPlatform.system == "i686-darwin"
     then "i686-apple-darwin"
-    else if stdenv.system == "x86_64-darwin"
+    else if stdenv.hostPlatform.system == "x86_64-darwin"
     then "x86_64-apple-darwin"
-    else throw "missing bootstrap url for platform ${stdenv.system}";
+    else throw "missing bootstrap url for platform ${stdenv.hostPlatform.system}";
 
   src = fetchurl {
      url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
diff --git a/pkgs/development/compilers/sbcl/bootstrap.nix b/pkgs/development/compilers/sbcl/bootstrap.nix
index 529123398a5..ee662d39e45 100644
--- a/pkgs/development/compilers/sbcl/bootstrap.nix
+++ b/pkgs/development/compilers/sbcl/bootstrap.nix
@@ -39,9 +39,9 @@ let
       sha256 = "05c12fmac4ha72k1ckl6i780rckd7jh4g5s5hiic7fjxnf1kx8d0";
     };
   };
-  cfg = options.${stdenv.system};
+  cfg = options.${stdenv.hostPlatform.system};
 in
-assert builtins.hasAttr stdenv.system options;
+assert builtins.hasAttr stdenv.hostPlatform.system options;
 stdenv.mkDerivation rec {
   name    = "sbcl-bootstrap-${version}";
   version = cfg.version;
diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix
index 261a2fb6432..a860aa7dc73 100644
--- a/pkgs/development/compilers/sbcl/default.nix
+++ b/pkgs/development/compilers/sbcl/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, writeText, sbclBootstrap
 , sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit"
-, threadSupport ? (stdenv.isi686 || stdenv.isx86_64 || "aarch64-linux" == stdenv.system)
+, threadSupport ? (stdenv.isi686 || stdenv.isx86_64 || "aarch64-linux" == stdenv.hostPlatform.system)
   # Meant for sbcl used for creating binaries portable to non-NixOS via save-lisp-and-die.
   # Note that the created binaries still need `patchelf --set-interpreter ...`
   # to get rid of ${glibc} dependency.
diff --git a/pkgs/development/interpreters/dart/default.nix b/pkgs/development/interpreters/dart/default.nix
index ae7f8686b78..4c697ec4e80 100644
--- a/pkgs/development/interpreters/dart/default.nix
+++ b/pkgs/development/interpreters/dart/default.nix
@@ -45,7 +45,7 @@ stdenv.mkDerivation {
     unzip
   ];
 
-  src = sources."${version}-${stdenv.system}" or (throw "unsupported version/system: ${version}/${stdenv.system}");
+  src = sources."${version}-${stdenv.hostPlatform.system}" or (throw "unsupported version/system: ${version}/${stdenv.hostPlatform.system}");
 
   installPhase = ''
     mkdir -p $out
diff --git a/pkgs/development/interpreters/spidermonkey/1.8.5.nix b/pkgs/development/interpreters/spidermonkey/1.8.5.nix
index bd53450de4e..46637195586 100644
--- a/pkgs/development/interpreters/spidermonkey/1.8.5.nix
+++ b/pkgs/development/interpreters/spidermonkey/1.8.5.nix
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
   # of polkit, which is what matters most, it does not override the allocator
   # so the failure of that test does not matter much.
   configureFlags = [ "--enable-threadsafe" "--with-system-nspr" ] ++
-    stdenv.lib.optionals (stdenv.system == "armv5tel-linux") [
+    stdenv.lib.optionals (stdenv.hostPlatform.system == "armv5tel-linux") [
         "--with-cpu-arch=armv5t" 
         "--disable-tracejit" ];
 
diff --git a/pkgs/development/libraries/apr/default.nix b/pkgs/development/libraries/apr/default.nix
index 7d7acf90a95..705f61445b5 100644
--- a/pkgs/development/libraries/apr/default.nix
+++ b/pkgs/development/libraries/apr/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   configureFlags =
     # Including the Windows headers breaks unistd.h.
     # Based on ftp://sourceware.org/pub/cygwin/release/libapr1/libapr1-1.3.8-2-src.tar.bz2
-    stdenv.lib.optional (stdenv.system == "i686-cygwin") "ac_cv_header_windows_h=no";
+    stdenv.lib.optional (stdenv.hostPlatform.system == "i686-cygwin") "ac_cv_header_windows_h=no";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/audio/libbass/default.nix b/pkgs/development/libraries/audio/libbass/default.nix
index ec93e2f6467..390ca6bb04b 100644
--- a/pkgs/development/libraries/audio/libbass/default.nix
+++ b/pkgs/development/libraries/audio/libbass/default.nix
@@ -41,8 +41,8 @@ let
     dontBuild = true;
     installPhase =
       let so =
-            if bass.so ? ${stdenv.system} then bass.so.${stdenv.system}
-            else throw "${name} not packaged for ${stdenv.system} (yet).";
+            if bass.so ? ${stdenv.hostPlatform.system} then bass.so.${stdenv.hostPlatform.system}
+            else throw "${name} not packaged for ${stdenv.hostPlatform.system} (yet).";
       in ''
         mkdir -p $out/{lib,include}
         install -m644 -t $out/lib/ ${so}
diff --git a/pkgs/development/libraries/bootil/default.nix b/pkgs/development/libraries/bootil/default.nix
index 160f6230594..b64cdd5245f 100644
--- a/pkgs/development/libraries/bootil/default.nix
+++ b/pkgs/development/libraries/bootil/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   platform =
     if stdenv.isLinux then "linux"
     else if stdenv.isDarwin then "macosx"
-    else throw "unrecognized system ${stdenv.system}";
+    else throw "unrecognized system ${stdenv.hostPlatform.system}";
 
   buildInputs = [ premake4 ];
 
diff --git a/pkgs/development/libraries/crypto++/default.nix b/pkgs/development/libraries/crypto++/default.nix
index ba5b2aa4371..cbd3e405415 100644
--- a/pkgs/development/libraries/crypto++/default.nix
+++ b/pkgs/development/libraries/crypto++/default.nix
@@ -12,9 +12,10 @@ stdenv.mkDerivation rec {
     sha256 = "1yk7jyf4va9425cg05llskpls2jm7n3jwy2hj5jm74zkr4mwpvl7";
   };
 
-  patches = with stdenv;
-    lib.optional (system != "i686-cygwin") ./dll.patch
-    ++ lib.optional isDarwin ./GNUmakefile-darwin.patch;
+  patches = stdenv.lib.concatLists [
+    (stdenv.lib.optional (stdenv.hostPlatform.system != "i686-cygwin") ./dll.patch)
+    (stdenv.lib.optional stdenv.hostPlatform.isDarwin ./GNUmakefile-darwin.patch)
+  ];
 
 
   configurePhase = let
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index b3b00a1c722..71fe23ea6b0 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -7,7 +7,10 @@
 , withPython ? false, swig2 ? null, python ? null
 }:
 
-let inherit (stdenv) lib system; in
+let
+  inherit (stdenv) lib;
+  inherit (stdenv.hostPlatform) system;
+in
 
 stdenv.mkDerivation rec {
   name = "gpgme-${version}";
diff --git a/pkgs/development/libraries/gsl/default.nix b/pkgs/development/libraries/gsl/default.nix
index 37d4843db8d..8a419d67865 100644
--- a/pkgs/development/libraries/gsl/default.nix
+++ b/pkgs/development/libraries/gsl/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   ];
 
   # https://lists.gnu.org/archive/html/bug-gsl/2015-11/msg00012.html
-  doCheck = stdenv.system != "i686-linux" && stdenv.system != "aarch64-linux";
+  doCheck = stdenv.hostPlatform.system != "i686-linux" && stdenv.hostPlatform.system != "aarch64-linux";
 
   meta = {
     description = "The GNU Scientific Library, a large numerical library";
diff --git a/pkgs/development/libraries/java/jzmq/default.nix b/pkgs/development/libraries/java/jzmq/default.nix
index 7d229d2577a..402f893034b 100644
--- a/pkgs/development/libraries/java/jzmq/default.nix
+++ b/pkgs/development/libraries/java/jzmq/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ zeromq3 jdk ];
 
   preConfigure = ''
-    ${if stdenv.system == "x86_64-darwin" then
+    ${if stdenv.hostPlatform.system == "x86_64-darwin" then
       '' sed -i -e 's~/Headers~/include~' -e 's~_JNI_INC_SUBDIRS=\".*\"~_JNI_INC_SUBDIRS=\"darwin\"~' configure
       '' else ""}
   '';
diff --git a/pkgs/development/libraries/java/swt/default.nix b/pkgs/development/libraries/java/swt/default.nix
index 1a7153f99e6..0aa20f8b014 100644
--- a/pkgs/development/libraries/java/swt/default.nix
+++ b/pkgs/development/libraries/java/swt/default.nix
@@ -16,7 +16,7 @@ let
         sha256 = "00k1mfbncvyh8klgmk0891w8jwnd5niqb16j1j8yacrm2smmlb05"; };
   };
 
-  metadata = assert platformMap ? ${stdenv.system}; platformMap.${stdenv.system};
+  metadata = assert platformMap ? ${stdenv.hostPlatform.system}; platformMap.${stdenv.hostPlatform.system};
 
 in stdenv.mkDerivation rec {
   version = "4.5";
diff --git a/pkgs/development/libraries/libspotify/default.nix b/pkgs/development/libraries/libspotify/default.nix
index 3a01ff2944d..e472fe014ee 100644
--- a/pkgs/development/libraries/libspotify/default.nix
+++ b/pkgs/development/libraries/libspotify/default.nix
@@ -2,26 +2,26 @@
 
 let
   version = "12.1.51";
-  isLinux = (stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux");
+  isLinux = (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "i686-linux");
 in
 
-if (stdenv.system != "x86_64-linux" && stdenv.system != "x86_64-darwin" && stdenv.system != "i686-linux")
+if (stdenv.hostPlatform.system != "x86_64-linux" && stdenv.hostPlatform.system != "x86_64-darwin" && stdenv.hostPlatform.system != "i686-linux")
 then throw "Check https://developer.spotify.com/technologies/libspotify/ for a tarball for your system and add it here"
 else stdenv.mkDerivation {
   name = "libspotify-${version}";
 
   src =
-    if stdenv.system == "x86_64-linux" then
+    if stdenv.hostPlatform.system == "x86_64-linux" then
       fetchurl {
         url    = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Linux-x86_64-release.tar.gz";
         sha256 = "0n0h94i4xg46hfba95n3ypah93crwb80bhgsg00f6sms683lx8a3";
       }
-    else if stdenv.system == "x86_64-darwin" then
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then
       fetchurl {
         url    = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Darwin-universal.zip";
         sha256 = "1gcgrc8arim3hnszcc886lmcdb4iigc08abkaa02l6gng43ky1c0";
       }
-    else if stdenv.system == "i686-linux" then
+    else if stdenv.hostPlatform.system == "i686-linux" then
       fetchurl {
         url    = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Linux-i686-release.tar.gz";
         sha256 = "1bjmn64gbr4p9irq426yap4ipq9rb84zsyhjjr7frmmw22xb86ll";
@@ -46,7 +46,7 @@ else stdenv.mkDerivation {
 
 
   # darwin-specific
-  buildInputs = stdenv.lib.optional (stdenv.system == "x86_64-darwin") unzip;
+  buildInputs = stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") unzip;
 
   # linux-specific
   installFlags = stdenv.lib.optionalString (isLinux)
diff --git a/pkgs/development/libraries/live555/default.nix b/pkgs/development/libraries/live555/default.nix
index e0cf3328bac..4dd5d8bcd26 100644
--- a/pkgs/development/libraries/live555/default.nix
+++ b/pkgs/development/libraries/live555/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
       i686-linux = "linux";
       x86_64-linux = "linux-64bit";
       aarch64-linux = "linux-64bit";
-    }.${stdenv.system}}
+    }.${stdenv.hostPlatform.system}}
   '';
 
   installPhase = ''
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index e1a9477dcd6..063ed381e01 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -23,7 +23,7 @@
 
 with stdenv.lib;
 
-if ! lists.elem stdenv.system platforms.mesaPlatforms then
+if ! lists.elem stdenv.hostPlatform.system platforms.mesaPlatforms then
   throw "unsupported platform for Mesa"
 else
 
diff --git a/pkgs/development/libraries/nettle/generic.nix b/pkgs/development/libraries/nettle/generic.nix
index 3af93469cf1..2ef367b6c53 100644
--- a/pkgs/development/libraries/nettle/generic.nix
+++ b/pkgs/development/libraries/nettle/generic.nix
@@ -16,11 +16,11 @@ stdenv.mkDerivation (rec {
   nativeBuildInputs = [ gnum4 ];
   propagatedBuildInputs = [ gmp ];
 
-  doCheck = (stdenv.system != "i686-cygwin" && !stdenv.isDarwin);
+  doCheck = (stdenv.hostPlatform.system != "i686-cygwin" && !stdenv.isDarwin);
 
   enableParallelBuilding = true;
 
-  patches = stdenv.lib.optional (stdenv.system == "i686-cygwin")
+  patches = stdenv.lib.optional (stdenv.hostPlatform.system == "i686-cygwin")
               ./cygwin.patch;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix
index e97aa0d391e..81d106a2a40 100644
--- a/pkgs/development/libraries/opencv/3.x.nix
+++ b/pkgs/development/libraries/opencv/3.x.nix
@@ -63,11 +63,11 @@ let
       sha256 = "1ys9mshfpm8iy8h4ml792gnqrq959dsrcv26axx14niivxyjbji8";
     } + "/ippicv";
     files = let name = platform : "ippicv_2017u3_${platform}_general_20180518.tgz"; in
-      if stdenv.system == "x86_64-linux" then
+      if stdenv.hostPlatform.system == "x86_64-linux" then
       { ${name "lnx_intel64"} = "b7cc351267db2d34b9efa1cd22ff0572"; }
-      else if stdenv.system == "i686-linux" then
+      else if stdenv.hostPlatform.system == "i686-linux" then
       { ${name "lnx_ia32"}    = "ea72de74dae3c604eb6348395366e78e"; }
-      else if stdenv.system == "x86_64-darwin" then
+      else if stdenv.hostPlatform.system == "x86_64-darwin" then
       { ${name "mac_intel64"} = "3ae52b9be0fe73dd45bc5e9429cd3732"; }
       else
       throw "ICV is not available for this platform (or not yet supported by this package)";
diff --git a/pkgs/development/libraries/oracle-instantclient/default.nix b/pkgs/development/libraries/oracle-instantclient/default.nix
index 0c05e2ec5f6..fe260e0c2ad 100644
--- a/pkgs/development/libraries/oracle-instantclient/default.nix
+++ b/pkgs/development/libraries/oracle-instantclient/default.nix
@@ -14,12 +14,12 @@ let
     sha256 = hash;
   });
 
-  throwSystem = throw "Unsupported system: ${stdenv.system}";
+  throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
 
   arch = {
     "x86_64-linux" = "linux.x64";
     "x86_64-darwin" = "macos.x64";
-  }."${stdenv.system}" or throwSystem;
+  }."${stdenv.hostPlatform.system}" or throwSystem;
 
   srcs = {
     "x86_64-linux" = [
@@ -32,7 +32,7 @@ let
       (requireSource "sdk" arch version "2" "e0befca9c4e71ebc9f444957ffa70f01aeeec5976ea27c40406471b04c34848b")
       (requireSource "sqlplus" arch version "2" "d147cbb5b2a954fdcb4b642df4f0bd1153fd56e0f56e7fa301601b4f7e2abe0e") ]
       ++ optional odbcSupport (requireSource "odbc" arch version "2" "1805c1ab6c8c5e8df7bdcc35d7f2b94c329ecf4dff9bde55d5f9b159ecd8b64e");
-  }."${stdenv.system}" or throwSystem;
+  }."${stdenv.hostPlatform.system}" or throwSystem;
 
   extLib = stdenv.hostPlatform.extensions.sharedLibrary;
 in stdenv.mkDerivation rec {
diff --git a/pkgs/development/libraries/physics/geant4/fetch.nix b/pkgs/development/libraries/physics/geant4/fetch.nix
index 7dc4c865627..5d539b480d7 100644
--- a/pkgs/development/libraries/physics/geant4/fetch.nix
+++ b/pkgs/development/libraries/physics/geant4/fetch.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl }:
 
 let
-  fetch = { version, src ? builtins.getAttr stdenv.system sources, sources ? null }:
+  fetch = { version, src ? builtins.getAttr stdenv.hostPlatform.system sources, sources ? null }:
   {
     inherit version src;
   };
diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix
index 18483f9e327..b5efdc58584 100644
--- a/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/pkgs/development/libraries/science/math/openblas/default.nix
@@ -67,15 +67,15 @@ in
 
 let
   config =
-    configs.${stdenv.system}
-    or (throw "unsupported system: ${stdenv.system}");
+    configs.${stdenv.hostPlatform.system}
+    or (throw "unsupported system: ${stdenv.hostPlatform.system}");
 in
 
 let
   blas64 =
     if blas64_ != null
       then blas64_
-      else hasPrefix "x86_64" stdenv.system;
+      else hasPrefix "x86_64" stdenv.hostPlatform.system;
 in
 stdenv.mkDerivation rec {
   name = "openblas-${version}";
diff --git a/pkgs/development/libraries/scmccid/default.nix b/pkgs/development/libraries/scmccid/default.nix
index f88bd64f597..b305fecc393 100644
--- a/pkgs/development/libraries/scmccid/default.nix
+++ b/pkgs/development/libraries/scmccid/default.nix
@@ -5,11 +5,11 @@ assert stdenv ? cc && stdenv.cc.libc != null;
 stdenv.mkDerivation rec {
   name = "scmccid-5.0.11";
 
-  src = if stdenv.system == "i686-linux" then (fetchurl {
+  src = if stdenv.hostPlatform.system == "i686-linux" then (fetchurl {
       url = "http://www.scmmicro.com/support/download/scmccid_5.0.11_linux.tar.gz";
       sha256 = "1r5wkarhzl09ncgj55baizf573czw0nplh1pgddzx9xck66kh5bm";
     })
-    else if stdenv.system == "x86_64-linux" then (fetchurl {
+    else if stdenv.hostPlatform.system == "x86_64-linux" then (fetchurl {
         url = "http://www.scmmicro.com/support/download/scmccid_5.0.11_linux_x64.tar.gz";
         sha256 = "0k9lzlk01sl4ycfqgrqqy3bildz0mcr1r0kkicgjz96l4s0jgz0i";
     })
diff --git a/pkgs/development/libraries/skalibs/default.nix b/pkgs/development/libraries/skalibs/default.nix
index b3f5e12b0ec..9d5bd170e20 100644
--- a/pkgs/development/libraries/skalibs/default.nix
+++ b/pkgs/development/libraries/skalibs/default.nix
@@ -33,7 +33,7 @@ in 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/skalibs
diff --git a/pkgs/development/libraries/tachyon/default.nix b/pkgs/development/libraries/tachyon/default.nix
index d5d12e44df0..27ac0fdd5ff 100644
--- a/pkgs/development/libraries/tachyon/default.nix
+++ b/pkgs/development/libraries/tachyon/default.nix
@@ -34,15 +34,15 @@ stdenv.mkDerivation rec {
     export USEPNG=" -DUSEPNG"
     export PNGLIB=" -lpng -lz"
   '';
-  arch = if stdenv.system == "x86_64-linux"   then "linux-64-thr"  else
-         if stdenv.system == "i686-linux"     then "linux-thr"     else
-         if stdenv.system == "aarch64-linux"  then "linux-arm-thr" else
-         if stdenv.system == "armv7l-linux"   then "linux-arm-thr" else
-         if stdenv.system == "x86_64-darwin"  then "macosx-thr"    else
-         if stdenv.system == "i686-darwin"    then "macosx-64-thr" else
-         if stdenv.system == "i686-cygwin"    then "win32"         else
-         if stdenv.system == "x86_64-freebsd" then "bsd"           else
-         if stdenv.system == "x686-freebsd"   then "bsd"           else
+  arch = if stdenv.hostPlatform.system == "x86_64-linux"   then "linux-64-thr"  else
+         if stdenv.hostPlatform.system == "i686-linux"     then "linux-thr"     else
+         if stdenv.hostPlatform.system == "aarch64-linux"  then "linux-arm-thr" else
+         if stdenv.hostPlatform.system == "armv7l-linux"   then "linux-arm-thr" else
+         if stdenv.hostPlatform.system == "x86_64-darwin"  then "macosx-thr"    else
+         if stdenv.hostPlatform.system == "i686-darwin"    then "macosx-64-thr" else
+         if stdenv.hostPlatform.system == "i686-cygwin"    then "win32"         else
+         if stdenv.hostPlatform.system == "x86_64-freebsd" then "bsd"           else
+         if stdenv.hostPlatform.system == "x686-freebsd"   then "bsd"           else
          throw "Don't know what arch to select for tachyon build";
   makeFlags = "${arch}";
   patches = [
diff --git a/pkgs/development/libraries/v8/3.14.nix b/pkgs/development/libraries/v8/3.14.nix
index ce666becc85..827274251ed 100644
--- a/pkgs/development/libraries/v8/3.14.nix
+++ b/pkgs/development/libraries/v8/3.14.nix
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     install -vD out/Release/d8 "$out/bin/d8"
-    ${if stdenv.system == "x86_64-darwin" then ''
+    ${if stdenv.hostPlatform.system == "x86_64-darwin" then ''
     install -vD out/Release/lib.target/libv8.dylib "$out/lib/libv8.dylib"
     '' else ''
     install -vD out/Release/lib.target/libv8.so "$out/lib/libv8.so"
diff --git a/pkgs/development/libraries/vigra/default.nix b/pkgs/development/libraries/vigra/default.nix
index 4a002becdb3..12c166beacb 100644
--- a/pkgs/development/libraries/vigra/default.nix
+++ b/pkgs/development/libraries/vigra/default.nix
@@ -21,7 +21,7 @@ in stdenv.mkDerivation rec {
   preConfigure = "cmakeFlags+=\" -DVIGRANUMPY_INSTALL_DIR=$out/lib/${python.libPrefix}/site-packages\"";
 
   cmakeFlags = [ "-DWITH_OPENEXR=1" ]
-            ++ stdenv.lib.optionals (stdenv.system == "x86_64-linux")
+            ++ stdenv.lib.optionals (stdenv.hostPlatform.system == "x86_64-linux")
                   [ "-DCMAKE_CXX_FLAGS=-fPIC" "-DCMAKE_C_FLAGS=-fPIC" ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/vxl/default.nix b/pkgs/development/libraries/vxl/default.nix
index b9f3c0e64d6..777b8bb1f40 100644
--- a/pkgs/development/libraries/vxl/default.nix
+++ b/pkgs/development/libraries/vxl/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   # in stdenv linux headers
   # BUILD_BRL fails to find open()
   cmakeFlags = "-DBUILD_TESTING=OFF -DBUILD_OUL=OFF -DBUILD_BRL=OFF -DBUILD_CONTRIB=OFF "
-    + (if stdenv.system == "x86_64-linux" then
+    + (if stdenv.hostPlatform.system == "x86_64-linux" then
       "-DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC"
     else
       "");
diff --git a/pkgs/development/libraries/wtk/default.nix b/pkgs/development/libraries/wtk/default.nix
index 0ed4f24ef86..2791c97f5ae 100644
--- a/pkgs/development/libraries/wtk/default.nix
+++ b/pkgs/development/libraries/wtk/default.nix
@@ -1,6 +1,6 @@
 { stdenv, requireFile, unzip, xorg }:
 
-assert stdenv.system == "i686-linux";
+assert stdenv.hostPlatform.system == "i686-linux";
 
 stdenv.mkDerivation rec {
   name = "sun-java-wtk-2.5.2_01";
diff --git a/pkgs/development/misc/amdapp-sdk/default.nix b/pkgs/development/misc/amdapp-sdk/default.nix
index 7da0fc148d4..79651db23ea 100644
--- a/pkgs/development/misc/amdapp-sdk/default.nix
+++ b/pkgs/development/misc/amdapp-sdk/default.nix
@@ -5,10 +5,10 @@
 
 let
 
-  bits = if stdenv.system == "x86_64-linux" then "64"
+  bits = if stdenv.hostPlatform.system == "x86_64-linux" then "64"
          else "32";
 
-  arch = if stdenv.system == "x86_64-linux" then "x86_64"
+  arch = if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64"
          else "x86";
 
   src_info = {
diff --git a/pkgs/development/mobile/androidenv/androidndk.nix b/pkgs/development/mobile/androidenv/androidndk.nix
index 972c8a5dfbc..3ccdb237f89 100644
--- a/pkgs/development/mobile/androidenv/androidndk.nix
+++ b/pkgs/development/mobile/androidenv/androidndk.nix
@@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
   name = "android-ndk-r${version}";
   inherit version;
 
-  src = if stdenv.system == "x86_64-linux" then fetchurl {
+  src = if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl {
       url = "https://dl.google.com/android/repository/${name}-linux-x86_64.zip";
       inherit sha256;
-    } else throw "platform ${stdenv.system} not supported!";
+    } else throw "platform ${stdenv.hostPlatform.system} not supported!";
 
   phases = "buildPhase";
 
diff --git a/pkgs/development/mobile/androidenv/androidndk_r8e.nix b/pkgs/development/mobile/androidenv/androidndk_r8e.nix
index 3c12e16277d..68d2150f972 100644
--- a/pkgs/development/mobile/androidenv/androidndk_r8e.nix
+++ b/pkgs/development/mobile/androidenv/androidndk_r8e.nix
@@ -9,16 +9,16 @@
 stdenv.mkDerivation rec {
   name = "android-ndk-r8e";
 
-  src = if stdenv.system == "i686-linux"
+  src = if stdenv.hostPlatform.system == "i686-linux"
     then fetchurl {
       url = "http://dl.google.com/android/ndk/${name}-linux-x86.tar.bz2";
       sha256 = "c2c4e0c8b3037149a0f5dbb08d72f814a52af4da9fff9d80328c675457e95a98";
     }
-    else if stdenv.system == "x86_64-linux" then fetchurl {
+    else if stdenv.hostPlatform.system == "x86_64-linux" then fetchurl {
       url = "http://dl.google.com/android/ndk/${name}-linux-x86_64.tar.bz2";
       sha256 = "093gf55zbh38p2gk5bdykj1vg9p5l774wjdzw5mhk4144jm1wdq7";
     }
-    else throw "platform ${stdenv.system} not supported!";
+    else throw "platform ${stdenv.hostPlatform.system} not supported!";
 
   phases = "buildPhase";
 
diff --git a/pkgs/development/mobile/androidenv/androidsdk.nix b/pkgs/development/mobile/androidenv/androidsdk.nix
index 503e4f5c889..5f61f25d54e 100644
--- a/pkgs/development/mobile/androidenv/androidsdk.nix
+++ b/pkgs/development/mobile/androidenv/androidsdk.nix
@@ -22,16 +22,16 @@ stdenv.mkDerivation rec {
   name = "android-sdk-${version}";
   version = "25.2.5";
 
-  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+  src = if (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
     then fetchurl {
       url = "https://dl.google.com/android/repository/tools_r${version}-linux.zip";
       sha256 = "0gnk49pkwy4m0nqwm1xnf3w4mfpi9w0kk7841xlawpwbkj0icxap";
     }
-    else if stdenv.system == "x86_64-darwin" then fetchurl {
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then fetchurl {
       url = "http://dl.google.com/android/repository/tools_r${version}-macosx.zip";
       sha256 = "0yg7wjmyw70xsh8k4hgbqb5rilam2a94yc8dwbh7fjwqcmpxgwqb";
     }
-    else throw "platform not ${stdenv.system} supported!";
+    else throw "platform not ${stdenv.hostPlatform.system} supported!";
 
   buildCommand = ''
     mkdir -p $out/libexec
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
         sed -i -e "s|/bin/ls|${coreutils}/bin/ls|" "$f"
     done
 
-    ${stdenv.lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+    ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
     ''
       # There are a number of native binaries. We must patch them to let them find the interpreter and libstdc++
 
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
           patchelf --set-rpath ${stdenv_32bit.cc.cc.lib}/lib $i
       done
 
-      ${stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
+      ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
         for i in bin64/{mkfs.ext4,fsck.ext4,e2fsck,tune2fs,resize2fs}
         do
             patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 $i
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
         done
       ''}
 
-      ${stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
+      ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
         # We must also patch the 64-bit emulator instances, if needed
 
         for i in emulator emulator64-arm emulator64-mips emulator64-x86 emulator64-crash-service emulator-check qemu/linux-x86_64/qemu-system-*
@@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
 
       # The emulators need additional libraries, which are dynamically loaded => let's wrap them
 
-      ${stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
+      ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
         for i in emulator emulator64-arm emulator64-mips emulator64-x86 emulator64-crash-service
         do
             wrapProgram `pwd`/$i \
@@ -102,7 +102,7 @@ stdenv.mkDerivation rec {
 
     patchShebangs .
 
-    ${if stdenv.system == "i686-linux" then
+    ${if stdenv.hostPlatform.system == "i686-linux" then
       ''
         # The monitor requires some more patching
 
@@ -115,7 +115,7 @@ stdenv.mkDerivation rec {
 
         cd ../..
       ''
-      else if stdenv.system == "x86_64-linux" then
+      else if stdenv.hostPlatform.system == "x86_64-linux" then
       ''
         # The monitor requires some more patching
 
diff --git a/pkgs/development/mobile/androidenv/build-tools.nix b/pkgs/development/mobile/androidenv/build-tools.nix
index 457a9b6720a..85e604bd3f4 100644
--- a/pkgs/development/mobile/androidenv/build-tools.nix
+++ b/pkgs/development/mobile/androidenv/build-tools.nix
@@ -3,16 +3,16 @@
 stdenv.mkDerivation rec {
   version = "26.0.2";
   name = "android-build-tools-r${version}";
-  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+  src = if (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
     then fetchurl {
       url = "https://dl.google.com/android/repository/build-tools_r${version}-linux.zip";
       sha256 = "1kii880bwhjkc343zwx1ysxyisxhczrwhphnxbwsgi45mjgq8lm7";
     }
-    else if stdenv.system == "x86_64-darwin" then fetchurl {
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then fetchurl {
       url = "https://dl.google.com/android/repository/build-tools_r${version}-macosx.zip";
       sha256 = "1x0ycprl6hgsm23kck5ind7x00hzydc5k3h3ch4a13407xbpvzvx";
     }
-    else throw "System ${stdenv.system} not supported!";
+    else throw "System ${stdenv.hostPlatform.system} not supported!";
 
   buildCommand = ''
     mkdir -p $out/build-tools
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     unzip $src
     mv android-* ${version}
 
-    ${stdenv.lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+    ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
       ''
         cd ${version}
 
diff --git a/pkgs/development/mobile/androidenv/default.nix b/pkgs/development/mobile/androidenv/default.nix
index 7d7c92cd0f5..4e9f139b95e 100644
--- a/pkgs/development/mobile/androidenv/default.nix
+++ b/pkgs/development/mobile/androidenv/default.nix
@@ -25,15 +25,15 @@ rec {
     inherit (pkgs) stdenv fetchurl unzip;
   };
 
-  platforms = if (pkgs.stdenv.system == "i686-linux" || pkgs.stdenv.system == "x86_64-linux")
+  platforms = if (pkgs.stdenv.hostPlatform.system == "i686-linux" || pkgs.stdenv.hostPlatform.system == "x86_64-linux")
     then import ./platforms-linux.nix {
       inherit (pkgs) stdenv fetchurl unzip;
     }
-    else if pkgs.stdenv.system == "x86_64-darwin"
+    else if pkgs.stdenv.hostPlatform.system == "x86_64-darwin"
     then import ./platforms-macosx.nix {
       inherit (pkgs) stdenv fetchurl unzip;
     }
-    else throw "Platform: ${pkgs.stdenv.system} not supported!";
+    else throw "Platform: ${pkgs.stdenv.hostPlatform.system} not supported!";
 
   sysimages = import ./sysimages.nix {
     inherit (pkgs) stdenv fetchurl unzip;
diff --git a/pkgs/development/mobile/androidenv/platform-tools.nix b/pkgs/development/mobile/androidenv/platform-tools.nix
index f5e57994284..22b5cd81f87 100644
--- a/pkgs/development/mobile/androidenv/platform-tools.nix
+++ b/pkgs/development/mobile/androidenv/platform-tools.nix
@@ -8,16 +8,16 @@ in
 stdenv.mkDerivation rec {
   version = "26.0.2";
   name = "android-platform-tools-r${version}";
-  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+  src = if (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
     then fetchurl {
       url = "https://dl.google.com/android/repository/platform-tools_r${version}-linux.zip";
       sha256 = "0695npvxljbbh8xwfm65k34fcpyfkzvfkssgnp46wkmnq8w5mcb3";
     }
-    else if stdenv.system == "x86_64-darwin" then fetchurl {
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then fetchurl {
       url = "https://dl.google.com/android/repository/platform-tools_r${version}-darwin.zip";
       sha256 = "0gy7apw9pmnnm41z6ywglw5va4ghmny4j57778may4q7ar751l56";
     }
-    else throw "System ${stdenv.system} not supported!";
+    else throw "System ${stdenv.hostPlatform.system} not supported!";
 
   buildCommand = ''
     mkdir -p $out
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     unzip $src
     cd platform-tools
 
-    ${stdenv.lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+    ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux")
       ''
         for i in adb dmtracedump fastboot hprof-conv sqlite3
         do
diff --git a/pkgs/development/mobile/titaniumenv/build-app.nix b/pkgs/development/mobile/titaniumenv/build-app.nix
index 83bd941e5ff..0250e5bf2e2 100644
--- a/pkgs/development/mobile/titaniumenv/build-app.nix
+++ b/pkgs/development/mobile/titaniumenv/build-app.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
   name = stdenv.lib.replaceChars [" "] [""] name;
   inherit src;
 
-  buildInputs = [ nodejs titanium alloy jdk python which file ] ++ stdenv.lib.optional (stdenv.system == "x86_64-darwin") xcodewrapper;
+  buildInputs = [ nodejs titanium alloy jdk python which file ] ++ stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") xcodewrapper;
   
   buildPhase = ''
     ${preBuild}
diff --git a/pkgs/development/mobile/titaniumenv/default.nix b/pkgs/development/mobile/titaniumenv/default.nix
index b09a483290f..f411a8d61fd 100644
--- a/pkgs/development/mobile/titaniumenv/default.nix
+++ b/pkgs/development/mobile/titaniumenv/default.nix
@@ -3,7 +3,7 @@
 rec {
   androidenv = pkgs.androidenv;
 
-  xcodeenv = if pkgs.stdenv.system == "x86_64-darwin" then pkgs.xcodeenv.override {
+  xcodeenv = if pkgs.stdenv.hostPlatform.system == "x86_64-darwin" then pkgs.xcodeenv.override {
     version = xcodeVersion;
     inherit xcodeBaseDir;
   } else null;
diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix
index 26adf373826..b8c2688708b 100644
--- a/pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix
+++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix
@@ -2,15 +2,15 @@
 
 stdenv.mkDerivation {
   name = "mobilesdk-6.3.1.GA";
-  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
+  src = if (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") then fetchurl {
     url = http://builds.appcelerator.com/mobile/6_3_X/mobilesdk-6.3.1.v20171101154403-linux.zip;
     sha256 = "0g8dqqf5ffa7ll3rqm5naywipnv2vvfxcj9fmqg1wnvvxf0rflqj";
   }
-  else if stdenv.system == "x86_64-darwin" then fetchurl {
+  else if stdenv.hostPlatform.system == "x86_64-darwin" then fetchurl {
     url = http://builds.appcelerator.com/mobile/6_3_X/mobilesdk-6.3.1.v20171101154403-osx.zip;
     sha256 = "00bm8vv70mg4kd7jvmxd1bfqafv6zdpdx816i0hvf801zwnak4nj";
   }
-  else throw "Platform: ${stdenv.system} not supported!";
+  else throw "Platform: ${stdenv.hostPlatform.system} not supported!";
   
   buildInputs = [ unzip makeWrapper ];
   
@@ -23,18 +23,18 @@ stdenv.mkDerivation {
     cd mobilesdk/*
     mv * 6.3.1.GA
     cd *
-    ${stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") ''
+    ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-darwin") ''
       # Fixes a bad archive copying error when generating an IPA file
       sed -i -e "s|cp -rf|/bin/cp -rf|" iphone/cli/commands/_build.js
     ''}
 
     # Patch some executables
     
-    ${if stdenv.system == "i686-linux" then
+    ${if stdenv.hostPlatform.system == "i686-linux" then
       ''
         patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 android/titanium_prep.linux32
       ''
-      else if stdenv.system == "x86_64-linux" then
+      else if stdenv.hostPlatform.system == "x86_64-linux" then
       ''
         patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 android/titanium_prep.linux64
       ''
diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix
index a6de1f0ae8c..4d3bd420969 100644
--- a/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix
+++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix
@@ -54,15 +54,15 @@ let
 in
 stdenv.mkDerivation {
   name = "mobilesdk-7.1.0.GA";
-  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
+  src = if (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") then fetchurl {
     url = http://builds.appcelerator.com/mobile/7_1_X/mobilesdk-7.1.0.v20180314133955-linux.zip;
     sha256 = "18b3jnr65sdn5wj191bcl48gvhyklxmighxakv4vrz1fb59kyvqn";
   }
-  else if stdenv.system == "x86_64-darwin" then fetchurl {
+  else if stdenv.hostPlatform.system == "x86_64-darwin" then fetchurl {
     url = http://builds.appcelerator.com/mobile/7_1_X/mobilesdk-7.1.0.v20180314133955-osx.zip;
     sha256 = "1f62616biwsw1fqxz2sq7lpa6bsfjazffliplyf5dpnh298cnc1m";
   }
-  else throw "Platform: ${stdenv.system} not supported!";
+  else throw "Platform: ${stdenv.hostPlatform.system} not supported!";
 
   buildInputs = [ unzip makeWrapper ];
 
@@ -89,11 +89,11 @@ stdenv.mkDerivation {
 
     # Patch some executables
 
-    ${if stdenv.system == "i686-linux" then
+    ${if stdenv.hostPlatform.system == "i686-linux" then
       ''
         patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 android/titanium_prep.linux32
       ''
-      else if stdenv.system == "x86_64-linux" then
+      else if stdenv.hostPlatform.system == "x86_64-linux" then
       ''
         patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 android/titanium_prep.linux64
       ''
diff --git a/pkgs/development/node-packages/default-v10.nix b/pkgs/development/node-packages/default-v10.nix
index d7df19066bb..a438c961513 100644
--- a/pkgs/development/node-packages/default-v10.nix
+++ b/pkgs/development/node-packages/default-v10.nix
@@ -1,8 +1,9 @@
-{pkgs, system, nodejs, stdenv}:
+{ pkgs, nodejs, stdenv }:
 
 let
   nodePackages = import ./composition-v10.nix {
-    inherit pkgs system nodejs;
+    inherit pkgs nodejs;
+    inherit (stdenv.hostPlatform) system;
   };
 in
 nodePackages // {
diff --git a/pkgs/development/node-packages/default-v6.nix b/pkgs/development/node-packages/default-v6.nix
index 6b508b6f0cc..f4e28d0fd34 100644
--- a/pkgs/development/node-packages/default-v6.nix
+++ b/pkgs/development/node-packages/default-v6.nix
@@ -1,8 +1,9 @@
-{pkgs, system, nodejs, stdenv}:
+{ pkgs, nodejs, stdenv }:
 
 let
   nodePackages = import ./composition-v6.nix {
-    inherit pkgs system nodejs;
+    inherit pkgs nodejs;
+    inherit (stdenv.hostPlatform) system;
   };
 in
 nodePackages // {
diff --git a/pkgs/development/node-packages/default-v8.nix b/pkgs/development/node-packages/default-v8.nix
index 561f43271ff..7e3691dcecb 100644
--- a/pkgs/development/node-packages/default-v8.nix
+++ b/pkgs/development/node-packages/default-v8.nix
@@ -1,8 +1,9 @@
-{pkgs, system, nodejs, stdenv}:
+{ pkgs, nodejs, stdenv }:
 
 let
   nodePackages = import ./composition-v8.nix {
-    inherit pkgs system nodejs;
+    inherit pkgs nodejs;
+    inherit (stdenv.hostPlatform) system;
   };
 in
 nodePackages // {
diff --git a/pkgs/development/ruby-modules/testing/stubs.nix b/pkgs/development/ruby-modules/testing/stubs.nix
index 7e6d1102f66..aaab2f68960 100644
--- a/pkgs/development/ruby-modules/testing/stubs.nix
+++ b/pkgs/development/ruby-modules/testing/stubs.nix
@@ -6,7 +6,7 @@ let
     text = (builtins.toJSON (lib.filterAttrs ( n: v: builtins.any (x: x == n) ["name" "system"]) argSet));
     builder = stdenv.shell;
     args = [ "-c" "echo  $(<$textPath) > $out"];
-    system = stdenv.system;
+    system = stdenv.hostPlatform.system;
     passAsFile = ["text"];
   };
   fetchurl = {url?"", urls ? [],...}: "fetchurl:${if urls == [] then url else builtins.head urls}";
diff --git a/pkgs/development/tools/analysis/cov-build/default.nix b/pkgs/development/tools/analysis/cov-build/default.nix
index fef98f1e04a..bd0a4ee5e40 100644
--- a/pkgs/development/tools/analysis/cov-build/default.nix
+++ b/pkgs/development/tools/analysis/cov-build/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   version = "7.0.2";
 
   src =
-    if stdenv.system == "i686-linux"
+    if stdenv.hostPlatform.system == "i686-linux"
     then requireFile {
       name = "cov-analysis-linux32-${version}.tar.gz";
       sha256 = "0i06wbd7blgx9adh9w09by4i18vwmldfp9ix97a5dph2cjymsviy";
diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix
index cbcfa981b6b..5734a0f2795 100644
--- a/pkgs/development/tools/analysis/valgrind/default.nix
+++ b/pkgs/development/tools/analysis/valgrind/default.nix
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
     '';
 
   configureFlags =
-    stdenv.lib.optional (stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin") "--enable-only64bit";
+    stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin") "--enable-only64bit";
 
   doCheck = false; # fails
 
diff --git a/pkgs/development/tools/electron/default.nix b/pkgs/development/tools/electron/default.nix
index 695a532305a..942748a3810 100644
--- a/pkgs/development/tools/electron/default.nix
+++ b/pkgs/development/tools/electron/default.nix
@@ -4,7 +4,7 @@ let
   version = "1.8.2";
   name = "electron-${version}";
 
-  throwSystem = throw "Unsupported system: ${stdenv.system}";
+  throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
 
   meta = with stdenv.lib; {
     description = "Cross platform desktop application shell";
@@ -34,7 +34,7 @@ let
         url = "https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-linux-arm64.zip";
         sha256 = "0k4np2d4y15x1qfay8y9m8v9y223vdpbq5fdxa3ywbbyf8j361zd";
       };
-    }.${stdenv.system} or throwSystem;
+    }.${stdenv.hostPlatform.system} or throwSystem;
 
     buildInputs = [ unzip makeWrapper ];
 
diff --git a/pkgs/development/tools/github/github-release/default.nix b/pkgs/development/tools/github/github-release/default.nix
index 1ccd1061a13..b80ddff054a 100644
--- a/pkgs/development/tools/github/github-release/default.nix
+++ b/pkgs/development/tools/github/github-release/default.nix
@@ -1,9 +1,9 @@
 { stdenv, fetchurl }:
 
 let
-  linuxPredicate = stdenv.system == "x86_64-linux";
-  bsdPredicate = stdenv.system == "x86_64-freebsd";
-  darwinPredicate = stdenv.system == "x86_64-darwin";
+  linuxPredicate = stdenv.hostPlatform.system == "x86_64-linux";
+  bsdPredicate = stdenv.hostPlatform.system == "x86_64-freebsd";
+  darwinPredicate = stdenv.hostPlatform.system == "x86_64-darwin";
   metadata = assert linuxPredicate || bsdPredicate || darwinPredicate;
     if linuxPredicate then
       { arch = "linux-amd64";
diff --git a/pkgs/development/tools/google-app-engine-go-sdk/default.nix b/pkgs/development/tools/google-app-engine-go-sdk/default.nix
index c85186e1c0b..ba4f4bb3f51 100644
--- a/pkgs/development/tools/google-app-engine-go-sdk/default.nix
+++ b/pkgs/development/tools/google-app-engine-go-sdk/default.nix
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
   name = "google-app-engine-go-sdk-${version}";
   version = "1.9.61";
   src =
-    if stdenv.system == "x86_64-linux" then
+    if stdenv.hostPlatform.system == "x86_64-linux" then
       fetchzip {
         url = "https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-${version}.zip";
         sha256 = "1i2j9ympl1218akwsmm7yb31v0gibgpzlb657bcravi1irfv1hhs";
diff --git a/pkgs/development/tools/misc/cflow/default.nix b/pkgs/development/tools/misc/cflow/default.nix
index 8ec0ecd5785..16098bda3ee 100644
--- a/pkgs/development/tools/misc/cflow/default.nix
+++ b/pkgs/development/tools/misc/cflow/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ gettext ] ++
     # We don't have Emacs/GTK/etc. on {Dar,Cyg}win.
     stdenv.lib.optional
-      (! (stdenv.lib.lists.any (x: stdenv.system == x)
+      (! (stdenv.lib.lists.any (x: stdenv.hostPlatform.system == x)
               [ "i686-cygwin" ]))
       emacs;
 
diff --git a/pkgs/development/tools/misc/iozone/default.nix b/pkgs/development/tools/misc/iozone/default.nix
index 31d70d280e3..1d5da65df7e 100644
--- a/pkgs/development/tools/misc/iozone/default.nix
+++ b/pkgs/development/tools/misc/iozone/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchurl, gnuplot }:
 
 let
-  target = if stdenv.system == "i686-linux" then
+  target = if stdenv.hostPlatform.system == "i686-linux" then
     "linux"
-  else if stdenv.system == "x86_64-linux" then
+  else if stdenv.hostPlatform.system == "x86_64-linux" then
     "linux-AMD64"
-  else if stdenv.system == "x86_64-darwin" then
+  else if stdenv.hostPlatform.system == "x86_64-darwin" then
     "macosx"
-  else if stdenv.system == "aarch64-linux" then
+  else if stdenv.hostPlatform.system == "aarch64-linux" then
     "linux-arm"
-  else throw "Platform ${stdenv.system} not yet supported.";
+  else throw "Platform ${stdenv.hostPlatform.system} not yet supported.";
 in
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/development/tools/misc/kibana/5.x.nix b/pkgs/development/tools/misc/kibana/5.x.nix
index 4aa9dc8b89a..0529a276492 100644
--- a/pkgs/development/tools/misc/kibana/5.x.nix
+++ b/pkgs/development/tools/misc/kibana/5.x.nix
@@ -6,7 +6,7 @@ let
   archOverrides = {
     "i686" = "x86";
   };
-  info = splitString "-" stdenv.system;
+  info = splitString "-" stdenv.hostPlatform.system;
   arch = (elemAt info 0);
   elasticArch = archOverrides."${arch}" or arch;
   plat = elemAt info 1;
@@ -21,7 +21,7 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${elasticArch}.tar.gz";
-    sha256 = shas."${stdenv.system}" or (throw "Unknown architecture");
+    sha256 = shas."${stdenv.hostPlatform.system}" or (throw "Unknown architecture");
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/development/tools/misc/kibana/default.nix b/pkgs/development/tools/misc/kibana/default.nix
index 1fd52f43557..72321f560c7 100644
--- a/pkgs/development/tools/misc/kibana/default.nix
+++ b/pkgs/development/tools/misc/kibana/default.nix
@@ -12,7 +12,7 @@
 with stdenv.lib;
 let
   inherit (builtins) elemAt;
-  info = splitString "-" stdenv.system;
+  info = splitString "-" stdenv.hostPlatform.system;
   arch = elemAt info 0;
   plat = elemAt info 1;
   shas =
@@ -44,7 +44,7 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${arch}.tar.gz";
-    sha256 = shas."${stdenv.system}" or (throw "Unknown architecture");
+    sha256 = shas."${stdenv.hostPlatform.system}" or (throw "Unknown architecture");
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix
index 005fb09fba0..28c2660ac3d 100644
--- a/pkgs/development/tools/misc/lsof/default.nix
+++ b/pkgs/development/tools/misc/lsof/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, buildPackages, ncurses }:
 
-let dialect = with stdenv.lib; last (splitString "-" stdenv.system); in
+let dialect = with stdenv.lib; last (splitString "-" stdenv.hostPlatform.system); in
 
 stdenv.mkDerivation rec {
   name = "lsof-${version}";
diff --git a/pkgs/development/tools/misc/saleae-logic/default.nix b/pkgs/development/tools/misc/saleae-logic/default.nix
index a8183aa4ba0..c89492287db 100644
--- a/pkgs/development/tools/misc/saleae-logic/default.nix
+++ b/pkgs/development/tools/misc/saleae-logic/default.nix
@@ -27,13 +27,13 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src =
-    if stdenv.system == "i686-linux" then
+    if stdenv.hostPlatform.system == "i686-linux" then
       fetchurl {
         name = "saleae-logic-${version}-32bit.zip";
         url = "http://downloads.saleae.com/logic/${version}/Logic%20${version}%20(32-bit).zip";
         sha256 = "1dyrj07cgj2fvwi1sk97vady9ri8f8n7mxy9zyzmw9isngs7bmll";
       }
-    else if stdenv.system == "x86_64-linux" then
+    else if stdenv.hostPlatform.system == "x86_64-linux" then
       fetchurl {
         name = "saleae-logic-${version}-64bit.zip";
         url = "http://downloads.saleae.com/logic/${version}/Logic%20${version}%20(64-bit).zip";
diff --git a/pkgs/development/tools/neoload/default.nix b/pkgs/development/tools/neoload/default.nix
index c68c29f86de..06945f10eb2 100644
--- a/pkgs/development/tools/neoload/default.nix
+++ b/pkgs/development/tools/neoload/default.nix
@@ -34,7 +34,7 @@ in stdenv.mkDerivation rec {
   name = "neoload-4.1.4";
 
   src = fetchurl (
-    if stdenv.system == "x86_64-linux" then
+    if stdenv.hostPlatform.system == "x86_64-linux" then
       { url = http://neoload.installers.neotys.com/documents/download/neoload/v4.1/neoload_4_1_4_linux_x64.sh;
         sha256 = "199jcf5a0nwfm8wfld2rcjgq64g91vvz2bkmki8dxfzf1yasifcd"; }
     else
diff --git a/pkgs/development/tools/node-webkit/nw12.nix b/pkgs/development/tools/node-webkit/nw12.nix
index df7630e2d16..099e31b8d62 100644
--- a/pkgs/development/tools/node-webkit/nw12.nix
+++ b/pkgs/development/tools/node-webkit/nw12.nix
@@ -3,7 +3,7 @@
 , gdk_pixbuf, cairo, nss, nspr, gconf, expat, systemd, libcap
 , libnotify}:
 let
-  bits = if stdenv.system == "x86_64-linux" then "x64"
+  bits = if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
          else "ia32";
 
   nwEnv = buildEnv {
diff --git a/pkgs/development/tools/nwjs/default.nix b/pkgs/development/tools/nwjs/default.nix
index 90c377c4472..bd0c7f5002c 100644
--- a/pkgs/development/tools/nwjs/default.nix
+++ b/pkgs/development/tools/nwjs/default.nix
@@ -7,7 +7,7 @@
 , sqlite, udev
 }:
 let
-  bits = if stdenv.system == "x86_64-linux" then "x64"
+  bits = if stdenv.hostPlatform.system == "x86_64-linux" then "x64"
          else "ia32";
 
   nwEnv = buildEnv {
diff --git a/pkgs/development/tools/phantomjs/default.nix b/pkgs/development/tools/phantomjs/default.nix
index 51a83760be3..43fdeff9090 100644
--- a/pkgs/development/tools/phantomjs/default.nix
+++ b/pkgs/development/tools/phantomjs/default.nix
@@ -12,13 +12,13 @@ stdenv.mkDerivation rec {
   # because it has bundled a lot of external libraries (like QT and Webkit)
   # and no easy/nice way to use the system versions of these
 
-  src = if stdenv.system == "i686-linux" then
+  src = if stdenv.hostPlatform.system == "i686-linux" then
           fetchurl {
             url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-linux-i686.tar.bz2";
             sha256 = "11fzmssz9pqf3arh4f36w06sl2nyz8l9h8iyxyd7w5aqnq5la0j1";
           }
         else
-          if stdenv.system == "x86_64-linux" then
+          if stdenv.hostPlatform.system == "x86_64-linux" then
             fetchurl {
               url = "https://bitbucket.org/ariya/phantomjs/downloads/${name}-linux-x86_64.tar.bz2";
               sha256 = "0fhnqxxsxhy125fmif1lwgnlhfx908spy7fx9mng4w72320n5nd1";
diff --git a/pkgs/development/tools/sauce-connect/default.nix b/pkgs/development/tools/sauce-connect/default.nix
index fe32f7c2450..d5f7c8e6e89 100644
--- a/pkgs/development/tools/sauce-connect/default.nix
+++ b/pkgs/development/tools/sauce-connect/default.nix
@@ -7,10 +7,10 @@ stdenv.mkDerivation rec {
   version = "4.4.12";
 
   src = fetchurl (
-    if stdenv.system == "x86_64-linux" then {
+    if stdenv.hostPlatform.system == "x86_64-linux" then {
       url = "https://saucelabs.com/downloads/sc-${version}-linux.tar.gz";
       sha256 = "1yqvx64bgiq27hdhwkzgmzyib8pbjn1idpq6783srxq64asf6iyw";
-    } else if stdenv.system == "i686-linux" then {
+    } else if stdenv.hostPlatform.system == "i686-linux" then {
       url = "https://saucelabs.com/downloads/sc-${version}-linux32.tar.gz";
       sha256 = "02kib56lv4lhwkj5r15484lvvbyjvf9ydi5vccsmxgsxrzmddnl6";
     } else {
diff --git a/pkgs/development/tools/selenium/chromedriver/default.nix b/pkgs/development/tools/selenium/chromedriver/default.nix
index 238c3bc704d..abbd2a9116c 100644
--- a/pkgs/development/tools/selenium/chromedriver/default.nix
+++ b/pkgs/development/tools/selenium/chromedriver/default.nix
@@ -15,8 +15,8 @@ let
     };
   };
 
-  spec = allSpecs."${stdenv.system}"
-    or (throw "missing chromedriver binary for ${stdenv.system}");
+  spec = allSpecs."${stdenv.hostPlatform.system}"
+    or (throw "missing chromedriver binary for ${stdenv.hostPlatform.system}");
 
   libs = stdenv.lib.makeLibraryPath [
     stdenv.cc.cc.lib
diff --git a/pkgs/development/web/remarkjs/default.nix b/pkgs/development/web/remarkjs/default.nix
index 03cbf74cbad..22404481f35 100644
--- a/pkgs/development/web/remarkjs/default.nix
+++ b/pkgs/development/web/remarkjs/default.nix
@@ -13,7 +13,7 @@ let
   
   nodePackages = import ./nodepkgs.nix {
     inherit pkgs;
-    inherit (stdenv) system;
+    inherit (stdenv.hostPlatform) system;
   };
 
 in stdenv.mkDerivation rec {