diff --git a/pkgs/by-name/un/unicorn/package.nix b/pkgs/by-name/un/unicorn/package.nix index 54d524e33ff8..156ca182d110 100644 --- a/pkgs/by-name/un/unicorn/package.nix +++ b/pkgs/by-name/un/unicorn/package.nix @@ -26,8 +26,10 @@ stdenv.mkDerivation (finalAttrs: { cctools ]; - # Ensure the linker is using atomic when compiling for RISC-V, otherwise fails - NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isRiscV "-latomic"; + env = lib.optionalAttrs stdenv.hostPlatform.isRiscV { + # Ensure the linker is using atomic when compiling for RISC-V, otherwise fails + NIX_LDFLAGS = "-latomic"; + }; cmakeFlags = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ # Some x86 tests are interrupted by signal 10