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"
```
This commit is contained in:
Artturin
2024-09-25 00:04:37 +03:00
parent aaa7fb5840
commit e0464e4788
4283 changed files with 8137 additions and 8137 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ buildLuarocksPackage {
luarocksConfig.variables.LUA_LIBDIR = "${lua}/lib";
nativeBuildInputs = [ pkg-config ];
buildInputs = lib.optionals stdenv.isDarwin [ AppKit ];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ AppKit ];
postInstall = ''
find $out -name nfd_zenity.so -execdir mv {} nfd.so \;
+5 -5
View File
@@ -461,7 +461,7 @@ in
];
});
luasystem = prev.luasystem.overrideAttrs (oa: lib.optionalAttrs stdenv.isLinux {
luasystem = prev.luasystem.overrideAttrs (oa: lib.optionalAttrs stdenv.hostPlatform.isLinux {
buildInputs = [ glibc.out ];
});
@@ -503,7 +503,7 @@ in
# ld: symbol(s) not found for architecture arm64
# clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
meta.broken = stdenv.isDarwin;
meta.broken = stdenv.hostPlatform.isDarwin;
});
lush-nvim = prev.lush-nvim.overrideAttrs (drv: {
@@ -644,7 +644,7 @@ in
buildInputs = [ libuv final.lua ];
nativeBuildInputs = [ pkg-config cmake ]
++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ];
};
luv = prev.luv.overrideAttrs (oa: {
@@ -785,7 +785,7 @@ in
});
sqlite = prev.sqlite.overrideAttrs (drv: {
doCheck = stdenv.isLinux;
doCheck = stdenv.hostPlatform.isLinux;
nativeCheckInputs = [ final.plenary-nvim neovim-unwrapped ];
# the plugin loads the library from either the LIBSQLITE env
@@ -835,7 +835,7 @@ in
hash = "sha256-PLihirhJshcUQI3L1eTcnQiZvocDl29eQHhdBwJQRU8=";
};
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin
(if lua.pkgs.isLuaJIT then "-lluajit-${lua.luaversion}" else "-llua");
nativeBuildInputs = oa.nativeBuildInputs ++ [