tpwrules / nixos-apple-silicon

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

ZFS support? #111

Closed n8henrie closed 8 months ago

n8henrie commented 8 months ago

I was pleasantly surprised when I had no issue installing Asahi on a compressed BTRFS root, and since converting the install to nixos I've had zero issues!

I wanted to try enabling ZFS support (honestly because I have a busted zpool and no Linux computers with me to try to fix it), but adding it to boot.supportedFilesystems shows that it's currently broken:

error: Package ‘zfs-kernel-2.1.12-6.4.0-asahi’ in /nix/store/6s86padm2iikrwhlq8nwfv0lw9d1sbvq-source/pkgs/os-specific/linux/zfs/generic.nix:208 is marked as broken, refusing to evaluate.

Is there a known incompatibility between the asahi kernel and ZFS? Or perhaps a known-good revision that I can pin to and get this working?

tpwrules commented 8 months ago

ZFS has a tendency to be broken by the latest and greatest kernel releases, which Asahi is based on top of, which make it less likely to work. It's probable a somewhat older kernel version with modern nixpkgs will be needed for ZFS.

See also https://github.com/NixOS/nixpkgs/pull/237873 for some aarch64-specific issues you are probably encountering. There's not a lot Asahi-specific I can really do.

n8henrie commented 8 months ago

Thanks for your prompt response.

I used hydra-check to find the latest build for which zfsUnstable was building for aarch64-linux: https://hydra.nixos.org/build/238998379#tabs-summary

Unfortunately checking out 8dfad603247387df1df4826b8bea58efc5d012d8 and setting boot.zfs.removeLinuxDRM = true; still results in a build error due to being marked as broken.

I don't know nix or zfs well enough to fix things if I break them, so I'll let this be for now, but if I eventually get a working config I'll report back.

lloeki commented 6 months ago

ZFS has a tendency to be broken by the latest and greatest kernel releases, which Asahi is based on top of

With 23.11 Linux kernels 6.5 and 6.6 appear to be all around, while Asahi kernel (on my NixOS 23.11 install at least) appears to be 6.5, https://github.com/NixOS/nixpkgs/pull/237873 has been merged, and overall ZFS now appears to be OK?

@tpwrules Is there an opportunity to reevaluate?