Merge pull request #209816 from Artturin/deprecate-top-level-platform-aliases

Artturi 27c1ec2e b326f62d

Changed files
+40 -54
nixos
modules
programs
services
tests
pkgs
applications
blockchains
zcash
editors
emacs
misc
HentaiAtHome
science
logic
cedille
video
davinci-resolve
losslesscut-bin
build-support
flutter
rust
build-rust-crate
development
haskell-modules
libraries
science
math
tensorflow-lite
python-modules
rfcat
games
BeatSaberModManager
misc
os-specific
darwin
test
cross
tools
compression
top-level
+2 -2
nixos/modules/programs/steam.nix
···
type = types.package;
default = pkgs.steam.override {
extraLibraries = pkgs: with config.hardware.opengl;
-
if pkgs.hostPlatform.is64bit
+
if pkgs.stdenv.hostPlatform.is64bit
then [ package ] ++ extraPackages
else [ package32 ] ++ extraPackages32;
};
defaultText = literalExpression ''
pkgs.steam.override {
extraLibraries = pkgs: with config.hardware.opengl;
-
if pkgs.hostPlatform.is64bit
+
if pkgs.stdenv.hostPlatform.is64bit
then [ package ] ++ extraPackages
else [ package32 ] ++ extraPackages32;
}
+3 -3
nixos/modules/services/misc/nix-daemon.nix
···
system-features = mkDefault (
[ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++
-
optionals (pkgs.hostPlatform ? gcc.arch) (
+
optionals (pkgs.stdenv.hostPlatform ? gcc.arch) (
# a builder can run code for `gcc.arch` and inferior architectures
-
[ "gccarch-${pkgs.hostPlatform.gcc.arch}" ] ++
-
map (x: "gccarch-${x}") (systems.architectures.inferiors.${pkgs.hostPlatform.gcc.arch} or [])
+
[ "gccarch-${pkgs.stdenv.hostPlatform.gcc.arch}" ] ++
+
map (x: "gccarch-${x}") (systems.architectures.inferiors.${pkgs.stdenv.hostPlatform.gcc.arch} or [])
)
);
}
+1 -1
nixos/tests/libvirtd.nix
···
};
testScript = let
-
nixosInstallISO = (import ../release.nix {}).iso_minimal.${pkgs.hostPlatform.system};
+
nixosInstallISO = (import ../release.nix {}).iso_minimal.${pkgs.stdenv.hostPlatform.system};
virshShutdownCmd = if pkgs.stdenv.isx86_64 then "shutdown" else "destroy";
in ''
start_all()
+2 -2
pkgs/applications/blockchains/zcash/default.nix
···
{ autoreconfHook, boost180, cargo, coreutils, curl, cxx-rs, db62, fetchFromGitHub
-
, hexdump, hostPlatform, lib, libevent, libsodium, makeWrapper, rust, rustPlatform
+
, hexdump, lib, libevent, libsodium, makeWrapper, rust, rustPlatform
, pkg-config, Security, stdenv, testers, utf8cpp, util-linux, zcash, zeromq
}:
···
license = licenses.mit;
# https://github.com/zcash/zcash/issues/4405
-
broken = hostPlatform.isAarch64 && hostPlatform.isDarwin;
+
broken = stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isDarwin;
};
}
+1 -1
pkgs/applications/editors/emacs/generic.nix
···
, alsa-lib, cairo, acl, gpm, m17n_lib, libotf
, sigtool, jansson, harfbuzz, sqlite, nixosTests
, recurseIntoAttrs, emacsPackagesFor
-
, libgccjit, targetPlatform, makeWrapper # native-comp params
+
, libgccjit, makeWrapper # native-comp params
, fetchFromSavannah, fetchFromBitbucket
# macOS dependencies for NS and macPort
+1 -2
pkgs/applications/misc/HentaiAtHome/default.nix
···
{ buildPackages
-
, buildPlatform
, fetchzip
, javaOpts ? "-XX:+UseZGC"
, jdk
···
nativeBuildInputs = [ jdk makeWrapper ];
LANG = "en_US.UTF-8";
-
LOCALE_ARCHIVE = lib.optionalString (buildPlatform.libc == "glibc")
+
LOCALE_ARCHIVE = lib.optionalString (stdenvNoCC.buildPlatform.libc == "glibc")
"${buildPackages.glibcLocales}/lib/locale/locale-archive";
buildPhase = ''
+1 -2
pkgs/applications/science/logic/cedille/default.nix
···
, alex
, happy
, Agda
-
, buildPlatform
, buildPackages
, ghcWithPackages
}:
···
LANG = "en_US.UTF-8";
LOCALE_ARCHIVE =
-
lib.optionalString (buildPlatform.libc == "glibc")
+
lib.optionalString (stdenv.buildPlatform.libc == "glibc")
"${buildPackages.glibcLocales}/lib/locale/locale-archive";
postPatch = ''
+1 -2
pkgs/applications/video/davinci-resolve/default.nix
···
, cacert
, curl
, runCommandLocal
-
, targetPlatform
, unzip
, appimage-run
, addOpenGLRunpath
···
SITEURL = "https://www.blackmagicdesign.com/api/register/us/download/${DOWNLOADID}";
USERAGENT = builtins.concatStringsSep " " [
-
"User-Agent: Mozilla/5.0 (X11; Linux ${targetPlatform.linuxArch})"
+
"User-Agent: Mozilla/5.0 (X11; Linux ${stdenv.targetPlatform.linuxArch})"
"AppleWebKit/537.36 (KHTML, like Gecko)"
"Chrome/77.0.3865.75"
"Safari/537.36"
+4 -4
pkgs/applications/video/losslesscut-bin/default.nix
···
{ lib
+
, stdenv
, callPackage
, buildPackages
-
, hostPlatform
}:
let
···
};
in
(
-
if hostPlatform.system == "aarch64-darwin" then aarch64-dmg
-
else if hostPlatform.isDarwin then x86_64-dmg
-
else if hostPlatform.isCygwin then x86_64-windows
+
if stdenv.hostPlatform.system == "aarch64-darwin" then aarch64-dmg
+
else if stdenv.hostPlatform.isDarwin then x86_64-dmg
+
else if stdenv.hostPlatform.isCygwin then x86_64-windows
else x86_64-appimage
).overrideAttrs
(oldAttrs: {
+1 -2
pkgs/build-support/flutter/default.nix
···
, git
, dart
, nukeReferences
-
, targetPlatform
, bash
, curl
, unzip
···
self =
(self: llvmPackages_13.stdenv.mkDerivation (args // {
deps = stdenvNoCC.mkDerivation (lib.recursiveUpdate (getAttrsOrNull fetchAttrs args) {
-
name = "${self.name}-deps-flutter-v${flutter.unwrapped.version}-${targetPlatform.system}.tar.gz";
+
name = "${self.name}-deps-flutter-v${flutter.unwrapped.version}-${stdenvNoCC.targetPlatform.system}.tar.gz";
nativeBuildInputs = flutterDeps ++ [
nukeReferences
+3 -3
pkgs/build-support/rust/build-rust-crate/test/brotli-crates.nix
···
-
{ lib, buildPlatform, buildRustCrate, fetchgit }:
-
let kernel = buildPlatform.parsed.kernel.name;
-
abi = buildPlatform.parsed.abi.name;
+
{ lib, stdenv, buildRustCrate, fetchgit }:
+
let kernel = stdenv.buildPlatform.parsed.kernel.name;
+
abi = stdenv.buildPlatform.parsed.abi.name;
include = includedFiles: src: builtins.filterSource (path: type:
lib.lists.any (f:
let p = toString (src + ("/" + f)); in
+1 -1
pkgs/development/haskell-modules/configuration-common.nix
···
#
# # Depends on itself for testing
# doctest-discover = addBuildTool super.doctest-discover
-
# (if pkgs.buildPlatform != pkgs.hostPlatform
+
# (if pkgs.stdenv.buildPlatform != pkgs.stdenv.hostPlatform
# then self.buildHaskellPackages.doctest-discover
# else dontCheck super.doctest-discover);
doctest-discover = dontCheck super.doctest-discover;
+1 -2
pkgs/development/libraries/science/math/tensorflow-lite/default.nix
···
, fetchpatch
, fetchurl
, flatbuffers
-
, hostPlatform
, lib
, zlib
}:
···
mkdir "$out"
# copy the static lib and binaries into the output dir
-
cp -r ./tensorflow/lite/tools/make/gen/linux_${hostPlatform.uname.processor}/{bin,lib} "$out"
+
cp -r ./tensorflow/lite/tools/make/gen/linux_${stdenv.hostPlatform.uname.processor}/{bin,lib} "$out"
find ./tensorflow/lite -type f -name '*.h' | while read f; do
path="$out/include/''${f/.\//}"
+2 -2
pkgs/development/python-modules/rfcat/default.nix
···
{ lib
+
, stdenv
, buildPythonPackage
, fetchFromGitHub
, future
···
, numpy
, pyserial
, pyusb
-
, hostPlatform
, pytestCheckHook
, pythonOlder
}:
···
pyusb
];
-
postInstall = lib.optionalString hostPlatform.isLinux ''
+
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
mkdir -p $out/etc/udev/rules.d
cp etc/udev/rules.d/20-rfcat.rules $out/etc/udev/rules.d
'';
+2 -2
pkgs/games/BeatSaberModManager/default.nix
···
{
lib,
dotnet-sdk,
-
targetPlatform,
+
stdenv,
substituteAll,
buildDotnetModule,
···
patches = [
(substituteAll {
src = ./add-runtime-identifier.patch;
-
runtimeIdentifier = dotnetCorePackages.systemToDotnetRid targetPlatform.system;
+
runtimeIdentifier = dotnetCorePackages.systemToDotnetRid stdenv.targetPlatform.system;
})
];
+1 -2
pkgs/misc/dxvk/default.nix
···
{ lib
, pkgs
-
, hostPlatform
, stdenvNoCC
, fetchFromGitHub
, pkgsCross
···
stdenvNoCC.mkDerivation (finalAttrs:
let
-
inherit (hostPlatform.uname) system;
+
inherit (stdenvNoCC.hostPlatform.uname) system;
# DXVK needs to be a separate derivation because it’s actually a set of DLLs for Windows that
# needs to be built with a cross-compiler.
dxvk32 = pkgsCross.mingw32.callPackage ./dxvk.nix {
+3 -3
pkgs/os-specific/darwin/xcode/default.nix
···
-
{ buildPlatform, requireFile, targetPlatform, lib }:
+
{ stdenv, requireFile, lib }:
let requireXcode = version: sha256:
let
xip = "Xcode_" + version + ".xip";
# TODO(alexfmpe): Find out how to validate the .xip signature in Linux
-
unxip = if buildPlatform.isDarwin
+
unxip = if stdenv.buildPlatform.isDarwin
then ''
open -W ${xip}
rm -rf ${xip}
···
xcode_12_1 = requireXcode "12.1" "1widy74dk43wx8iqgd7arzf6q4kzdmaz8pfwymzs8chnq9dqr3wp";
xcode_12_2 = requireXcode "12.2" "17i0wf4pwrxwfgjw7rpw9mcd59nkmys1k5h2rqsw81snzyxy9j0v";
xcode_12_3 = requireXcode "12.3" "0kwf1y4llysf1p0nsbqyzccn7d77my0ldagr5fi3by4k0xy3d189";
-
xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if (targetPlatform ? xcodeVer) then targetPlatform.xcodeVer else "12.3")}";
+
xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if (stdenv.targetPlatform ? xcodeVer) then stdenv.targetPlatform.xcodeVer else "12.3")}";
})
+5 -5
pkgs/os-specific/darwin/xcode/sdk-pkgs.nix
···
-
{ targetPlatform
+
{ stdenv
, clang-unwrapped
, binutils-unwrapped
, runCommand
···
let
-
minSdkVersion = targetPlatform.minSdkVersion or "9.0";
+
minSdkVersion = stdenv.targetPlatform.minSdkVersion or "9.0";
in
···
type = "derivation";
outPath = xcode + "/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}${version}.sdk";
-
platform = targetPlatform.xcodePlatform;
-
version = targetPlatform.sdkVer;
+
platform = stdenv.targetPlatform.xcodePlatform;
+
version = stdenv.targetPlatform.sdkVer;
};
binutils = wrapBintoolsWith {
···
extraBuildCommands = ''
tr '\n' ' ' < $out/nix-support/cc-cflags > cc-cflags.tmp
mv cc-cflags.tmp $out/nix-support/cc-cflags
-
echo "-target ${targetPlatform.config}" >> $out/nix-support/cc-cflags
+
echo "-target ${stdenv.targetPlatform.config}" >> $out/nix-support/cc-cflags
echo "-isystem ${sdk}/usr/include${lib.optionalString (lib.versionAtLeast "10" sdk.version) " -isystem ${sdk}/usr/include/c++/4.2.1/ -stdlib=libstdc++"}" >> $out/nix-support/cc-cflags
${lib.optionalString (lib.versionAtLeast sdk.version "14") "echo -isystem ${xcode}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 >> $out/nix-support/cc-cflags"}
'';
+2 -2
pkgs/test/cross/default.nix
···
) lib.systems.examples;
getExecutable = pkgs: pkgFun: exec:
-
"${pkgFun pkgs}${exec}${pkgs.hostPlatform.extensions.executable}";
+
"${pkgFun pkgs}${exec}${pkgs.stdenv.hostPlatform.extensions.executable}";
compareTest = { emulator, pkgFun, hostPkgs, crossPkgs, exec, args ? [] }: let
pkgName = (pkgFun hostPkgs).name;
···
mapMultiPlatformTest = crossSystemFun: test: lib.mapAttrs (name: system: test rec {
crossPkgs = import pkgs.path {
-
localSystem = { inherit (pkgs.hostPlatform) config; };
+
localSystem = { inherit (pkgs.stdenv.hostPlatform) config; };
crossSystem = crossSystemFun system;
};
+2 -2
pkgs/tools/compression/zfp/default.nix
···
-
{ cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, python3Packages, stdenv, targetPlatform
+
{ cmake, cudatoolkit, fetchFromGitHub, gfortran, lib, llvmPackages, python3Packages, stdenv
, enableCfp ? true
, enableCuda ? false
-
, enableFortran ? builtins.elem targetPlatform.system gfortran.meta.platforms
+
, enableFortran ? builtins.elem stdenv.targetPlatform.system gfortran.meta.platforms
, enableOpenMP ? true
, enablePython ? true
, enableUtilities ? true }:
+1
pkgs/top-level/aliases.nix
···
zyn-fusion = zynaddsubfx; # Added 2022-08-05
inherit (stdenv.hostPlatform) system; # Added 2021-10-22
+
inherit (stdenv) buildPlatform hostPlatform targetPlatform; # Added 2023-01-09
# LLVM packages for (integration) testing that should not be used inside Nixpkgs:
llvmPackages_git = recurseIntoAttrs (callPackage ../development/compilers/llvm/git {
-9
pkgs/top-level/stage.nix
···
inherit stdenv;
};
-
# The old identifiers for cross-compiling. These should eventually be removed,
-
# and the packages that rely on them refactored accordingly.
-
platformCompat = self: super: let
-
inherit (super.stdenv) buildPlatform hostPlatform targetPlatform;
-
in {
-
inherit buildPlatform hostPlatform targetPlatform;
-
};
-
splice = self: super: import ./splice.nix lib self (adjacentPackages != null);
allPackages = self: super:
···
# previous bootstrapping phases which have already been overlayed.
toFix = lib.foldl' (lib.flip lib.extends) (self: {}) ([
stdenvBootstappingAndPlatforms
-
platformCompat
stdenvAdapters
trivialBuilders
splice