nixos-hardware icon indicating copy to clipboard operation
nixos-hardware copied to clipboard

`boot.kernelPatches' not respected for surface kernel

Open shadowrylander opened this issue 3 years ago • 6 comments

Hello!

As in the title; I'm trying to apply a patch for bcachefs for the surface kernel, but boot.kernelPatches is not being respected; more information about my config can be found in this issue over on the nixos/nixpkgs repo, where another user narrowed it down for me.

Thank you kindly for the help!

shadowrylander avatar Apr 21 '22 18:04 shadowrylander

Potentially the second callPackage level prevents nixos from applying patches to the kernel: https://github.com/NixOS/nixos-hardware/blob/master/microsoft/surface/kernel/linux-5.16.11.nix This is what happens in nixpkgs: https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/linux-5.4.nix

Mic92 avatar Jun 27 '22 18:06 Mic92

Ah; make sense. I did the following steps to fix the issue in my fork:

  • https://github.com/shadowrylander/nixos-hardware/blob/master/microsoft/surface/kernel/default.nix#L4
  • https://github.com/shadowrylander/nixos-hardware/blob/master/microsoft/surface/kernel/linux-5.16.11.nix#L1
  • https://github.com/shadowrylander/nixos-hardware/blob/master/microsoft/surface/kernel/linux-5.16.11.nix#L15

They seem to work for now; is there anything in that setup I should be wary of?

shadowrylander avatar Jun 27 '22 20:06 shadowrylander

I think we could take your nixos-hardware changes as they are.

Mic92 avatar Jul 21 '22 10:07 Mic92

As in, should I submit a pull request?

shadowrylander avatar Jul 21 '22 17:07 shadowrylander

Yes. https://github.com/shadowrylander/nixos-hardware/blob/667f3bccdc827e7635b474a6d9650a4f2fe6c1bb/microsoft/surface/kernel/default.nix#L4 looks like something nice to have.

Mic92 avatar Jul 22 '22 07:07 Mic92

Got it; I'll submit one as soon as possible!

shadowrylander avatar Jul 22 '22 17:07 shadowrylander