darwin.moltenvk: fix the eval on linux

Without the change the eval fails as:

    $ nix eval --impure --expr 'with import ./. { system = "x86_64-linux"; }; darwin.moltenvk.NIX_CFLAGS_COMPILE'
    error:
       … in the condition of the assert statement
         at pkgs/stdenv/generic/make-derivation.nix:716:11:
          715|           n: v:
          716|           assert assertMsg (isString v || isBool v || isInt v || isDerivation v)
             |           ^
          717|             "The `env` attribute set can only contain derivation, string, boolean or integer attributes. The `${n}` attribute is of type ${builtins.typeOf v}.";

       … in the left operand of the OR (||) operator
         at lib/asserts.nix:39:31:
           38|   # TODO(Profpatsch): add tests that check stderr
           39|   assertMsg = pred: msg: pred || builtins.throw msg;
             |                               ^
           40|

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: expected a set but found null: null
This commit is contained in:
Sergei Trofimovich 2025-04-22 06:35:32 +01:00
parent c230266380
commit 77dc1fefc5

View file

@ -101,8 +101,8 @@ stdenv.mkDerivation (finalAttrs: {
'';
env.NIX_CFLAGS_COMPILE = toString (
[
"-isystem ${lib.getInclude stdenv.cc.libcxx}/include/c++/v1"
lib.optional (stdenv.cc.libcxx != null) "-isystem ${lib.getInclude stdenv.cc.libcxx}/include/c++/v1"
++ [
"-I${lib.getDev spirv-cross}/include/spirv_cross"
"-I${lib.getDev spirv-headers}/include/spirv/unified1"