about summary refs log tree commit diff
path: root/nixpkgs/pkgs/stdenv/generic/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/stdenv/generic/default.nix')
-rw-r--r--nixpkgs/pkgs/stdenv/generic/default.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/stdenv/generic/default.nix b/nixpkgs/pkgs/stdenv/generic/default.nix
index e17b41eab320..b57989786904 100644
--- a/nixpkgs/pkgs/stdenv/generic/default.nix
+++ b/nixpkgs/pkgs/stdenv/generic/default.nix
@@ -138,8 +138,11 @@ let
         is32bit is64bit
         isAarch32 isAarch64 isMips isBigEndian;
 
-      # The derivation's `system` is `buildPlatform.system`.
-      inherit (buildPlatform) system;
+      # Override `system` so that packages can get the system of the host
+      # platform through `stdenv.system`. `system` is originally set to the
+      # build platform within the derivation above so that Nix directs the build
+      # to correct type of machine.
+      inherit (hostPlatform) system;
 
       inherit (import ./make-derivation.nix {
         inherit lib config stdenv;