Debug symbols on Darwin

I am working on a project which uses Nix to provide development environments and dependencies for clients. Support for both Linux and macOS is required.

After having jumped through hoops to get debugging symbols included (via an overlay) in nixpkgs.geant4 on Linux, I’m drawing a blank on how to get them on Darwin.

How should I go about getting debug symbols for a Nix-built Geant4 on Darwin?


  • The nature of geant4 and its typical users dictate that debug symbols be available out of the box for users of our project.
  • nixpkgs.geant4 has an optional dependency on qt; both are built with cmake and qt sets cmakeBuildType, overriding whatever value might be given in geant4. Hence the need to hack around it (which I managed by setting NIX_CFLAGS_COMPILE in my Geant4 overlay).
  • I haven’t used macOS myself since 2009, and do not have access to a machine running macOS, beyond GHA runners and the like, so I’m struggling to reconcile information I find about dSYM, dsymutil and the like, and the build process on Nix-darwin.