background grid image
Image for post nix-darwin-updates
Feb 19, 2025 by Luc Perkins

Determinate is now directly compatible with nix-darwin

Here at Determinate Systems, we strive to provide first-class support for Nix on macOS. To that end, we’ve built a graphical Nix installer for macOS, worked to make Nix on macOS more resistant to upgrade-related breakages, and more.

We also strive to meet Nix users where they are whenever possible. Because nix-darwin has emerged as the ecosystem’s preferred tool for system configuration management on macOS, we want Determinate to work as smoothly as possible with it.

When we first released Determinate, we required nix-darwin users to add a special nix-darwin module to their configuration, essentially as a compatibility shim. Today, we’re happy to announce that this nix-darwin module is no longer necessary.

What’s changed

nix-darwin was originally built to take full control over your Nix installation and configuration, without a way to opt-out of that control. The problem is that Determinate also wants to manage and configure Nix. Determinate’s nix-darwin module was basically a compatibility shim to handle this problem. Well, we don’t like compatibility shims around here and we decided to provide a better long-term solution.

So we enlisted Emily from the nix-darwin project, who was incredibly gracious with her time and effort, to introduce an opt-out mechanism. She added a nix.enable option to nix-darwin in pull requests #1313 (for those tracking nix-darwin’s master branch) and #1326 (for those tracking nix-darwin’s 24.11 release branch). Now, if you set nix.enable to false, nix-darwin refrains from managing:

  • The installed version of Nix
  • The nix-daemon launch daemon
  • The Nix configuration settings in /etc/nix/nix.conf

Would you like access to private flakes and FlakeHub Cache?

Sign up for FlakeHub

What you should change

If you’re currently using Determinate but not nix-darwin, you can start using nix-darwin at any time. Just make sure to set nix.enable = false at the top level of your nix-darwin configuration.

If you’re currently using Determinate with the determinate module for nix-darwin, follow these steps:

  • Upgrade both the determinate and the nix-darwin input in your configuration using nix flake update.
  • Run darwin-rebuild for your configuration. This should fail.
  • After that fails, set nix.enable = false; and remove the Determinate nix-darwin module from your configuration.
  • If you have Nix configuration you’re currently setting with nix-darwin, add that to the /etc/nix/nix.custom.conf configuration file instead.

And that’s it! Nix is now managed by Determinate, while nix-darwin handles your macOS system configuration.

nix-darwin release compatibility

In terms of nix-darwin release compatibility, this approach works on both the 24.11 release branch as well as the rolling master branch.

If you’re not yet using Determinate on macOS, you can get started now:

Logo for graphical installer

Install Determinate Nix on macOS now

Apple Silicon and Intel

Implications

Letting Determinate manage Nix while letting nix-darwin manage macOS system configuration plays much better to the strengths of both tools. And beyond the benefit to Determinate users, providing nix-darwin users with an opt-out switch like this means that other tools and platforms are also free to manage Nix on macOS. More configurability, after all, is the Nix way.


Share
Avatar for Luc Perkins
Written by Luc Perkins

Luc is a technical writer, software engineer, and Nix advocate who's always on the lookout for qualitatively better ways of building software. He originally hails from the Pacific Northwest but has recently taken to living abroad.

Would you like access to private flakes and FlakeHub Cache?

Sign up for FlakeHub