Cannot Build nvidia-x11-570.153.02-6.15

I am encountering GPL-incompatible module * uses GPL-only symbol errors when building nvidia-x11-570.153.02-6.15:

        > nvidia.o: warning: objtool: _nv045909rm+0x77: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv045853rm+0x7f: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv035412rm+0x3e: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv035411rm+0x27: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv035415rm+0x37: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv035414rm+0x24: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv035413rm+0xca: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv035416rm+0x193: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv035418rm+0x17f: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv013509rm+0x5d: 'naked' return found in MITIGATION_RETHUNK build
┃        > nvidia.o: warning: objtool: _nv046215rm+0x12f: 'naked' return found in MITIGATION_RETHUNK build
┃        >   MODPOST Module.symvers
┃        > WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia.o
┃        > WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia-uvm.o
┃        > WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia-modeset.o
┃        > WARNING: modpost: missing MODULE_DESCRIPTION() in nvidia-drm.o
┃        > ERROR: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol '__vma_start_write'
┃        > ERROR: modpost: GPL-incompatible module nvidia-drm.ko uses GPL-only symbol '__vma_start_write'
┃        > make[4]: *** [/nix/store/gl4zb4minm4ddaz31lhsx2rr964z1gjl-linux-6.15-dev/lib/modules/6.15.0/source/scripts/Makefile.modpost:147: Module.symvers] Error 1
┃        > make[3]: *** [/nix/store/gl4zb4minm4ddaz31lhsx2rr964z1gjl-linux-6.15-dev/lib/modules/6.15.0/source/Makefile:1953: modpost] Error 2
┃        > make[2]: *** [/nix/store/gl4zb4minm4ddaz31lhsx2rr964z1gjl-linux-6.15-dev/lib/modules/6.15.0/source/Makefile:248: __sub-make] Error 2
┃        > make[2]: Leaving directory '/build/NVIDIA-Linux-x86_64-570.153.02/kernel'
┃        > make[1]: *** [Makefile:248: __sub-make] Error 2
┃        > make[1]: Leaving directory '/nix/store/gl4zb4minm4ddaz31lhsx2rr964z1gjl-linux-6.15-dev/lib/modules/6.15.0/source'
┃        > make: *** [Makefile:115: modules] Error 2

