Nix shell, rust, darwin system libraries

Hey,
sorry for the vague title. I’m not really sure where the actual issue it?

I wanted to try out tauri, which is a rust thing to build (cross platform) apps

I googled around and ended up with a shell.nix that looks like this:

{ pkgs ? import <nixpkgs> {} }:
  pkgs.mkShell {

    buildInputs = with pkgs; [ rustc cargo rustfmt rustPackages.clippy nodejs-14_x ] ++ (
       stdenv.lib.optionals stdenv.isDarwin [
         pkgs.darwin.apple_sdk.frameworks.Security
         pkgs.darwin.apple_sdk.frameworks.CoreServices
         pkgs.darwin.apple_sdk.frameworks.CoreFoundation
         pkgs.darwin.apple_sdk.frameworks.Foundation
         pkgs.darwin.apple_sdk.frameworks.AppKit
         pkgs.darwin.apple_sdk.frameworks.WebKit
         pkgs.darwin.apple_sdk.frameworks.Cocoa
       ]
    );
}

(this is probably wrong^)

and got a hello world app to build and run. I thought that was pretty cool.

Then I sent it to someone, and they got:

Dyld Error Message:
  dyld: Using shared cache: 467A83CB-BA86-3F07-B652-B9256C74080A
Library not loaded: /nix/*/libc++.1.0.dylib
  Referenced from: /Volumes/*/beepboop_0.1.0_x64.app/Contents/MacOS/beepboop
  Reason: image not found

This isn’t really my area of expertise, but yeah, it linked some dynamic libraries in /nix instead of whatever place macOS puts them.

Is this something I try to fix in my nix env, or in rust/cargo, or ?

@laduke did you manage to make it work for you?