I have a working Nix flake that I use to have a Rust dev environment for Linux, but doesn't work with Mac. If I run cargo install rustlings I get compile errors like:
= note: ld: framework not found CoreServices
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
and like:
= note: ld: framework not found CoreServices
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
š” There are some mac-specific (and darwin) libraries that need to be present it would seem.
My working Rust nix.flake
I'm sure it could be leaner (I'm working off my Linux flake that I used for a project):
The Mac specific lines I had to add were:
and
I use direnv so I have a .envrc file in the same folder that simply looks like:
and then run direnv allow
Every time you cd into the folder, it runs the nix.flake and you have your Rust environment!