mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 18:42:15 +00:00
Merge pull request #45403 from obsidiansystems/purge-bare-platform
treewide: Purge `stdenv.platform` and top-level `platform`
This commit is contained in:
commit
70a0c15054
|
@ -28,7 +28,7 @@ with lib;
|
||||||
++ (if pkgs.stdenv.system == "aarch64-linux"
|
++ (if pkgs.stdenv.system == "aarch64-linux"
|
||||||
then []
|
then []
|
||||||
else [ pkgs.grub2 pkgs.syslinux ]);
|
else [ pkgs.grub2 pkgs.syslinux ]);
|
||||||
system.boot.loader.kernelFile = pkgs.stdenv.platform.kernelTarget;
|
system.boot.loader.kernelFile = pkgs.stdenv.hostPlatform.platform.kernelTarget;
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ fsType = "tmpfs";
|
{ fsType = "tmpfs";
|
||||||
|
@ -86,7 +86,7 @@ with lib;
|
||||||
|
|
||||||
system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
|
system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
|
||||||
#!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
|
initrd initrd
|
||||||
boot
|
boot
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -13,7 +13,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
# Temporary check, for nixos to cope both with nixpkgs stdenv-updates and trunk
|
# Temporary check, for nixos to cope both with nixpkgs stdenv-updates and trunk
|
||||||
platform = pkgs.stdenv.platform;
|
inherit (pkgs.stdenv.hostPlatform) platform;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ let
|
||||||
inherit configTxt;
|
inherit configTxt;
|
||||||
};
|
};
|
||||||
|
|
||||||
platform = pkgs.stdenv.platform;
|
inherit (pkgs.stdenv.hostPlatform) platform;
|
||||||
|
|
||||||
builderUboot = import ./builder_uboot.nix { inherit config; inherit pkgs; inherit configTxt; };
|
builderUboot = import ./builder_uboot.nix { inherit config; inherit pkgs; inherit configTxt; };
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ let
|
||||||
in
|
in
|
||||||
tarball //
|
tarball //
|
||||||
{ meta = {
|
{ 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;
|
maintainers = map (x: lib.maintainers.${x}) maintainers;
|
||||||
};
|
};
|
||||||
inherit config;
|
inherit config;
|
||||||
|
@ -106,7 +106,7 @@ let
|
||||||
let
|
let
|
||||||
configEvaled = import lib/eval-config.nix config;
|
configEvaled = import lib/eval-config.nix config;
|
||||||
build = configEvaled.config.system.build;
|
build = configEvaled.config.system.build;
|
||||||
kernelTarget = configEvaled.pkgs.stdenv.platform.kernelTarget;
|
kernelTarget = configEvaled.pkgs.stdenv.hostPlatform.platform.kernelTarget;
|
||||||
in
|
in
|
||||||
pkgs.symlinkJoin {
|
pkgs.symlinkJoin {
|
||||||
name = "netboot";
|
name = "netboot";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ pkgs
|
{ pkgs
|
||||||
, kernel ? pkgs.linux
|
, kernel ? pkgs.linux
|
||||||
, img ? pkgs.stdenv.platform.kernelTarget
|
, img ? pkgs.stdenv.hostPlatform.platform.kernelTarget
|
||||||
, storeDir ? builtins.storeDir
|
, storeDir ? builtins.storeDir
|
||||||
, rootModules ?
|
, rootModules ?
|
||||||
[ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ]
|
[ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ]
|
||||||
|
|
|
@ -61,7 +61,8 @@ stdenv.mkDerivation rec {
|
||||||
**
|
**
|
||||||
** Ideally in the future this would be less of a hack and could be
|
** 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
|
** 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 = ''
|
postInstall = ''
|
||||||
m="$(ls ./work/boot)"
|
m="$(ls ./work/boot)"
|
||||||
|
|
|
@ -6,7 +6,7 @@ let
|
||||||
arch = if stdenv.isAarch32
|
arch = if stdenv.isAarch32
|
||||||
then (if stdenv.is64bit then "arm64" else "arm")
|
then (if stdenv.is64bit then "arm64" else "arm")
|
||||||
else (if stdenv.is64bit then "x64" else "ia32");
|
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
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
|
args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
|
||||||
, texinfo, glibcCross, hurdPartedCross, libuuid, samba
|
, texinfo, glibcCross, hurdPartedCross, libuuid, samba
|
||||||
, gccCrossStageStatic, gcc
|
, gccCrossStageStatic, gcc
|
||||||
, pkgsi686Linux, newScope, platform, config
|
, pkgsi686Linux, newScope, config
|
||||||
, targetPlatform, buildPlatform
|
, targetPlatform, buildPlatform
|
||||||
, overrides ? {}
|
, overrides ? {}
|
||||||
, buildPackages, pkgs
|
, buildPackages, pkgs
|
||||||
|
|
|
@ -22,7 +22,7 @@ ${optionalString (versionAtLeast version "4.10") ''
|
||||||
BUG_ON_DATA_CORRUPTION y
|
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
|
DEFAULT_MMAP_MIN_ADDR 65536 # Prevent allocation of first 64K of memory
|
||||||
|
|
||||||
# Reduce attack surface by disabling various emulations
|
# Reduce attack surface by disabling various emulations
|
||||||
|
|
|
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
|
||||||
buildInputs = [ nukeReferences ];
|
buildInputs = [ nukeReferences ];
|
||||||
|
|
||||||
makeFlags = concatStringsSep " " [
|
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.
|
"KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" # Makefile uses $(uname -r); breaks us.
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -13742,9 +13742,7 @@ with pkgs;
|
||||||
nmon = callPackage ../os-specific/linux/nmon { };
|
nmon = callPackage ../os-specific/linux/nmon { };
|
||||||
|
|
||||||
# GNU/Hurd core packages.
|
# GNU/Hurd core packages.
|
||||||
gnu = recurseIntoAttrs (callPackage ../os-specific/gnu {
|
gnu = recurseIntoAttrs (callPackage ../os-specific/gnu { });
|
||||||
inherit platform;
|
|
||||||
});
|
|
||||||
|
|
||||||
hwdata = callPackage ../os-specific/linux/hwdata { };
|
hwdata = callPackage ../os-specific/linux/hwdata { };
|
||||||
|
|
||||||
|
@ -13865,7 +13863,7 @@ with pkgs;
|
||||||
kernelPatches.cpu-cgroup-v2."4.11"
|
kernelPatches.cpu-cgroup-v2."4.11"
|
||||||
kernelPatches.modinst_arg_list_too_long
|
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_fpureg_emu
|
||||||
kernelPatches.mips_fpu_sigill
|
kernelPatches.mips_fpu_sigill
|
||||||
kernelPatches.mips_ext3_n32
|
kernelPatches.mips_ext3_n32
|
||||||
|
|
|
@ -82,11 +82,8 @@ let
|
||||||
platformCompat = self: super: let
|
platformCompat = self: super: let
|
||||||
inherit (super.stdenv) buildPlatform hostPlatform targetPlatform;
|
inherit (super.stdenv) buildPlatform hostPlatform targetPlatform;
|
||||||
in {
|
in {
|
||||||
stdenv = super.stdenv // {
|
|
||||||
inherit (super.stdenv.buildPlatform) platform;
|
|
||||||
};
|
|
||||||
inherit buildPlatform hostPlatform targetPlatform;
|
inherit buildPlatform hostPlatform targetPlatform;
|
||||||
inherit (buildPlatform) system platform;
|
inherit (buildPlatform) system;
|
||||||
};
|
};
|
||||||
|
|
||||||
splice = self: super: import ./splice.nix lib self (buildPackages != null);
|
splice = self: super: import ./splice.nix lib self (buildPackages != null);
|
||||||
|
|
Loading…
Reference in a new issue