How to run buildRustCrate tests on darwin?

Working on rust debug symbols on darwin, I noted that the buildRustCrate tests have some relevant tests that are conditionally only run on darwin: nixpkgs/pkgs/build-support/rust/build-rust-crate/test/default.nix at bed9309adc836ddea35a5923fdca425d23002abf · NixOS/nixpkgs · GitHub

I know how to run nixosTests on linux, but how am I supposed to run these package tests on darwin?

It makes it look as simple as nix-build -A buildRustCrate.tests

$ cd $nixpkgs
$ nix build .#buildRustCrate.tests
error: flake 'git+file:///Users/n8henrie/git/nixpkgs' does not provide attribute 'packages.aarch64-darwin.buildRustCrate.tests', 'legacyPackages.aarch64-darwin.buildRustCrate.tests' or 'buildRustCrate.tests'
$ nix build .#buildRustCrate.test
error: flake 'git+file:///Users/n8henrie/git/nixpkgs' does not provide attribute 'packages.aarch64-darwin.buildRustCrate.test', 'legacyPackages.aarch64-darwin.buildRustCrate.test' or 'buildRustCrate.test'
$ nix build .#buildRustCrate.passthru.test
error: flake 'git+file:///Users/n8henrie/git/nixpkgs' does not provide attribute 'packages.aarch64-darwin.buildRustCrate.passthru.test', 'legacyPackages.aarch64-darwin.buildRustCrate.passthru.test' or 'buildRustCrate.pa
ssthru.test'
$ nix build .#buildRustCrate.passthru.tests
error: flake 'git+file:///Users/n8henrie/git/nixpkgs' does not provide attribute 'packages.aarch64-darwin.buildRustCrate.passthru.tests', 'legacyPackages.aarch64-darwin.buildRustCrate.passthru.tests' or 'buildRustCrate.
passthru.tests'
$
$ # okay, I guess new-style commands aren't going to work.
$ # someday I'll learn the old-style ones.
$
$ nix-build -A buildRustCrate.tests
error: the expression selected by the selection path 'buildRustCrate.tests' should be a set but is a function
$ nix-build -A buildRustCrate.test
error: the expression selected by the selection path 'buildRustCrate.tests' should be a set but is a function
$ nix-build -A buildRustCrate.passthru.test
error: the expression selected by the selection path 'buildRustCrate.passthru.test' should be a set but is a function
$ nix-build -A buildRustCrate.passthru.tests
error: the expression selected by the selection path 'buildRustCrate.passthru.tests' should be a set but is a function

The fact that gives me the same error I think means I’m not doing this right.

I can’t tab into any sub attribute (like .tests.foo).

I recognize the callPackage pattern…

$ nix eval .#buildRustCrate.passthru.test --apply .#callPackage
error: flake 'git+file:///Users/n8henrie/git/nixpkgs' does not provide attribute 'packages.aarch64-darwin.buildRustCrate.passthru.test', 'legacyPackages.aarch64-darwin.buildRustCrate.passthru.test' or 'buildRustCrate.pa
ssthru.test'
$ nix eval .#buildRustCrate.passthru.tests --apply .#callPackage
error: flake 'git+file:///Users/n8henrie/git/nixpkgs' does not provide attribute 'packages.aarch64-darwin.buildRustCrate.passthru.tests', 'legacyPackages.aarch64-darwin.buildRustCrate.passthru.tests' or 'buildRustCrate.
passthru.tests'
$ nix eval .#buildRustCrate.tests --apply .#callPackage
error: flake 'git+file:///Users/n8henrie/git/nixpkgs' does not provide attribute 'packages.aarch64-darwin.buildRustCrate.tests', 'legacyPackages.aarch64-darwin.buildRustCrate.tests' or 'buildRustCrate.tests'
$ nix eval .#buildRustCrate.test --apply .#callPackage
error: flake 'git+file:///Users/n8henrie/git/nixpkgs' does not provide attribute 'packages.aarch64-darwin.buildRustCrate.test', 'legacyPackages.aarch64-darwin.buildRustCrate.test' or 'buildRustCrate.test'

Huh. Back to trying to muddle through old-style commands:

$ nix-build -E 'with (import <nixpkgs> {}); callPackage buildRustCrate.test {}'
error:
       … while evaluating a branch condition

         at /nix/store/h5m0sr1l5cwqga83zfdm7qbbrnm1iill-source/lib/customisation.nix:263:8:

          262|
          263|     in if missingArgs == {}
             |        ^
          264|        then makeOverridable f allArgs

       … while calling the 'listToAttrs' builtin

         at /nix/store/h5m0sr1l5cwqga83zfdm7qbbrnm1iill-source/lib/attrsets.nix:647:5:

          646|     set:
          647|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |     ^
          648|

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

       error: attribute 'test' missing

       at «string»:1:41:

            1| with (import <nixpkgs> {}); callPackage buildRustCrate.test {}
             |                                         ^
$ nix-build -E 'with (import <nixpkgs> {}); callPackage buildRustCrate.passthru.test {}'
error:
       … while evaluating a branch condition

         at /nix/store/h5m0sr1l5cwqga83zfdm7qbbrnm1iill-source/lib/customisation.nix:263:8:

          262|
          263|     in if missingArgs == {}
             |        ^
          264|        then makeOverridable f allArgs

       … while calling the 'listToAttrs' builtin

         at /nix/store/h5m0sr1l5cwqga83zfdm7qbbrnm1iill-source/lib/attrsets.nix:647:5:

          646|     set:
          647|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |     ^
          648|

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

       error: attribute 'passthru' missing

       at «string»:1:41:

            1| with (import <nixpkgs> {}); callPackage buildRustCrate.passthru.test {}
             |                                         ^

¯\_(ツ)_/¯

Eventually…

$ nix-build -E '(import <nixpkgs> {}).callPackage ./pkgs/build-support/rust/build-rust-crate/test {}'
...
error: Package ‘lld-18.1.7’ in /nix/store/h5m0sr1l5cwqga83zfdm7qbbrnm1iill-source/pkgs/development/compilers/llvm/common/lld/default.nix:67 is not available on the requested hostPlatform:

I don’t even see lld in the arguments to the tests, so I can’t just callPackage ... { lld = ...; }. What am I supposed to do here?