Best way to handle boot.extraModulePackages Kernel module conflict

Hey, I am having issues with Kernel module name conflicts and I am looking for advice on the best way to resolve it.

I’m trying to use boot.extraModulePackages to load the it87 module . Below is what I have:

boot.extraModulePackages = with config.boot.kernelPackages; [

When I use this snippet it adds the the file it87.ko to /run/current-system/kernel-modules/lib/modules/6.1.35/kernel/drivers/hwmon/

The issue I have is the file /run/current-system/kernel-modules/lib/modules/6.1.35/kernel/drivers/hwmon/it87.ko.xz already exists and when I do a modprobe the it87.ko.xz seems to get used over the it87.ko which fails for me as the mainline version doesn’t support my hardware.

As a workaround I’ve added the below to my configuration.nix, disabling the mainline it87 module being built. This solves the problem but requires a long kernel compilation.

 boot.kernelPatches = lib.singleton {
    name = "disable-it87";
    patch = null;
    extraStructuredConfig = with lib.kernel; {
      SENSORS_IT87 = no;

Does anyone have a better solution? If built a ko.xz extension I’m guessing it would overwrite the default and this would be a non issue?

1 Like


Did you find any solution to this?

I have the following configuration but I am not able to load the it87 kernel module

  boot.kernelModules = [ "kvm-amd" "it87" ];
  boot.extraModulePackages = with config.boot.kernelPackages; [

And lsmod does not show it87 in any way


I was not able to make it87 work
At this point I gave up on using it87 with fancontrol for my Gigabyte MB and set up the fans in the BIOS.

fancontrol is still used for the AMDGPU