Hacker News new | ask | show | jobs
by lambdaba 391 days ago
I think Nix has a marketing issue as it goes so deep. But if you're going to consider it only as an alternative to homebrew, you don't have to know anything aside from different CLI invocations: `nix-shell -iA <package>` to install, and maybe a step up with `nix-shell -p <package> --run <cmd>` to run without installing. You don't have to use nix-darwin or managing configs and the Nix language at all.
2 comments

That’s still more to remember than `x install y`, which might sound trivial but that’s the exact kind of friction that impedes adoption.

Maybe it would make sense for nix to add a mode that basically aliases that first command to `nix install <package>`.

Yeah, I'm just addressing you specifically, you could switch easily and Nix has a much larger package selection (outside of GUI apps on macOS). And it immediately can do more via nix-shell -p, which can be also be used as shebang.

But yeah, Nix is much more than a homebrew replacement and that has its downsides.

Nix may have a larger selection, but I sampled a few of the projects I install from homebrew and...

1. Did't actually exist

2. Outdated version

3. Incorrect build

I'll keep the quality of Homebrew packages over the quantity in Nix

I'm curious of what the packages are because I only have ~10 packages that I use from homebrew, either very Mac-specific or that have better packaging (ffmpeg, mpv)
They are all projects that distribute Go binaries on GitHub and have official homebrew taps

The 2/3 that are on nix are both out of date and created by some outside party.

I do not see a world where I provide nix stuff for my projects. There are already too many packages managers and I'm not spending my unpaid time to support all of them. GitHub and brew are my limit, def not learning nix just for this

Not going to list them all, but...

@M4MBP ~ % brew list | wc -l

149

Some/many of those are likely to be dependencies. For example, it shows openssl@1.1 and openssl@3 on my machine
That's essentially what Devbox does for you as a package manager, a hand wrapper around nix for using nix just for its package ecosystem.
Oh yeah, I knew about devbox but hadn't seen (perhaps it's new) that it can handle global packages: https://www.jetify.com/docs/devbox/devbox_global/
I tried nix a few times in the past and it has too many issues on Mac (never got it working), also the learning curve is too steep, maybe I'll give it a try again.
An easy option nowadays is Determinate Nix https://docs.determinate.systems/determinate-nix/
So, an "easy" "better" option is:

- worse ux (nix commands are much more cumbersome and often make no sense compared to `brew install`)

- you have to use some third-party wrappers to make it work on Mac

- features incomplete and outdated packages (and is missing others apparently https://news.ycombinator.com/item?id=44034446)

... but it "does the job better than anything else could".

---

This is the issue I have with the whole nix discourse: it's hailed as this great magical tool. But when pressed for details it's always this: weird commands, configs, working or non-working wrappers etc.

This is just from my experience, I'm not part of any kind of Nix cult or anything, not that I'm aware of.

I don't know what you're talking about re: third party wrappers, this is just an option for a slightly easier and perhaps more robust install. And homebrew isn't free of issues at all.

So a "better than anything" still needs "a better more robust install" and you still use homebrew for "packages that are packaged better like ... the extremely popular and often installed ffmpeg"

;)

> And homebrew isn't free of issues at all.

No one advertises brew as "the best", "better than everything else" etc.

BTW, looked at Determinate Nix. It's a custom distribution and a custom daemon, and its own fork of documentation

I don't use Determinate Nix but I've heard it recommended. As I've said I've had 1 or 2 issues with my Nix install on Mac over several years.

Re: ffmpeg, it's just something do to with default codecs or something I don't remember, I'm not even sure I really needed it but I saw it on my packages list and since I use nix-darwin it doesn't matter that much where the package comes from. I have hundreds of packages from nixpkgs, many shared with Linux, and quite a few Mac specific ones.

Again, I'm not part of a Nix cult, I just genuinely have had an overall great experience with Nix and I find the criticism overblown. I guess since a subset of users are very enthusiastic and vocal about it it attracts this.