Adding macOS target to Brave browser

Hi all, I’m a new Nix user and I’m interested in adding a Darwin/macOS target for the Brave derivation. I’ve read through the Nix manual and I’m making my way through the Nix pills, but I’m not 100% sure where to begin.

My most pressing question is whether it’s even possible to use Nix to build Brave. My understanding is that, for the time being, the project avoids using Xcode for portability reasons, whereas Brave requires Xcode to build on macOS.

Can anyone confirm that this would be a blocker? Also, are there plans to integrate with Xcode?

The macvim package uses Xcode to build. This is of course impure and won’t work under sandboxing, but if you’re ok with that, you can explicitly break the impurity by doing what macvim does and symlinking in the relevant paths.

They appear to distribute a .dmg

And the package is already from a binary, so I’d assume we’d just use that over a source build.
This is what we’ve done for the wire expression

which is a similar binary multi-platform situation.

@lilyball, thank you for the tip about macvim.

@worldofpeace, that makes sense. I wasn’t aware that nixpkgs allows binary sources. What about mixed source/binary builds? Would having a source build for Linux and copying the upstream distributed binary for MacOS be acceptable?

Totally, we’re a bit lax about binary sources because it can be hard to build certain things from source in nix. We even have a setup hook to automatically patch binaries to it’s pretty convenient.

Any source build would be greatly appreciated :+1: