nix: fix usage of isLinux, isDarwin

`stdenv.{isLinux,isDarwin}` are deprecated on newer versions of
`nixpkgs`.
This commit is contained in:
Riccardo Mazzarini authored and Philip Metzger committed 2026-08-27 18:42:08 +00:00
1 parent 69eb1455e2
commit b93845b2bb
2 files changed
+11 -7

No files matched your search

+2 -2
View File
@@ -42,7 +42,7 @@ in
[
installShellFiles
]
++ lib.optionals stdenv.isLinux [
++ lib.optionals stdenv.hostPlatform.isLinux [
mold
];
buildInputs = [];
@@ -58,7 +58,7 @@ in
env = {
RUST_BACKTRACE = 1;
CARGO_INCREMENTAL = "0"; # https://github.com/rust-lang/rust/issues/139110
RUSTFLAGS = lib.optionalString stdenv.isLinux "-C link-arg=-fuse-ld=mold";
RUSTFLAGS = lib.optionalString stdenv.hostPlatform.isLinux "-C link-arg=-fuse-ld=mold";
NIX_JJ_GIT_HASH = gitRev;
};
+9 -5
View File
@@ -53,9 +53,13 @@
# But, whenever we are running CI builds or checks, we want to use a
# smaller closure. This reduces the CI impact on fresh clones/VMs, etc.
rustMinimalPlatform =
let platform = pkgs.rust-bin.selectLatestNightlyWith (t: t.minimal);
in pkgs.makeRustPlatform { rustc = platform; cargo = platform; };
rustMinimalPlatform = let
platform = pkgs.rust-bin.selectLatestNightlyWith (t: t.minimal);
in
pkgs.makeRustPlatform {
rustc = platform;
cargo = platform;
};
in {
formatter = pkgs.alejandra;
@@ -111,9 +115,9 @@
# efficient than the defaults. these noticeably improve link time even for
# medium sized rust projects like jj
rustLinkerFlags =
if pkgs.stdenv.isLinux
if pkgs.stdenv.hostPlatform.isLinux
then ["-fuse-ld=mold" "-Wl,--compress-debug-sections=zstd"]
else if pkgs.stdenv.isDarwin
else if pkgs.stdenv.hostPlatform.isDarwin
then
# on darwin, /usr/bin/ld actually looks at the environment variable
# $DEVELOPER_DIR, which is set by the nix stdenv, and if set,