From 6f1a2c5f0e8274223d4204b1f8d6f7f91538967e Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Sun, 7 Jun 2026 18:16:46 +0200 Subject: [PATCH] Use `RUSTFLAGS` instead of `CARGO_BUILD_RUSTFLAGS` in dev shell `CARGO_BUILD_RUSTFLAGS` has a very low precedence and is overruled by global `target..rustflags`. Since these rustflags are very important, ensure that they have a higher precedence. We could even go for `CARGO_ENCODED_RUSTFLAGS` which has the highest precedence, but is slightly annoying to construct and probably not worth it. --- flake.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 0700075d..b3dd0cdf 100644 --- a/flake.nix +++ b/flake.nix @@ -139,8 +139,8 @@ ''; env = { - # Force linking with libEGL and libwayland-client - # so they can be discovered by `dlopen()` + # Force linking with libEGL and libwayland-client so they end up in RPATH and + # can be discovered by `dlopen()` RUSTFLAGS = toString ( map (arg: "-C link-arg=" + arg) [ "-Wl,--push-state,--no-as-needed" @@ -225,8 +225,8 @@ # It is required for `dlopen()` to work on some libraries; see the comment # in the package expression # - # This should only be set with `CARGO_BUILD_RUSTFLAGS="$CARGO_BUILD_RUSTFLAGS -C your-flags"` - CARGO_BUILD_RUSTFLAGS = niri.RUSTFLAGS; + # This should only be set with `RUSTFLAGS="$RUSTFLAGS -C your-flags"` + RUSTFLAGS = niri.RUSTFLAGS; }; }; }