Simple workable config for M1 Macbook Pro Monterey 12.0.1 with nix, flakes, nix-darwin and home-manager

Hi there,

I was looking for a recent how-to with a few bells a whistles to setup nix-darwin with home-manager with flakes on my new M1 Macbook Pro and ended up doing a small gist, with code heavily inspired from the awesome GitHub - malob/nixpkgs: My Nix system configs!

The other walk throughs I found seem to have some workarounds that aren’t needed anymore, so the installation is actually pretty simple.

I included things in the config that I know I end up needing all the time, like overlays that are available in home-manager, including x86 version of packages that don’t build on Apple Silicon yet and a few things I didn’t know I needed yet (like nix-index and touch ID for sudo, straight from @malob’s repo!).

I tried to minimise the number of files, which means I inlined some patches in the flake.nix which can be removed when the corresponding PRs are merged upstream. For a more thorough and modular setup (including dealing with multiple machines and a neat primaryUser trick) refer to GitHub - malob/nixpkgs: My Nix system configs!

Here is the gist and hope it helps Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro · GitHub

Merry Christmas :christmas_tree:

Jun

3 Likes

And if you have the patience and want to see and hear me blabbering about this config then check out this youtube video: Setting up nix-darwin home-manager and flakes on M1 Macbook Pro OSX Monterey 12.0.1 - YouTube (which should be done processing shortly).

2 Likes
Hosted by Flying Circus.