Here is my configuration. On 6.16.8 it works fine.
boot.kernelPackages = pkgs.linuxPackages_latest;
hardware.graphics.enable = true;
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.production;
};
And here is error.
error: builder for '/nix/store/dwv0hixwsy898fx1fzxka51dqsbjqrpq-nvidia-x11-570.153.02-6.17.drv' failed with exit code 2;
last 25 log lines:
> In file included from /nix/store/zk1zwqbn97zn0mshy5v05q99h8b0pizk-linux-6.17-dev/lib/modules/6.17.0/source/include/drm/drm_atomic_helper.h:33,
> from nvidia-drm/nvidia-drm-helper.h:191,
> from nvidia-drm/nvidia-drm-fb.c:32:
> /nix/store/zk1zwqbn97zn0mshy5v05q99h8b0pizk-linux-6.17-dev/lib/modules/6.17.0/source/include/drm/drm_modeset_helper.h:37:67: note: expected 'const struct drm_format_info *' but argument is of type 'struct drm_mode_fb_cmd2 *'
> 37 | const struct drm_format_info *info,
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> nvidia-drm/nvidia-drm-fb.c:271:5: error: too few arguments to function 'drm_helper_mode_fill_fb_struct'
> 271 | drm_helper_mode_fill_fb_struct(
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /nix/store/zk1zwqbn97zn0mshy5v05q99h8b0pizk-linux-6.17-dev/lib/modules/6.17.0/source/include/drm/drm_modeset_helper.h:35:6: note: declared here
> 35 | void drm_helper_mode_fill_fb_struct(struct drm_device *dev,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> make[4]: *** [/nix/store/zk1zwqbn97zn0mshy5v05q99h8b0pizk-linux-6.17-dev/lib/modules/6.17.0/source/scripts/Makefile.build:287: nvidia-drm/nvidia-drm-fb.o] Error 1
> nvidia-drm/nvidia-drm-gem-user-memory.c: In function '__nv_drm_gem_user_memory_handle_vma_fault':
> nvidia-drm/nvidia-drm-gem-user-memory.c:167:43: error: implicit declaration of function 'pfn_to_pfn_t'; did you mean 'pfn_to_nid'? [-Wimplicit-function-declaration]
> 167 | return vmf_insert_mixed(vma, address, pfn_to_pfn_t(pfn));
> | ^~~~~~~~~~~~
> | pfn_to_nid
> make[4]: *** [/nix/store/zk1zwqbn97zn0mshy5v05q99h8b0pizk-linux-6.17-dev/lib/modules/6.17.0/source/scripts/Makefile.build:287: nvidia-drm/nvidia-drm-gem-user-memory.o] Error 1
> make[3]: *** [/nix/store/zk1zwqbn97zn0mshy5v05q99h8b0pizk-linux-6.17-dev/lib/modules/6.17.0/source/Makefile:2011: .] Error 2
> make[2]: *** [/nix/store/zk1zwqbn97zn0mshy5v05q99h8b0pizk-linux-6.17-dev/lib/modules/6.17.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/zk1zwqbn97zn0mshy5v05q99h8b0pizk-linux-6.17-dev/lib/modules/6.17.0/source'
> make: *** [Makefile:115: modules] Error 2
For full logs, run:
nix log /nix/store/dwv0hixwsy898fx1fzxka51dqsbjqrpq-nvidia-x11-570.153.02-6.17.drv
error: 1 dependencies of derivation '/nix/store/mlhz4z87r7has9vx5dsyb17g67hcwf7l-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/vaz1g4piimni7bkvlpirqva2hbjzkr7a-firmware.drv' failed to build
error: 1 dependencies of derivation '/nix/store/65dwfr5hidkgchg9hrb0adjq09fka5f1-linux-6.17-modules.drv' failed to build
error: 1 dependencies of derivation '/nix/store/553m0g9f3kgb386yb1zb0mh8py2vkgx5-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/nsid24r9pn33w0blz432w1mivxpz1qnz-nixos-system-warthog-25.05.20251006.20c4598.drv' failed to build