Overriding a kernel module derivation that is getting including through NixOS configuration


I’m trying to override a kernel module facetimehd of the kernel I’m using in my flakes based nixos configuration:

}: let
  kernel =
    // { facetimehd = null; };
in {
  boot.kernelPackages = kernel;

Yet when I run the nixos-rebuild repl on my configuration, I see:

nix-repl> config.boot.kernelPackages.facetimehd
«derivation /nix/store/58hyyj7ccx3hv6hxyacagh2bll5j11xp-facetimehd-0.5.18-6.7.5.drv»

Whereas I do see that it gets overridden, if I try to manually override at REPL:

nix-repl> (pkgs.linuxPackages_zen // { facetimehd = null; }).facetimehd 

Any hints/ideas ?


Hi, @abbe.

I would explore adding the offending module to boot.blacklistedKernelModules.
This will create a /etc/modprobe.d/nixos.conf with a line blacklist facetimehd, which will effectively prevent it from being loaded.

See here for details.

Hope that it helps!

@pancho I’m not trying to blacklist it. I’m trying to update that module by overridding it with an update (which in this case, I just set it to null to save space while clarifying the intent, instead of providing an actual overrideAttrs invocation).

Oh, I see. Have you tried the patch route?

Patch to nixpkgs ? Nope. Because I think overrideAttrs way should work, and it’s not. So, I’m trying to understand why.

I meant this.

Maybe using linuxPackagesFor with the overriden derivation?
See the Linux Kernel entry on the Wiki for details, because the function does not appear if searched on search.nixos.org.

Thank you @pacho for the pointer to the needed documentation. linuxPackages_zen.extends was what I needed to override facetimehd module.

1 Like