23 comments

[ 3.3 ms ] story [ 54.1 ms ] thread
Nix is downright awful on MacOS, even with the DetSys installer. Almost worse than Homebrew.

If you ever sit down to play with a native NixOS install, the difference in functionality is night-and-day.

Care to elaborate on what you've found most painful? Since `nix-darwin` is anything but officially supported, I am expecting trouble, but it would be nice to know if there are specific things I should look out for.

I'd love to use NixOS itself, of course, but it's not a native option on this machine due to the missing M4 support in Asahi. For now, I'm trying to see how much package/configuration management discipline I can reclaim on macOS, and familiarize myself with Nix in the process.

I could have just used a set of Ansible scripts and Homebrew, but that didn't seem quite as interesting as trying Nix out.

> Homebrew's filesystem permission handling is controversial, to say the least, and it has a tendency to fail at a package manager's main job: ensuring that new dependencies don't break the system.

Homebrew user from day 1 it appeared. I have many many packages installed on multiple actively used systems and I have never had to deal with any kind of breakage.

What is this myth? Yeah yeah I am just one data point ...

>The macOS package management story is not great.

Ummm... Homebrew has been around for at least a decade.

For the same reasons, I prefer Linux - but also like Apple Silicon platform. As a result, I use Fedora Asahi Remix natively on the hardware. It's a few generations behind in support (M1- and M2-based systems right now), but I can't tell you how good it feels to be able to use Linux natively on Apple Silicon hardware. In my workflow, Fedora Asahi Remix runs at least twice as fast as macOS on the same hardware for any task (and 4-6 times faster for heavier tasks).
[deleted… my disagreements about time allocation aside, there’s no reason to argue on the internet about it]
I wouldn't try to make macOS into Arch, if Arch is what works for you.

Just run Arch in a VM on the mac, using Apple's virtualization framework [1]. (No need for other wrappers; the framework is often easier to use directly.) I find no significant performance issues; a lot of software actually runs faster in a Linux VM than when I compile and run it on the mac.

The limitations are that the Linux VM's don't support save/restore of state (i.e., you have to shut down to stop the VM) and the graphics and device support is limited.

You might get more performance if you compile your own Arch distribution with all the flags necessary to enjoy modern CPU features in M-series (particularly M4+ with SME extensions). With M4-Pro memory should run 273GB/second for JAX and PyTorch.

However, AFAICT, PyTorch supports vectorization on Apple silicon by delegating to Apple's Metal API's, and that wouldn't be available from the Linux VM, so you might prefer running those on macOS directly.

To me the biggest draw of the M4 processor is that it supports CPU tracing (at least for Xcode-run code): actual, direct (not sampled) data about CPU internals like branching, cache misses, etc. If you're into performance, this will take you from working with a black box to seeing exactly what's up.

[1] https://developer.apple.com/documentation/Virtualization/run...

My homebrew story is always something along the lines of:

Me: Please install software A.

Homebrew: In order to install it I will also install 20 libraries (some need to be built from source), update openssl, update Python and wreck all virtual environments. Also since its been a while I decided it must be time to upgrade your other unrelated packages. Enjoy!

Those apple chips are really quite impressive. But, AMD has those fancy APUs now, maybe it is possible to stay in x86 land a bit longer?
(comment deleted)
I use macOS for day-to-day work on a laptop, but all serious business is conducted on Linux workstations. I can’t be bothered with Docker et al, so each workstation is configured for one special set of tools, and nothing else. Updates are tightly controlled, to avoid breaking build configurations.

In the long run, hardware is cheaper than your time.

thats cool been to mila before, anyway OP we need to get CachyOS on Mac Os immidiately
This couldn't have come at a more opportune time. My 11th gen Framework just gave up the magic smoke last night, which was a frightening experience.

The Framework has given me a bewildering litany of issues over the years, and I now just want something solid, light, and reasonable battery life, so just I threw down for an M4 Air today.

Having used Linux exclusively for 25 years and an unaBashed CLI junkie, I'm a bit nervous about workflow friction.

How does experience with nixos-darwin compare against just VMing on top of MacOS?

Also, is there any reason for mucking about with Apple's bootloader etc?

As someone who’s been a heavy apple daily driver since the Intel Macs arrived on the scene, I can feel myself grinding my teeth while reading this. Watching Apple commit to eroding macOS’s previously-lauded user-centric freedom, simplicity, and reliability year after year in their quest to turn it into another iOS black box appliance that you just rent not own makes me wonder what happens when the author approaches similar categories of problems from different directions vis a vis Linux.
I enjoyed reading the post and maybe will try following some part of it, such as the nix-darwin setup. Thanks for sharing, it is well written.

I have used Arch in a couple of personal laptops during a handful of years and macOS at job for the last year. I love using Arch, even though it is sometimes painful qua drivers and issues with non-essential hardware. In macOS I don’t recall having issues with homebrew, however I am more familiar with pacman on Arch and therefore prefer it. Before starting to use it, I set up alacritty on macOS building it from source.

I'd stick to Linux/KDE.
It's interesting and all but in typical "Apple switcher" fashion, a preposterous comparison is/will be made: the M4 Pro MBP is around 3K€, replacing a laptop that seems to go for around 1K€ at best.

When something costs 3 times as much, it should be better. It's a bit like comparing an entry level Ford to an S class Mercedes.

I think the best "feature" of Apple computers is that it prevents cheapskates from making bad choices they will regret.

In my family, they use iPhones and I'm glad for it because if they would use Androids, they would just buy the cheapest garbage they could find and the experience would be miserable. It's funny how a corporation greed is actually useful to prevent some people being fucked by their own greed (stinginess is a form of reverse greed, particularly true when you actually have money).

> quite impressed with the smoothness of the UX on this relatively cheap machine.

I recently tried installing cachyos kernel on fedora I tried sched_ext with it (scx_lavd specifically) and to my suprise changing CPU scheduler resolved all UI stuttering for me (even dual 360hz + laptop screen on 3y old laptop with integrated intel gpu)

I occasionally use M1 apple mini and right now I can confidently say that now my Linux machine works smoother.

I don't really understand the comparison with a cheap Asus laptop. Ofcourse the MBP will win. But a decent Lenovo ThinkPad or HP EliteBook/ZBook will have flawless Linux support with a rigid and robust chassis.
I know this won’t apply to everyone but I’ve been able to, relatively successfully, stick to the constraint that most of my dev tools are static binaries: zoxide, fzf, eza, btop and so on. There is one glaring exception which is docker but I let it pass.

By sticking to this I’m able to avoid Homebrew’s mess and Nix’s complexity. I use mise (https://mise.jdx.dev/) to manage the binaries and languages I have on my machine. It handles installing multiple versions and is directory-aware.

For some time after the introduction of the M1 CPU Macbooks provided the best battery life experience. So it would make sense to use a Macbook if you wanted your laptop to work more than 4-5 hours unplugged. But now Intel Core Ultra series 2 and AMD Strix Point laptops are almost as good. Sure you won't get 20 hours of battery life, but you get about 10-15 hours and it's already good enough. Performance of Intel/AMD CPUs are also good enough: about M2 performance-wise. Sure they are a couple of generations behind Apple, but for most tasks it doesn't matter. Linux compatibility is also getting there. You can choose a Thinkpad if you want to be sure that Linux runs on it. But even many consumer-grade laptops are supported but Linux thanks to recent kernel updates. Essentially what I'm saying is that if you want a good laptop experience and you like Linux, you don't have to settle for Macbook anymore.