Below is my relevant configuration:

  config = lib.mkIf config.nvidiaEnable {
    environment.systemPackages = with pkgs; [
      egl-wayland
      nvitop
    ];

    boot.kernelPackages = pkgs.linuxPackages_latest;
    boot.kernelParams = [
      "nvidia-drm.modeset=1"
      "nvidia-drm.fbdev=1"
    ];

    hardware.nvidia = {
      # Modesetting is required.
      modesetting.enable = true;

      # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
      # Enable this if you have graphical corruption issues or application crashes after waking
      # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
      # of just the bare essentials.
      powerManagement.enable = false;

      # Fine-grained power management. Turns off GPU when not in use.
      # Experimental and only works on modern Nvidia GPUs (Turing or newer).
      powerManagement.finegrained = false;

      # Use the NVidia open source kernel module (not to be confused with the
      # independent third-party "nouveau" open source driver).
      # Support is limited to the Turing and later architectures. Full list of
      # supported GPUs is at:
      # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
      # Only available from driver 515.43.04+
      open = false;

      # Enable the Nvidia settings menu,
      # accessible via `nvidia-settings`.
      nvidiaSettings = true;

      # Optionally, you may need to select the appropriate driver version for your specific GPU.
      package = config.boot.kernelPackages.nvidiaPackages.latest;
    };

    nixpkgs = {
      config = {
        allowUnfree = true;
        pulseaudio = true;
        nvidia.acceptLicense = true;
        # packageOverrides = pkgs: { inherit (pkgs) linuxPackages_latest nvidia_x11; };
      };
    };

    services.xserver.videoDrivers = [ "nvidia" ];

I have set boot.kernelPackages = pkgs.linuxPackages_6_14; for now, which builds correctly.

3 Likes

Glad I’m not the only one with this error, but I also came across this with the Beta and latest drivers: “570.153.02” and “575.51.02”

I’ll probably stick to kernel 6.14 until someone finds a solution…

I ran into almost the exact same problem on Fedora Rawhide. Try using the open driver.

Having the same problem here with the open driver, sadly

Don’t use linux_latest with third party kernel modules!

The nvidia modules are developed against the LTS kernel. Since they are developed separately from the kernel, they effectively use a completely unstable API and cannot do anything to ensure that your module will build against a newer kernel.

Eventually this will be patched, probably when they release their next driver, but it can take months - nvidia do not have a release schedule for their drivers.

Literally any kernel bump can cause this, and many do. So the best thing you as a consumer can do to prevent this stuff is just to use the LTS kernel.

That, or get kernel hacking and write your own nvidia patches. Or grab patches from random people online, and hope they don’t set your hardware on fire.

Or switch to AMD or intel - they have in-tree drivers, so updates happen with the kernel, as they are supposed to, allowing you to experiment with kernel versions as much as you desire.

tl;dr: If somewhere in your config you have:

boot.kernelPackages = pkgs.linuxPackages_latest;

delete that line.

Removing it will make you use the LTS Linux kernel, since that is the default setting.

2 Likes

Which one is considered LTS in this list?

https://nixos.wiki/wiki/Linux_kernel

Would I write the following in my nix config file?

boot.kernelPackages = pkgs.linuxPackages

Or would I remove this line entirely because LTS is used by default?

Yep. You can also use pkgs.linuxPackages if you wish, but I would recommend not duplicating default settings in general; that way upstream can change them for you if that needs to happen for some reason.

Also, that is the unofficial, mostly bitrotting wiki. The owner of the domain is uncooperative, there is an official wiki now, try to use and link to it so we finally get the page rankings fixed: Linux kernel - NixOS Wiki

As an aside, the first line on that entry helpfully states:

By default, the latest LTS linux kernel is installed (Linux Kernel Version History).

2 Likes

Does that main I’m out of luck if I also need a ZFS compatible kernel?

I’m selecting my kernel through:

  zfsCompatibleKernelPackages = l.filterAttrs (
    name: kernelPackages:
    (builtins.match "linux_[0-9]+_[0-9]+" name) != null
    && (builtins.tryEval kernelPackages).success
    && (!kernelPackages.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken)
  ) pkgs.linuxKernel.packages;
  latestKernelPackage = l.last (
    l.sort (a: b: (l.versionOlder a.kernel.version b.kernel.version)) (
      builtins.attrValues zfsCompatibleKernelPackages
    )
  );

as it is recommended by the wiki.

However that causes be to fail the build on nvidia-open-6.16.11-570.153.02
I have tried nixpkgs/nixos-25.05, nixpkgs/nixos-unstable and even a fairly recent nixpkgs/master

Edit: Add build log for failing build of /nix/store/d0swbckg5sapj65v7b5h3hizjh1d0yqc-nvidia-open-6.16.11-570.153.02.drv:

nvidia/nv.c:3131:5: 01;36mnote: in expansion of macro 'NV_KMALLOC'
 3131 |     01;36mNV_KMALLOC(pages, sizeof(struct page *) * page_count);
      |     01;36m^~~~~~~~~~
nvidia/nv.c: In function 'nv_alloc_kernel_mapping':
././common/inc/nv-linux.h:564:37: 01;35mwarning: suggest braces around empty body in an 'if' statement [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/W
  564 |             NV_MEMDBG_ADD(ptr, size)01;35m; \
      |                                     01;35m^
nvidia/nv.c:3626:13: 01;36mnote: in expansion of macro 'NV_KMALLOC'
 3626 |             01;36mNV_KMALLOC(pages, sizeof(struct page *) * page_count);
      |             01;36m^~~~~~~~~~
nvidia/nv.c: In function 'nv_post_event':
././common/inc/nv-linux.h:578:37: 01;35mwarning: suggest braces around empty body in an 'if' statement [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/W
  578 |             NV_MEMDBG_ADD(ptr, size)01;35m; \
      |                                     01;35m^
nvidia/nv.c:3881:9: 01;36mnote: in expansion of macro 'NV_KMALLOC_ATOMIC'
 3881 |         01;36mNV_KMALLOC_ATOMIC(nvet, sizeof(nvidia_event_t));
      |         01;36m^~~~~~~~~~~~~~~~~
  CC [M]  nvidia/libspdm_hkdf_sha.o
nvidia/nv-dmabuf.c: In function 'nv_dma_buf_map':
nvidia/nv-dmabuf.c:844:9: 01;31merror: implicit declaration of function 'dma_buf_attachment_is_dynamic' [01;31m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/
  844 |         01;31mdma_buf_attachment_is_dynamic(attachment) &&
      |         01;31m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  nvidia/libspdm_ec.o
  CC [M]  nvidia/libspdm_x509.o
  CC [M]  nvidia/libspdm_rsa_ext.o
make[5]: *** [/nix/store/4rblr992mvckliqw9dgmcrrq1l2gjink-linux-6.16.11-dev/lib/modules/6.16.11/source/scripts/Makefile.build:287: nvidia/nv-dmabuf.o] Error 1
make[5]: *** Waiting for unfinished jobs....
In file included from nvidia/nv-caps.c:24:
nvidia/nv-caps.c: In function 'nv_cap_procfs_open':
././common/inc/nv-linux.h:564:37: 01;35mwarning: suggest braces around empty body in an 'if' statement [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/W
  564 |             NV_MEMDBG_ADD(ptr, size)01;35m; \
      |                                     01;35m^
nvidia/nv-caps.c:435:5: 01;36mnote: in expansion of macro 'NV_KMALLOC'
  435 |     01;36mNV_KMALLOC(private, sizeof(nv_cap_file_private_t));
      |     01;36m^~~~~~~~~~
nvidia/nv-caps.c: In function 'nv_cap_alloc':
././common/inc/nv-linux.h:564:37: 01;35mwarning: suggest braces around empty body in an 'if' statement [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/W
  564 |             NV_MEMDBG_ADD(ptr, size)01;35m; \
      |                                     01;35m^
nvidia/nv-caps.c:635:5: 01;36mnote: in expansion of macro 'NV_KMALLOC'
  635 |     01;36mNV_KMALLOC(cap, sizeof(nv_cap_t));
      |     01;36m^~~~~~~~~~
././common/inc/nv-linux.h:564:37: 01;35mwarning: suggest braces around empty body in an 'if' statement [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/W
  564 |             NV_MEMDBG_ADD(ptr, size)01;35m; \
      |                                     01;35m^
nvidia/nv-caps.c:642:5: 01;36mnote: in expansion of macro 'NV_KMALLOC'
  642 |     01;36mNV_KMALLOC(cap->path, len);
      |     01;36m^~~~~~~~~~
././common/inc/nv-linux.h:564:37: 01;35mwarning: suggest braces around empty body in an 'if' statement [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/W
  564 |             NV_MEMDBG_ADD(ptr, size)01;35m; \
      |                                     01;35m^
nvidia/nv-caps.c:654:5: 01;36mnote: in expansion of macro 'NV_KMALLOC'
  654 |     01;36mNV_KMALLOC(cap->name, len);
      |     01;36m^~~~~~~~~~
nvidia/nv-caps.c: In function 'nv_cap_init':
././common/inc/nv-linux.h:564:37: 01;35mwarning: suggest braces around empty body in an 'if' statement [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/W
  564 |             NV_MEMDBG_ADD(ptr, size)01;35m; \
      |                                     01;35m^
nvidia/nv-caps.c:759:5: 01;36mnote: in expansion of macro 'NV_KMALLOC'
  759 |     01;36mNV_KMALLOC(name, (strlen(path) + strlen(dir)) + 1);
      |     01;36m^~~~~~~~~~
nvidia/libspdm_internal_crypt_lib.c:31:6: 01;35mwarning: no previous prototype for 'libspdm_check_crypto_backend' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-1
   31 | bool 01;35mlibspdm_check_crypto_backend(void)
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_hkdf_sha.c:29:6: 01;35mwarning: no previous prototype for 'libspdm_hkdf_sha256_extract_and_expand' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-1
   29 | bool 01;35mlibspdm_hkdf_sha256_extract_and_expand(const uint8_t *key, size_t key_size,
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_hkdf_sha.c:57:6: 01;35mwarning: no previous prototype for 'libspdm_hkdf_sha384_extract_and_expand' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-1
   57 | bool 01;35mlibspdm_hkdf_sha384_extract_and_expand(const uint8_t *key, size_t key_size,
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_hkdf_sha.c:85:6: 01;35mwarning: no previous prototype for 'libspdm_hkdf_sha512_extract_and_expand' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-1
   85 | bool 01;35mlibspdm_hkdf_sha512_extract_and_expand(const uint8_t *key, size_t key_size,
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:35:6: 01;35mwarning: no previous prototype for 'libspdm_x509_construct_certificate' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gc
   35 | bool 01;35mlibspdm_x509_construct_certificate(const uint8_t *cert, size_t cert_size,
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:42:6: 01;35mwarning: no previous prototype for 'libspdm_x509_construct_certificate_stack' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.
   42 | bool 01;35mlibspdm_x509_construct_certificate_stack(uint8_t **x509_stack, ...)
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:48:6: 01;35mwarning: no previous prototype for 'libspdm_x509_free' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options
   48 | void 01;35mlibspdm_x509_free(void *x509_cert)
      |      01;35m^~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:53:6: 01;35mwarning: no previous prototype for 'libspdm_x509_stack_free' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-O
   53 | void 01;35mlibspdm_x509_stack_free(void *x509_stack)
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:111:6: 01;35mwarning: no previous prototype for 'libspdm_x509_get_common_name' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
  111 | bool 01;35mlibspdm_x509_get_common_name(const uint8_t *cert, size_t cert_size,
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:120:1: 01;35mwarning: no previous prototype for 'libspdm_x509_get_organization_name' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
  120 | 01;35mlibspdm_x509_get_organization_name(const uint8_t *cert, size_t cert_size,
      | 01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:340:6: 01;35mwarning: no previous prototype for 'libspdm_x509_get_tbs_cert' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
  340 | bool 01;35mlibspdm_x509_get_tbs_cert(const uint8_t *cert, size_t cert_size,
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:371:1: 01;35mwarning: no previous prototype for 'libspdm_x509_get_issuer_common_name' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
  371 | 01;35mlibspdm_x509_get_issuer_common_name(const uint8_t *cert, size_t cert_size,
      | 01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:380:1: 01;35mwarning: no previous prototype for 'libspdm_x509_get_issuer_orgnization_name' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
  380 | 01;35mlibspdm_x509_get_issuer_orgnization_name(const uint8_t *cert, size_t cert_size,
      | 01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:388:6: 01;35mwarning: no previous prototype for 'libspdm_x509_get_signature_algorithm' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
  388 | bool 01;35mlibspdm_x509_get_signature_algorithm(const uint8_t *cert,
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_x509.c:449:6: 01;35mwarning: no previous prototype for 'libspdm_gen_x509_csr' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
  449 | bool 01;35mlibspdm_gen_x509_csr(size_t hash_nid, size_t asym_nid,
      |      01;35m^~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_ec.c:36:6: 01;35mwarning: no previous prototype for 'libspdm_ec_set_pub_key' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
   36 | bool 01;35mlibspdm_ec_set_pub_key(void *ec_context, const uint8_t *public_key,
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_ec.c:46:6: 01;35mwarning: no previous prototype for 'libspdm_ec_get_pub_key' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
   46 | bool 01;35mlibspdm_ec_get_pub_key(void *ec_context, uint8_t *public_key,
      |      01;35m^~~~~~~~~~~~~~~~~~~~~~
nvidia/libspdm_ec.c:60:6: 01;35mwarning: no previous prototype for 'libspdm_ec_check_key' [01;35m8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmissing-prototypes-Wmissing-prototypes]
   60 | bool 01;35mlibspdm_ec_check_key(const void *ec_context)
      |      01;35m^~~~~~~~~~~~~~~~~~~~
make[4]: *** [/nix/store/4rblr992mvckliqw9dgmcrrq1l2gjink-linux-6.16.11-dev/lib/modules/6.16.11/source/Makefile:2003: .] Error 2
make[3]: *** [/nix/store/4rblr992mvckliqw9dgmcrrq1l2gjink-linux-6.16.11-dev/lib/modules/6.16.11/source/Makefile:248: __sub-make] Error 2
make[3]: Leaving directory '/build/source/kernel-open'
make[2]: *** [Makefile:248: __sub-make] Error 2
make[2]: Leaving directory '/nix/store/4rblr992mvckliqw9dgmcrrq1l2gjink-linux-6.16.11-dev/lib/modules/6.16.11/source'
make[1]: *** [Makefile:115: modules] Error 2
make[1]: Leaving directory '/build/source/kernel-open'
make: *** [Makefile:59: modules] Error 2

I updated the function to also filter for nvidia compatible kernels:

  zfsNvidiaCompatibleKernelPackages = l.filterAttrs (
    name: kernelPackages:
    (builtins.match "linux_[0-9]+_[0-9]+" name) != null
    && (builtins.tryEval kernelPackages).success
    && (!kernelPackages.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken)
    && (!kernelPackages.nvidiaPackages.stable.meta.broken)
  ) pkgs.linuxKernel.packages;

However that still results in it evaluating nvidia-open-6.16.11-570.153.02 and failing.

Setting kernelPackages = pkgs.linuxKernel.packages.linux_6_12 works…
I selected linux_6_12, since I manually checked it through nix repl:

nix-repl> inputs.nixpkgs.legacyPackages.x86_64-linux.linuxKernel.packages.linux_6_12.nvidiaPackages.latest.meta.broken
false

nix-repl> inputs.nixpkgs.legacyPackages.x86_64-linux.linuxKernel.packages.linux_6_12.zfs_2_3.meta.broken
false

Though linux_6_16, as it is returned by the function should also work:

nix-repl> inputs.nixpkgs.legacyPackages.x86_64-linux.linuxKernel.packages.linux_6_16.zfs_2_3.meta.broken
false

nix-repl> inputs.nixpkgs.legacyPackages.x86_64-linux.linuxKernel.packages.linux_6_16.nvidiaPackages.latest.meta.broken
false

Whether it’s broken or not isn’t always reflected accurately in that meta attribute. Unless the zfs module is incompatible with the nvidia one, I’d expect the LTS kernel to work. That or I guess you’re in an awkward spot where the nvidia driver is only compatible with kernels zfs isn’t, at which point you should probably downgrade nvidia.

Peak NixOS kernel shenanigans btw. I would stay well away from mixing multiple third party modules like this, personally, this is a recipe for headaches.

Ok, it’s a bit sad to hear that meta.broken isn’t reliable…

I don’t really like downgrading or pinning a version, since that’s something I need to come back to in the future, or it will bite me.

That’s why I went back to the function and just manually skip linux_6_16, assuming it will work for future version (if not, I just add another ignore):

  zfsNvidiaCompatibleKernelPackages = l.filterAttrs (
    name: kernelPackages:
    (builtins.match "linux_[0-9]+_[0-9]+" name) != null
    && (builtins.tryEval kernelPackages).success
    && (!kernelPackages.${config.boot.zfs.package.kernelModuleAttribute}.meta.broken)
    && (!kernelPackages.nvidiaPackages.stable.meta.broken) # this should match config.hardware.nvidia.package
    && (builtins.match "linux_6_16" name) == null # nvidia-open-6.16.11-570.153.02 is broken
  ) pkgs.linuxKernel.packages;

  latestKernelPackage = l.last (
    l.sort (a: b: (l.versionOlder a.kernel.version b.kernel.version)) (
      builtins.attrValues zfsNvidiaCompatibleKernelPackages
    )
  );

And yes, as I’ve just experienced it, mixing multiple third party modules can be quite a headache. Though I think I’ll now be fine, since I don’t plan to add more to the mix.

Thanks for the input!