Help needed installing NixOs on Macbook Pro 2019

I’m currently stuck with installing NixOs on a MacBook which I bought for a project last year (and now is just collecting dust). I’ve been following rather traditional installation, using Part 1 - Installing NixOs - as guide. Fwiw, I’m installing a UEFI boot using LVM encrypted partition.

It’s only during the last part of the installation, after calling sudo nixos-install which strange errors start to appear. I’m using the latest 20.3 image, on top of which I use the latest nixos-unstable channel (due to unrelated issue with texlive install-info).

When this error occurs, I’m unable to go back with ctrl-c, it loops and stays forever. I tried adding kernel flags, using clues from nixos-hardware repo, but nothing works it seems.

Here’s a screenshot of this loop of death:

Some of the text in case the screenshot is unclear:

invalid opcode: 0000 [#1] SMP NOPTI
CPU: 2 PID: 11295 Comm: kworker/u32:15 Tainted: P   W O  5.4.95 #1-NixOS
Hardware name: Apple Inc. MacBookPro15,1/Mac-937A206...
Workerqueue: efi_rts_wq efi_call_rts
RIP: 0010:0xfff....
Call Trace:
? __switch_to_asm0x40/0x70

p.s. made a video, which shows nixos-install up until the error, nixos-install bug - YouTube

Solved(almost): Following the hardware configuration from dotgiles/hardware-configuration.nix at master · gilescope/dotgiles · GitHub I was able to bypass this error and build successfully. Albeit not able to boot the EFI partition (but it does appear as option).

For the future person who reads this.

For single boot, use

but with a twist, don’t use /boot/efi just /boot, that extra efi is probably dual boot.

  boot.loader = {
	  grub = {
		  device = "nodev";
		  gfxmodeEfi = "1024x768";
		  efiSupport = true;
		  efiInstallAsRemovable = true;
	  efi.efiSysMountPoint = "/boot";
	  efi.canTouchEfiVariables = false;
  boot.kernelPackages = pkgs.linuxPackages_latest;

Congratulations that you solved the issue. You could share knowledge in for future Nixers that would get stuck.


Will do. Getting nixos to run is only the start of the battle of getting the hardware to work. nixos-hardware would be a good place to collaborate on this task.