NixOS on Honor Magicbook 14 Pro - Intel 285H

Hello,
I am curious if anyone of you guys managed to run NixOS on the magicbook pro 14. I have tried, but can not bring the touchpad and keyboard to life. I have seen a long Fedora 42 thread and there is even a github repository (GitHub - colorcube/Linux-on-Honor-Magicbook-14-Pro: This repository keep a record of whatever needs to be done to make the Honor Magicbook 14 Pro laptop work with Linux.) for fixes and workarounds. But still no luck, tried the boot.kernelParameters i8042.dumbkbd=1.
As well, I am not sure how I can apply the mentioned patches. Currently I am on 6.17.9 unstable (26.05pre) branch, was hoping to get the latest drivers etc. - Tried with the kernelPatches and the mentioned diffs, which fail for me due to different file versions I guess.

Any hints? What is the right Nixos way to patch the kernel (how do I know which source files to use to create the patch, that will fit?)

Thanks a lot in advance!

Basically, if just someone is searching for this as well:

SOURCE_TARBALL=$(nix eval --raw nixpkgs#linuxKernel.kernels.linux_6_18.src.outPath) && echo “The source is located at: $SOURCE_TARBALL”

This shows the nix store path to the linux kernel sources packages which can be used to modify and diff for patch creation.

tar xf /nix/store/n7j2mdz0chk1r8y5h9hhy2k0w5ba09gz-linux-6.18.tar.xz

Works! (Except my Magicbook does not have the keyboard, even with the patches :frowning: )

1 Like

Little update, just in case someone is going to struggle with this laptop and NixOS as well, I have managed to apply the dsdt patched global file to my Honor Magibook 14 Pro model in this way:

In the hardware-configuration.nix:

introtuce a new let block with the following content (download the patched aml file before):

let
  # Refer to the path where you have downloaded the aml file to (or move it in a more secure place)
  patchedDsdt = pkgs.runCommand “dsdt.aml” {} ''
    cp ${/home/user/Downloads/dsdt.patched.global.aml} $out
  '';

  # This builds a proper uncompressed cpio archive containing the DSDT override
  acpiCpio = pkgs.runCommand ''acpi-override.cpi'' {
      nativeBuildInputs = [ pkgs.cpio ];
    } ''
      mkdir -p kernel/firmware/acpi 
      cp ${patchedDsdt} kernel/firmware/acpi/DSDT.aml

      find kernel -print0 \
        | cpio --null -H newc -o -R root:root \
        > $out
  '';

Later, add the following line:

boot.initrd.prepend = [ "${acpiCpio}" ];

After reboot, this should bring up a lot of different missing features (Battery percentage indicator, Trackpad, and with dumbkbd=1 as well the keyboard). Keyboard is still not working as for now 6.18.3 without the dumbkbd=1 parameter. Probably not needed anymore after 6.19 patches will come in with time (where this was explicitly fixed).