tpwrules / nixos-apple-silicon

Resources to install NixOS bare metal on Apple Silicon Macs
MIT License
743 stars 73 forks source link

flake support and systemd-initrd #128

Closed mlyxshi closed 6 months ago

mlyxshi commented 6 months ago

flake users will fail to build asahi-peripheral-firmware

This PR add flake support and implement extract vendor firmware by systemd-initrd

Also, curl https://alx.sh | sh install UEFI + UBoot will install vendor firmware /Volumes/EFI - NIXOS/vendorfw/firmware.cpio. Therefore, I think we don't need ${asahi-fwextract}/bin/asahi-fwextract /tmp/.fwsetup/esp/asahi /tmp/.fwsetup/extracted again.

tpwrules commented 6 months ago

The problem here is that /Volumes/EFI - NIXOS/vendorfw/firmware.cpio can become out of date when asahi-fwextract gets upgraded. But so too can the all_firmware.tar.gz and the macOS stub partition. All three have happened so far.

My preferred solution would be to have a derivation download and extract the firmware from the Apple recovery image, but that's pretty gnarly and does not solve the third problem.

I'll have to think on accepting this for now. I'm not sure I like enabling systemd-initrd (need to research this more) or flakes by default in this PR.

cid-chan commented 6 months ago

I'd like to chip in: I think enabling systemd-initrd by default, if it is to be done, with some sort of announcement.

Enabling systemd-initrd broke my boot-process on M1 macs, as I had a snippet in my activation-script that required tty-access to enter a password. (I fixed it by switching to systemd-ask-password)

While I think only a tiny minority will have issues like that, it would be good to know that maybe some modification of their activation-scripts has to be done, to support systemd-initrd.