summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-20 15:18:07 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-20 15:22:46 -0400
commit7d85ade0ccf4fdb0b93fdbd18a07249a360144d4 (patch)
tree404c4c24cf391f6f59b6b731987de051743cb98d
parentf0d6e22b7f0d89f4474abd41b917a18cec128529 (diff)
downloadnixpkgs-7d85ade0ccf4fdb0b93fdbd18a07249a360144d4.tar
nixpkgs-7d85ade0ccf4fdb0b93fdbd18a07249a360144d4.tar.gz
nixpkgs-7d85ade0ccf4fdb0b93fdbd18a07249a360144d4.tar.bz2
nixpkgs-7d85ade0ccf4fdb0b93fdbd18a07249a360144d4.tar.lz
nixpkgs-7d85ade0ccf4fdb0b93fdbd18a07249a360144d4.tar.xz
nixpkgs-7d85ade0ccf4fdb0b93fdbd18a07249a360144d4.tar.zst
nixpkgs-7d85ade0ccf4fdb0b93fdbd18a07249a360144d4.zip
treewide: Purge `stdenv.platform` and top-level `platform`
Progress towards #27069
-rw-r--r--nixos/modules/installer/netboot/netboot.nix4
-rw-r--r--nixos/modules/system/boot/loader/generations-dir/generations-dir.nix2
-rw-r--r--nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix2
-rw-r--r--nixos/release.nix4
-rw-r--r--pkgs/build-support/vm/default.nix2
-rw-r--r--pkgs/development/compilers/chez/default.nix3
-rw-r--r--pkgs/development/libraries/v8/3.16.14.nix2
-rw-r--r--pkgs/os-specific/gnu/default.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/hardened-config.nix2
-rw-r--r--pkgs/os-specific/linux/rtl8723bs/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix6
-rw-r--r--pkgs/top-level/stage.nix5
12 files changed, 16 insertions, 20 deletions
diff --git a/nixos/modules/installer/netboot/netboot.nix b/nixos/modules/installer/netboot/netboot.nix
index a4eda3c52dc..a2c8e26f62c 100644
--- a/nixos/modules/installer/netboot/netboot.nix
+++ b/nixos/modules/installer/netboot/netboot.nix
@@ -28,7 +28,7 @@ with lib;
       ++ (if pkgs.stdenv.system == "aarch64-linux"
           then []
           else [ pkgs.grub2 pkgs.syslinux ]);
-    system.boot.loader.kernelFile = pkgs.stdenv.platform.kernelTarget;
+    system.boot.loader.kernelFile = pkgs.stdenv.hostPlatform.platform.kernelTarget;
 
     fileSystems."/" =
       { fsType = "tmpfs";
@@ -86,7 +86,7 @@ with lib;
 
     system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
       #!ipxe
-      kernel ${pkgs.stdenv.platform.kernelTarget} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
+      kernel ${pkgs.stdenv.hostPlatform.platform.kernelTarget} init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
       initrd initrd
       boot
     '';
diff --git a/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix b/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix
index f8a00784034..2d27611946e 100644
--- a/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix
+++ b/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix
@@ -13,7 +13,7 @@ let
   };
 
   # Temporary check, for nixos to cope both with nixpkgs stdenv-updates and trunk
-  platform = pkgs.stdenv.platform;
+  inherit (pkgs.stdenv.hostPlatform) platform;
 
 in
 
diff --git a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
index f974d07da9e..9bec24c53f5 100644
--- a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
+++ b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
@@ -15,7 +15,7 @@ let
     inherit configTxt;
   };
 
-  platform = pkgs.stdenv.platform;
+  inherit (pkgs.stdenv.hostPlatform) platform;
 
   builderUboot = import ./builder_uboot.nix { inherit config; inherit pkgs; inherit configTxt; };
 
diff --git a/nixos/release.nix b/nixos/release.nix
index 1d1f8009f27..b25c684ff47 100644
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -83,7 +83,7 @@ let
     in
       tarball //
         { meta = {
-            description = "NixOS system tarball for ${system} - ${stdenv.platform.name}";
+            description = "NixOS system tarball for ${system} - ${stdenv.hostPlatform.platform.name}";
             maintainers = map (x: lib.maintainers.${x}) maintainers;
           };
           inherit config;
@@ -106,7 +106,7 @@ let
     let
       configEvaled = import lib/eval-config.nix config;
       build = configEvaled.config.system.build;
-      kernelTarget = configEvaled.pkgs.stdenv.platform.kernelTarget;
+      kernelTarget = configEvaled.pkgs.stdenv.hostPlatform.platform.kernelTarget;
     in
       pkgs.symlinkJoin {
         name = "netboot";
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index 221e19ca5ed..67c67c88177 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -1,6 +1,6 @@
 { pkgs
 , kernel ? pkgs.linux
-, img ? pkgs.stdenv.platform.kernelTarget
+, img ? pkgs.stdenv.hostPlatform.platform.kernelTarget
 , storeDir ? builtins.storeDir
 , rootModules ?
     [ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ]
diff --git a/pkgs/development/compilers/chez/default.nix b/pkgs/development/compilers/chez/default.nix
index 3ffd024305d..09d68084e77 100644
--- a/pkgs/development/compilers/chez/default.nix
+++ b/pkgs/development/compilers/chez/default.nix
@@ -61,7 +61,8 @@ stdenv.mkDerivation rec {
   **
   ** Ideally in the future this would be less of a hack and could be
   ** done by Chez itself. Alternatively, there could just be a big
-  ** case statement matching to the different stdenv.platform values...
+  ** case statement matching to the different stdenv.hostPlatform.platform
+  ** values...
   */
   postInstall = ''
     m="$(ls ./work/boot)"
diff --git a/pkgs/development/libraries/v8/3.16.14.nix b/pkgs/development/libraries/v8/3.16.14.nix
index e1a9336e3a5..a7dddd14124 100644
--- a/pkgs/development/libraries/v8/3.16.14.nix
+++ b/pkgs/development/libraries/v8/3.16.14.nix
@@ -6,7 +6,7 @@ let
   arch = if stdenv.isAarch32
     then (if stdenv.is64bit then "arm64" else "arm")
     else (if stdenv.is64bit then "x64" else "ia32");
-  armHardFloat = stdenv.isAarch32 && (stdenv.platform.gcc.float or null) == "hard";
+  armHardFloat = stdenv.isAarch32 && (stdenv.hostPlatform.platform.gcc.float or null) == "hard";
 in
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/os-specific/gnu/default.nix b/pkgs/os-specific/gnu/default.nix
index 5dc52c766f1..d5760003525 100644
--- a/pkgs/os-specific/gnu/default.nix
+++ b/pkgs/os-specific/gnu/default.nix
@@ -3,7 +3,7 @@
 args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
 , texinfo, glibcCross, hurdPartedCross, libuuid, samba
 , gccCrossStageStatic, gcc
-, pkgsi686Linux, newScope, platform, config
+, pkgsi686Linux, newScope, config
 , targetPlatform, buildPlatform
 , overrides ? {}
 , buildPackages, pkgs
diff --git a/pkgs/os-specific/linux/kernel/hardened-config.nix b/pkgs/os-specific/linux/kernel/hardened-config.nix
index 309b5f6c74e..84d1dd8a378 100644
--- a/pkgs/os-specific/linux/kernel/hardened-config.nix
+++ b/pkgs/os-specific/linux/kernel/hardened-config.nix
@@ -22,7 +22,7 @@ ${optionalString (versionAtLeast version "4.10") ''
   BUG_ON_DATA_CORRUPTION y
 ''}
 
-${optionalString (stdenv.platform.kernelArch == "x86_64") ''
+${optionalString (stdenv.hostPlatform.platform.kernelArch == "x86_64") ''
   DEFAULT_MMAP_MIN_ADDR 65536 # Prevent allocation of first 64K of memory
 
   # Reduce attack surface by disabling various emulations
diff --git a/pkgs/os-specific/linux/rtl8723bs/default.nix b/pkgs/os-specific/linux/rtl8723bs/default.nix
index 0263d17ead0..b1e01f705dc 100644
--- a/pkgs/os-specific/linux/rtl8723bs/default.nix
+++ b/pkgs/os-specific/linux/rtl8723bs/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ nukeReferences ];
 
   makeFlags = concatStringsSep " " [
-    "ARCH=${stdenv.platform.kernelArch}" # Normally not needed, but the Makefile sets ARCH in a broken way.
+    "ARCH=${stdenv.hostPlatform.platform.kernelArch}" # Normally not needed, but the Makefile sets ARCH in a broken way.
     "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" # Makefile uses $(uname -r); breaks us.
   ];
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 027e4632f38..a7491632fb5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -13742,9 +13742,7 @@ with pkgs;
   nmon = callPackage ../os-specific/linux/nmon { };
 
   # GNU/Hurd core packages.
-  gnu = recurseIntoAttrs (callPackage ../os-specific/gnu {
-    inherit platform;
-  });
+  gnu = recurseIntoAttrs (callPackage ../os-specific/gnu { });
 
   hwdata = callPackage ../os-specific/linux/hwdata { };
 
@@ -13865,7 +13863,7 @@ with pkgs;
         kernelPatches.cpu-cgroup-v2."4.11"
         kernelPatches.modinst_arg_list_too_long
       ]
-      ++ lib.optionals ((platform.kernelArch or null) == "mips")
+      ++ lib.optionals ((stdenv.hostPlatform.platform.kernelArch or null) == "mips")
       [ kernelPatches.mips_fpureg_emu
         kernelPatches.mips_fpu_sigill
         kernelPatches.mips_ext3_n32
diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix
index 5b802aea075..06978d1067b 100644
--- a/pkgs/top-level/stage.nix
+++ b/pkgs/top-level/stage.nix
@@ -82,11 +82,8 @@ let
   platformCompat = self: super: let
     inherit (super.stdenv) buildPlatform hostPlatform targetPlatform;
   in {
-    stdenv = super.stdenv // {
-      inherit (super.stdenv.buildPlatform) platform;
-    };
     inherit buildPlatform hostPlatform targetPlatform;
-    inherit (buildPlatform) system platform;
+    inherit (buildPlatform) system;
   };
 
   splice = self: super: import ./splice.nix lib self (buildPackages != null);