# Enable graphics driver support
hardware.graphics.enable = true;
# Tell X11 and Wayland to use the NVIDIA driver
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required for Wayland and compositors
modesetting.enable = true;
# Use the NVidia open source kernel module (not to be confused with nouveau)
# Set to true for Turing (GTX 16xx, RTX 20xx) or newer GPUs.
# Set to false for older Pascal/legacy GPUs.
open = false;
# Enable the Nvidia settings menu (accessible via `nvidia-settings`)
nvidiaSettings = true;
# Select the appropriate driver version for your specific GPU.
# NixOS 26.05 introduces `hardware.nvidia.branch` as a choice helper.
branch = "production";
};
nvidia/nv-mmap.c: In function 'nv_vma_enter_locked':
nvidia/nv-mmap.c:1005:9: warning: ignoring return value of 'refcount_sub_and_test' declared with attribute 'warn_unused_result' [-Wunused-result]
1005 | refcount_sub_and_test(NV_VMA_LOCK_OFFSET, &vma->vm_refcnt);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvidia/nv-vm.c:412:11: warning: no previous prototype for 'nv_init_page_pools' [-Wmissing-prototypes]
412 | NV_STATUS nv_init_page_pools(void) { return NV_OK; }
| ^~~~~~~~~~~~~~~~~~
nvidia/nv-vm.c:413:6: warning: no previous prototype for 'nv_destroy_page_pools' [-Wmissing-prototypes]
413 | void nv_destroy_page_pools(void) {}
| ^~~~~~~~~~~~~~~~~~~~~
nvidia/nv-vm.c:414:14: warning: no previous prototype for 'nv_mem_pool_alloc_pages' [-Wmissing-prototypes]
414 | unsigned int nv_mem_pool_alloc_pages(nv_page_pool_t *mem_pool, nv_alloc_t *at) { return 0; }
| ^~~~~~~~~~~~~~~~~~~~~~~
nvidia/nv-vm.c:415:11: warning: no previous prototype for 'nv_mem_pool_free_pages' [-Wmissing-prototypes]
415 | NV_STATUS nv_mem_pool_free_pages(nv_page_pool_t *mem_pool, nv_alloc_t *at) { return NV_OK; }
| ^~~~~~~~~~~~~~~~~~~~~~
CC [M] nvidia/nv-pci-table.o
CC [M] nvidia/nv-kthread-q.o
nvidia/os-interface.c: In function 'os_get_current_process_name':
nvidia/os-interface.c:732:5: error: implicit declaration of function 'strncpy' [-Wimplicit-function-declaration]
732 | strncpy(buf, current->comm, len - 1);
| ^~~~~~~
nvidia/os-interface.c:39:1: note: 'strncpy' is defined in header '<string.h>'; this is probably fixable by adding '#include <string.h>'
38 | #include <linux/sys_soc.h>
+++ |+#include <string.h>
39 |
CC [M] nvidia/nv-memdbg.o
CC [M] nvidia/nv-report-err.o
make[4]: *** [/nix/store/rvrswvmlrss37pnzavczhijwza4cb3q8-linux-7.2.2-dev/lib/modules/7.2.2/source/scripts/Makefile.build:289: nvidia/os-interface.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [/nix/store/rvrswvmlrss37pnzavczhijwza4cb3q8-linux-7.2.2-dev/lib/modules/7.2.2/source/Makefile:2187: .] Error 2
make[2]: *** [/nix/store/rvrswvmlrss37pnzavczhijwza4cb3q8-linux-7.2.2-dev/lib/modules/7.2.2/source/Makefile:248: __sub-make] Error 2
make[2]: Leaving directory '/build/nvidia-x11-595.71.05-modsrc'
make[1]: *** [Makefile:248: __sub-make] Error 2
make[1]: Leaving directory '/nix/store/rvrswvmlrss37pnzavczhijwza4cb3q8-linux-7.2.2-dev/lib/modules/7.2.2/source'
make: *** [Makefile:115: modules] Error 2