Error building kernel module when trying to upgrade to 24.05

when i try to upgrade to nixos-24.05 i get this error message:

error: builder for '/nix/store/vwn2fkigisb0932db2gna4hywmyp61w7-linux-6.6.33-modules.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/vdw8laa6rfvz35hlbhy7g16b2b8prr54-nixos-system-mave-24.05.1409.cc54fb41d137.drv' failed to build

This just tells that something in the closure of your kernel modules or in your list of kernel modules is broken.
Without more context, it is impossible to do any diagnosis.

what information would help?

At least the revisions your current channels or flake.lock point to and the relevant parts of your NixOS configuration. Also the full output from nixos-rebuild to see what led to the error message.

Edit: Ok, you are attempting to the latest channel bump 24.05.1409.cc54fb41d137, this was just off the screen in your post.

in the process of searching for the relevant config part i found the Problem. Its this module, when commenting this line out it works:
boot.extraModulePackages = [ pkgs.linuxKernel.packages.linux_6_1.v4l2loopback ];

full output:

these 5 derivations will be built:
  /nix/store/vwn2fkigisb0932db2gna4hywmyp61w7-linux-6.6.33-modules.drv
  /nix/store/gg0w6100cw0vppxpkgpkj9qkc55c92c2-linux-6.6.33-modules-shrunk.drv
  /nix/store/vm666kfbdgjfn9l3wgcc4vbfpnrbxs73-initrd-linux-6.6.33.drv
  /nix/store/9zbas7l7j20abch7agbdrli3pi8psz02-boot.json.drv
  /nix/store/vdw8laa6rfvz35hlbhy7g16b2b8prr54-nixos-system-mave-24.05.1409.cc54fb41d137.drv
building '/nix/store/vwn2fkigisb0932db2gna4hywmyp61w7-linux-6.6.33-modules.drv'...
created 22 symlinks in user environment
inconsistent kernel versions: 6.1.93
6.6.33
error: builder for '/nix/store/vwn2fkigisb0932db2gna4hywmyp61w7-linux-6.6.33-modules.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/vdw8laa6rfvz35hlbhy7g16b2b8prr54-nixos-system-mave-24.05.1409.cc54fb41d137.drv' failed to build

linux_6_1.v4l2loopback is a module built for Kernel 6.1, but NixOS 24.05 defaults to Kernel 6.6.

This is also reflected in the error inconsistent kernel versions: ...

You can try boot.extraModulePackages = [ pkgs.linuxKernel.packages.linux_6_6.v4l2loopback ];

1 Like

It was really to obvious!
But when you feel overwhelmed with such a problem, i find it hard to search thorough.
So thank you really much for answering such seemingly lazy questions!