tpwrules / nixos-apple-silicon

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

extraConfig use does not align with nixpkgs #106

Closed RossComputerGuy closed 8 months ago

RossComputerGuy commented 9 months ago

According to the documentation listed on search.nixos.org, the extraConfig option in boot.kernelPatches is a direct CONFIG_* line. nixos-apple-silicon adds in CONFIG_ as shown here. This will cause issues when the required config is checked.

Example

Fails asserts due to a required config check:

  boot.kernelPatches = [{
    name = "waydroid";
    patch = null;
    extraConfig = ''
      ANDROID_BINDER_IPC y
      ANDROID_BINDERFS y
      ANDROID_BINDER_DEVICES binder,hwbinder,vndbinder
      ASHMEM y
    '';
  }];

Evaluates but does not function properly:

  boot.kernelPatches = [{
    name = "waydroid";
    patch = null;
    extraConfig = ''
      CONFIG_ANDROID_BINDER_IPC y
      CONFIG_ANDROID_BINDERFS y
      CONFIG_ANDROID_BINDER_DEVICES binder,hwbinder,vndbinder
      CONFIG_ASHMEM y
    '';
  }];

Works:

  boot.kernelPatches = [{
    name = "waydroid";
    patch = null;
    extraConfig = ''
      ANDROID_BINDER_IPC y
      ANDROID_BINDERFS y
      ANDROID_BINDER_DEVICES binder,hwbinder,vndbinder
      CONFIG_ASHMEM y
      CONFIG_ANDROID_BINDERFS y
      CONFIG_ANDROID_BINDER_IPC y
    '';
  }];
tpwrules commented 9 months ago

I am fairly certain the documentation is buggy there. For instance, in nixpkgs itself, CONFIG_ is not included when writing stuff in extraConfig. This is what I assumed and what the wiki says too.

What exact assertion is failing? Maybe that assertion is also incorrect, or there is a bug between that line you point to (which is correct and necessary to make the proper .config) and the assertion.

RossComputerGuy commented 9 months ago
error:
       Failed assertions:
       - CONFIG_ANDROID_BINDER_IPC is not enabled!
       - CONFIG_ANDROID_BINDERFS is not enabled!
       - CONFIG_ASHMEM is not enabled!
tpwrules commented 8 months ago

This has been fixed. The documentation is wrong and there was also a bug in nixos-apple-silicon.