Hacker News new | ask | show | jobs
by Ericson2314 2044 days ago
I wonder if Nix on macOS could become a better homebrew-killer by supporting Apple Silicon first. We already do aarch64-linux natively and some iOS cross compilation, so that should give us a head start.
6 comments

I was using gentoo-prefix for the longest time on MacOS.

I never got why homebrew got so popular given how terrible it is. But it was more accessible to people unfortunately. I spent some time trying to become a Gentoo developer for a while and then just gave up because there was no response.

I used to updated the clang patches to make newer clang versions compile things on osx before most of those things made it upstream.

I think it's vastly superior to macports and while I find nix interesting I don't really find it that practical. I think what makes homebrew more popular than the rest is how many precompiled packages exist. If gentoo-prefix had the same amount of precompiled packages, then I'd think it would definitely be much better for most users.

[1] https://wiki.gentoo.org/wiki/Project:Prefix

[2] https://github.com/fishman/timebomb-gentoo-osx-overlay

Which aspects of Nix would you say are "not practical"?
I wonder if the impressive compile times coming out of M1 will make pre-built binaries less important?
Related issue[0].

I moved over from Homebrew to Nix around 5 months ago, haven't since needed to use Homebrew except for casks.

[0] "Support for Apple Silicon (aarch64-darwin)" https://github.com/NixOS/nixpkgs/issues/95903

It can replace casks too, as mac apps can also be packaged in Nix.
Where can I find out how to do this?
Installing a package is enough. For example, if you install the emacs package, Emacs.app would be available in ~/.nix-profile/Applications/Emacs.app.

If you want to launch apps you've installed with Nix using Lanchpad or Spotlight, you can use nix-darwin[1] or home-manager[2] to create a symlink in ~/Applications, though the latter seems to have temporarily disabled this feature due to conflicts between the two.

[1]: https://github.com/LnL7/nix-darwin/blob/master/modules/syste... [2]: https://github.com/nix-community/home-manager/blob/master/mo...

> Installing a package is enough. For example, if you install the emacs package, Emacs.app would be available in ~/.nix-profile/Applications/Emacs.app.

Right. I'm using home-manager on darwin and various apps like Emacs, Alacritty, Kitty are supported. However, many GUI apps are not, such as Firefox, so that's why I'm still using Homebrew's cask.

I'm glad I'm not the only one hating homebrew. It's become very anti-user in the past few years under the new maintainers. Even the original maintainer has said publicly that he doesn't like the direction the new maintainers took homebrew. All the changes the current maintainers of homebrew have made have been in the direction of "make maintaining homebrew easier so we get less questions" without any thought to the user experience those changes cause.
> without any thought to the user experience those changes cause.

Sorry you get that impression. As one of the maintainers, my impression is that each decision happens in good faith, and usually follows a controversial discussion, which puts user experience on par with maintainers’s well-being.

Examples off the top of my head:

[1]: https://github.com/Homebrew/brew/pull/9172#issuecomment-7299...

[2]: https://github.com/Homebrew/brew/issues/9177#issuecomment-72...

[3]: https://github.com/Homebrew/brew/issues/9099#issuecomment-72...

That’s not to say your feelings aren’t valid. I can see how some unpopular decisions may come across as rude, thoughtless or selfish. I’m aware that this is still a huge issue, and my feeling is that we still have a lot to learn in order to get better and more transparent at communicating.

I’m thankful for feedback like yours (even though I strongly disagree with the part that I’ve quoted). You can be sure any such feedback has a real, positive impact on where we’re heading as a project.

It's comments like this one that cause these feelings : https://github.com/Homebrew/brew/issues/7857#issuecomment-65...
macports is a better homebrew-killer IMHO. Follows MacOS guidelines and frameworks, integrates with the MacOS way in terms of launch agents etc.
I gave up on homebrew and switched to macports after having to change directory permissions one time too many.
Macports doesn’t install for me with no error messages.
That's very odd. Did you try to run the installer from a terminal to check if it says something?
What we need is a cross platform package manager that installs stuff in the same place and make stuff behave the same, so shell configs can be unified between OS and not have "if" all over and expect same environments.

nix is almost that, except some packages are too old but otherwise, I have it running identically on macOS and Linux.

Homebrew puts stuff in some weird location that is /home/linuxbrew/.linuxbrew/ on Linux and that alone puts me off and it breaks if I change that location. No idea why they don't just use a path like /opt/homebrew/ for both OS and be done with it.

> No idea why they don't just use a path like /opt/homebrew/ for both OS and be done with it.

We’re now using `/opt/homebrew` for the (still experimental) ARM native Homebrew flavour.

On Linux, you’re free to choose whatever prefix you like. On Linux, Homebrew always builds from source, no matter the prefix.

And especially it follows common Unix traditions - packages are installed in a system wide way without permission fuck-ups.
Nix also runs and integrates with macOS too. Does macports do something that Nix doesn’t?
Over here I’m dying to port ArchMac to aarch64, which should be reasonably quick... if I had access to Apple Silicon hardware.

Being a lonely maintainer means I’m a bit (a lot) late on package versions and some areas are hacking, but it works on Big Sur already. But then again I’m also most probably the sole user and only target audience given the popularity of alternatives.

I recently began using Nix as such on my current MBP - I'm a big fan!