From e0464e47880a69896f0fb1810f00e0de469f770a Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 24 Sep 2024 18:50:49 +0300 Subject: treewide: replace `stdenv.is` with `stdenv.hostPlatform.is` In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ``` --- pkgs/by-name/pt/pterm/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/by-name/pt') diff --git a/pkgs/by-name/pt/pterm/package.nix b/pkgs/by-name/pt/pterm/package.nix index c0d96e44f124a..463a05ac06978 100644 --- a/pkgs/by-name/pt/pterm/package.nix +++ b/pkgs/by-name/pt/pterm/package.nix @@ -43,6 +43,6 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ sarcasticadmin ]; mainProgram = "pterm"; platforms = platforms.unix; - broken = stdenv.isDarwin; + broken = stdenv.hostPlatform.isDarwin; }; } -- cgit 1.4.1