Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Honestly, doing that may be easier and a better option than using Nix packages in MacOS.

Respectfully, I disagree. I’ve been using Nix on a couple of my Macs, including on an M1, and I’ve cutdown my dependence on homebrew almost to the point of its absence; I rely more on Nix packages, than on Homebrew packages.

Having said that, I still wouldn’t recommend anyone using Nix; steep learning curve, and too many rough edges.



> I still wouldn’t recommend anyone using Nix; steep learning curve, and too many rough edges.

I'd like to think there are roughly two camps of people:

Those who hear about Nix's declarative nature, with its reproducible/'pure' nature, and generational installation, all of which allow for some pretty neat UX. To this group, Nix sounds technically interesting.

The other group, those who want a tool that just works, that's simple to use, and already get their job done with other package managers. -- I think for this group, Nix is going to be a bad tool to recommend, even if they keep hearing about how neat Nix is.

Rather. Nix is wonderful 95% of the time. But the 5% of the time you run into some problem, it's much more difficult to get unstuck compared to other tools. (Other knowledge is necessary but not sufficient, the community is small so maybe harder to find a StackOverflow post, the documentation is fragmented, etc.).


I have exactly same problem using Nix package manager in Ubuntu. That's why for those other 5% you can usr usehomebrew or whatever other package manager you have in your system.

I am not sure what is the story of having NixOS as a server, but would not suggest to have it as a main OS. There a sometime cases when there are simply no package you want to install, or you install it but some functionality doesn't work. Yes, maybe one can fix/patch, but I simply fall back to apt-get in such cases, and don't spend my time on that. Usually I have problems like this with GUI application, ie: installed pdf editor, which can open pdf, but can highliting functionality doesn't work and the crashes.


> I am not sure what is the story of having NixOS as a server, but would not suggest to have it as a main OS

This was what I thought when I was learning nix. Once I used NixOS, I realised it's not quite that difficult. -- The two big differences: 1. Roughly, you only really need to care about the NixOS config about as frequently as you'd change system files in /etc/ in other Linux distributions. 2. Some programs (e.g. minikube) will download a binary automatically, and this doesn't work well with NixOS.

I've seen tools like distrobox https://github.com/89luca89/distrobox recommended as backups on NixOS, as well as the usual Docker / VMs.

I secretly suspect some of the reason NixOS is popular is it's less trouble than nix on non-NixOS. Whereas, nix on macOS, I've sometimes mixed compilers/libraries, which leads to difficult to discern problems.


Yeah, I switched completely to nix after being frustrated with homebrew constantly breaking things (any time I installed something. (Usually involving libicu being replaced with a different version.) And then had to pick up homebrew again for a couple of things.

I _really_ like being able to drop into a shell with a few additional packages installed. But nix does have a learning curve and some rough edges. I found it tricky to use things like libraries outside of nix's build process. And there is a bit of an impedance mismatch when trying to use languages that have their own package management.

So I've got nix for a bunch of software, a couple of libraries in homebrew, and native package management for various languages (cargo, ghcup, lake, idris).

I also reluctantly installed agda via homebrew because I can't get it to build. (Haskell mostly works on M1).


MacPorts is a better alternative to Homebrew, I never had any problems with it.


The only time things break for me because something is replaced by homebrew is because c/c++ projects seem to so overly rely on dependencies (headers, .a files, etc.) being installed by the os globally. Maybe this is better when the project uses Bazel instead of make/(auto)configure.


I switched to Nix because, unlike Homebrew, it does not include silent Google spyware.


Homebrew includes Google Spyware? Do you have a source? That's a huge opsec issue.


Homebrew puts a unique identifier on your system that phones home to Google with your unchanging unique ID and IP address every time you install a package.

Because client IP is coarse geolocation, this unique tracking ID allows Google to see your travel history.



Nix is one of those rocket-powered chainsaw tools that you run into, and while it still scares me (and I often worry about accidentally cutting off a limb), it's much nicer to use than Homebrew. The only caviat is that your Nix store can get enormously huge, which is a big problem on Apple devices where storage comes at a premium.


I would naively expect that if you run garbage collection on a regular basis that it should take no more space. Is that not true, or is running it on a regular basis the sticking bit?


I suppose you could, but Nix (and NixOS) defaults to keeping packages for an insane amount of time. 3 months of regular Nix use can accrue ~300gb of packages, which is definitely not what you'd have on something like Homebrew.


By default don't they keep old generations (and thus previously-installed packages) literally forever?


Does nix and NixOS ever run the GC for you? I’ve always found that I have to manually run it at a time and place of my choosing.


Check out the option 'nix.gc.automatic'. It's set to false by default.


Can't you just run nix-collect-garbage?


I recently had tried to use Nix again after a hiatus. I wished to use Nix to replace Homebrew, but also for managing versions, of like Ruby or dotnet.

Sadly, it's not quite there for my needs, but it's getting better. Flakes are more fleshed out, the CLI is improving in it's user experience. I still don't feel like I understand the language works and build my flakes off of copying/pasting the one that works.


> I’ve cutdown my dependence on homebrew almost to the point of its absence

What are the advantages of that?


I use Nix for the advantages it provides, and use other package managers (homebrew, etc.) for things that are not available in nixpkgs.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: