Skip to content

Instantly share code, notes, and snippets.

@mjc
Last active April 29, 2026 20:53
Show Gist options
  • Select an option

  • Save mjc/d8d80d84c5c1a0a6ee1f561945ec59bf to your computer and use it in GitHub Desktop.

Select an option

Save mjc/d8d80d84c5c1a0a6ee1f561945ec59bf to your computer and use it in GitHub Desktop.
linux-m1 Apple Silicon NixOS install checklist

linux-m1 Apple Silicon NixOS install checklist

linux-m1 Apple Silicon NixOS install checklist

linux-m1 Apple Silicon NixOS install checklist

linux-m1 Apple Silicon NixOS install checklist

linux-m1 Apple Silicon NixOS install checklist

linux-m1 Apple Silicon NixOS install checklist

linux-m1 Apple Silicon NixOS install checklist

linux-m1 Apple Silicon NixOS install checklist

linux-m1 NixOS install checklist

Target: Apple Silicon MacBook Pro (mika-m1) with macOS kept in place and a separate Linux install named linux-m1.

Working log

  • 2026-04-29: Temporary Fedora Asahi Remix 44 install is in place.
  • 2026-04-29: OpenZFS zfs-2.4.1 is the source tree to use for Linux 6.19 on this machine.
  • Keep this section updated with commands that actually worked and any machine-specific deviations.
  • 2026-04-29: zfs-2.4.1 configures cleanly against 6.19.13-400.asahi.fc44.aarch64+16k, and OpenZFS META already lists Linux-Maximum: 6.19.
  • 2026-04-29: The module build for zfs-2.4.1 fails in module/zfs/vdev_raidz_math_aarch64_neon_common.h with invalid hard register usage between earlyclobber operand and input operand.
  • 2026-04-29: Current OpenZFS master fails with the same AArch64 NEON register allocation error.
  • 2026-04-29: nixpkgs zfs_2_4 and zfs_unstable both point at OpenZFS 2.4.1; pkgs/os-specific/linux/zfs/generic.nix carries no extra ZFS patches.
  • 2026-04-29: Btrfs is now the install path for the temporary Linux root; ZFS is deferred until there is a compiler-side fix.
  • 2026-04-29: The final NixOS host in the repo is now linux-m1, and it imports the Asahi support module from nix-community/nixos-apple-silicon.
  • 2026-04-29: The Btrfs layout is @, @home, and @nix; /nix is mounted with compress=zstd:15.
  • 2026-04-29: The repo now carries the linux-m1 host config instead of relying on the generated /mnt/etc/nixos tree.
  • 2026-04-29: sccache was deferred on linux-m1; the staging disk is too small to justify a persistent local compiler cache.
  • 2026-04-29: linux-m1 is being stripped down to the basics; cli-internet.nix, cli-media.nix, codex.nix, and mempalace-plugins.nix are excluded from the host for now.
  • 2026-04-29: sccache is staged in the linux-m1 NixOS config and the host sets RUSTC_WRAPPER=sccache for Rust builds.

Current state

  • 2026-04-29: Repo source of truth is /home/mjc/nixos; linux-m1 is the NixOS host and mika-m1 remains the Darwin host.
  • 2026-04-29: Temporary Fedora Asahi Remix 44 is the staging OS.
  • 2026-04-29: The Asahi UEFI environment was installed from macOS with the Asahi installer, choosing Install an OS into free space and UEFI environment only.
  • 2026-04-29: Final Linux storage is Btrfs, not APFS or ZFS.
  • 2026-04-29: Internal SSD layout: Asahi EFI partition at /dev/nvme0n1p8 mounted at /mnt/boot; final Btrfs root at /dev/nvme0n1p12.
  • 2026-04-29: Btrfs subvolumes are @ for /, @home for /home, and @nix for /nix.
  • 2026-04-29: Mount options are compress=zstd,noatime,space_cache=v2,discard=async for / and /home, and compress=zstd:15,noatime,space_cache=v2,discard=async for /nix.
  • 2026-04-29: OpenZFS 2.4.1 is the first release that advertises Linux 6.19; 2.4.0 tops out at 6.18, and 2.3.4 tops out at 6.16.
  • 2026-04-29: OpenZFS 2.4.1 and upstream master both fail on this Asahi GCC 15 toolchain with invalid hard register usage between earlyclobber operand and input operand in module/zfs/vdev_raidz_math_aarch64_neon_common.h.
  • 2026-04-29: nixpkgs zfs_2_4 and zfs_unstable both point at 2.4.1, and pkgs/os-specific/linux/zfs/generic.nix carries no extra ZFS patching.
  • 2026-04-29: The NixOS host config now lives in the repo and imports nix-community/nixos-apple-silicon; the live /mnt/etc/nixos tree is just the staging copy.
  • 2026-04-29: sccache was considered but deferred because the staging disk is only about 100 GB and the cache budget is too tight.

Goal

  • Keep macOS bootable.
  • Use the Asahi installer only to create the Apple Silicon UEFI boot environment.
  • Install NixOS alongside macOS without needing a USB stick.

What you need

  • A full backup.
  • Free space on the internal SSD for the Linux root partition.
  • The Asahi installer from macOS.
  • A temporary Linux environment on the same machine. The no-USB guide assumes Fedora Asahi Remix 44.

1. Prepare the Asahi UEFI environment from macOS

From macOS Terminal:

curl https://alx.sh | sh

Choose:

  • Resize macOS to leave enough free space for Linux.
  • Install an OS into free space
  • UEFI environment only

That step does not replace macOS. It creates the boot plumbing NixOS needs on Apple Silicon.

2. Install a temporary Linux system

Because you do not have a USB drive handy, use the Asahi installer again to place Fedora Asahi Remix 44 in the space you reserved.

The no-USB guide’s sequence is:

  • keep the UEFI environment you already created
  • install Fedora Asahi Remix into the free space
  • boot Fedora

This is a temporary staging OS. You will replace it with NixOS.

3. Install Nix on Fedora

On Fedora, install Nix for your normal user:

curl -L https://nixos.org/nix/install | sh
export PATH="$PATH:$HOME/.nix-profile/bin"

Then move to a NixOS channel and install the NixOS install tools:

nix-channel --add https://nixos.org/channels/nixos nixpkgs
nix-channel --update
nix-env -f '<nixpkgs>' -iA nixos-install-tools

If you are using flakes end to end, you can skip the channel setup and install the tools from your normal flake workflow. Do not overthink the Fedora side here: the important part is that the staging OS is Fedora Asahi Remix 44 with the Asahi kernel and kernel-16k-devel available.

3b. Use Btrfs for the staging root

Use Btrfs for the Linux root partition on the temporary Fedora install. Keep it simple:

sudo dnf install -y btrfs-progs

This is only for the Linux root filesystem. The Asahi-created EFI partition still handles the boot path on Apple Silicon.

Create the Linux root partition in the reserved space, then format it as Btrfs:

sudo mkfs.btrfs -L nixos /dev/nvme0n1p12

Mount it at /mnt, then create the subvolume layout you want to carry into NixOS:

sudo mount /dev/nvme0n1p12 /mnt
sudo btrfs subvolume create /mnt/@
sudo btrfs subvolume create /mnt/@home
sudo btrfs subvolume create /mnt/@nix
sudo umount /mnt

sudo mount -o subvol=@,compress=zstd,noatime,space_cache=v2,discard=async /dev/nvme0n1p12 /mnt
sudo mkdir -p /mnt/{home,nix,boot}
sudo mount -o subvol=@home,compress=zstd,noatime,space_cache=v2,discard=async /dev/nvme0n1p12 /mnt/home
sudo mount -o subvol=@nix,compress=zstd:15,noatime,space_cache=v2,discard=async /dev/nvme0n1p12 /mnt/nix

Mount the EFI partition created by Asahi at /mnt/boot:

sudo mount /dev/nvme0n1p8 /mnt/boot

If you do not know the partition UUID yet, get it from:

cat /proc/device-tree/chosen/asahi,efi-system-partition

4. Partition and mount

Follow the Apple Silicon guide carefully. The important parts are:

  • Do not touch the macOS recovery partitions or the existing GPT layout outside the free space.
  • Create a Linux root partition in the free space.
  • Format it as Btrfs.
  • Mount it at /mnt with the subvolume layout you want to keep.
  • Mount the EFI system partition created by the Asahi installer at /mnt/boot.
  • Do not create a second EFI partition; the Asahi installer already made the one NixOS should boot from.
  • On this machine, nvme0n1p12 is the final Btrfs partition and nvme0n1p8 is the Asahi EFI partition.

The guide uses the firmware-provided partition UUID from:

cat /proc/device-tree/chosen/asahi,efi-system-partition

5. Generate a temporary install config

From the Fedora shell:

sudo nixos-generate-config --root /mnt

Then add the Apple Silicon support module as the guide describes. The upstream layout is:

  • ./hardware-configuration.nix
  • ./apple-silicon-support

Also set:

boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = false;

6. Install NixOS

The no-USB guide uses:

sudo groupadd -g 30000 nixbld
sudo useradd -u 30000 -g nixbld -G nixbld nixbld
time sudo PATH="$PATH" ~/.nix-profile/bin/nixos-install -I ~/.nix-defexpr/channels --root /mnt

Set a root password when prompted.

7. First boot into NixOS

  • Reboot.
  • The bootloader should now present the NixOS generation.
  • Log in as root.
  • Verify networking and the desktop environment.

8. Switch to your flake

Once the installed system is up, switch from the temporary config to your real flake:

sudo nixos-rebuild switch --flake ~/cfg/nixos#linux-m1

That host is already scaffolded in your repo and is the Linux-side twin of mika-m1 on macOS.

9. Optional MAC override

If your router or DHCP setup still collides with macOS, pin a locally administered MAC in your Linux host config after you know the real interface names:

networking.interfaces.<iface>.macAddress = "02:11:22:33:44:55";

Use a 02:-prefixed address for a locally administered MAC.

10. macOS volume access from Linux

If you need to inspect files on the macOS APFS volumes from Fedora or NixOS, treat that as read-only by default.

Use APFS tools that mount read-only unless you have a very specific reason to experiment:

  • apfs-fuse for read-only access
  • experimental linux-apfs-rw if you are intentionally testing write support and accept corruption risk

Do not use APFS as the Linux root or staging filesystem.

Notes

  • macOS stays on the machine and remains bootable.
  • The Asahi installer is only the boot/UEFI bootstrap for Apple Silicon.
  • The Apple Silicon support module is still required for the Linux side.
  • ZFS is currently blocked by the AArch64 compiler path on this toolchain, so Btrfs is the practical staging filesystem.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment