Fermi architecture GPUs on NixOS

Having installed NixOS on my fresh SSD I wanted to get my GPU (NVIDIA GT 635M) working. I have thus far failed, even after reading through the wiki page and multiple posts here on Discourse.

The current state of the machine (I am on Wayland, running Niri as my compositor):

# hardware config
# Slightly altered and reorganised hardware config
# for my Asus K75VJ laptop
{ config, lib, pkgs,  ... }: {
  # Kernel
  boot.kernelPackages = pkgs.linuxPackages_6_12;
  boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "ums_realtek" "usb_storage" "usbhid" "sd_mod" ];
  boot.kernelModules = [ "kvm-intel" ];
  # These are likely not needed(?)
  # They are leftovers from my attempts to fix this issue
  boot.initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_drm" "nvidia_uvm" ];
  boot.kernelParams = [ "nvidia-drm.modeset=1" ];

  # Bootloader
  boot.loader.limine.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  # Networking and file system stuff here
  # ... 

  # Hardware
  hardware.enableRedistributableFirmware = true;
  hardware.graphics.enable = true;
  hardware.nvidia = {
    open = false;
    # The latest driver supporting my GPU
    package = config.boot.kernelPackages.nvidiaPackages.legacy_390;
    nvidiaSettings = true;
    prime = {
      sync.enable = true;

      intelBusId = "PCI:0@0:2:0";
      nvidiaBusId = "PCI:1@0:0:0";
    };
  };
  services.xserver.videoDrivers = [ "nvidia" ];

  # Audio. Also not working but this is a topic for another post
  # ...

  # CPU
  nixpkgs.hostPlatform = "x86_64-linux";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
$ lspci -nnk | grep -A2 -e VGA
00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09)
	DeviceName:  Onboard IGD
	Subsystem: ASUSTeK Computer Inc. Device [1043:10bc]
--
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF108M [GeForce GT 635M] [10de:0de3] (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device [1043:10bc]
	Kernel driver in use: nvidia
$ nvidia-smi
Tue Sep 22 11:24:47 2026       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.157                Driver Version: 390.157                   |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GT 635M     Off  | 00000000:01:00.0 N/A |                  N/A |
| N/A   45C    P8    N/A /  N/A |      0MiB /  1985MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0                    Not Supported                                       |
+-----------------------------------------------------------------------------+

As seen above, nvidia-smi does detect my GPU, and yet declares most of the readings N/A. Running nvidia-settings doesn’t display the GUI, instead exiting after

$ nvidia-settings

ERROR: Unable to find display on any available system
$ inxi -Gx
Graphics:
  Device-1: Intel 3rd Gen Core processor Graphics vendor: ASUSTeK driver: i915
    v: kernel arch: Gen-7 bus-ID: 00:02.0
  Device-2: NVIDIA GF108M [GeForce GT 635M] vendor: ASUSTeK driver: nvidia
    v: 390.157 arch: Fermi bus-ID: 01:00.0
  Display: wayland server: X.org v: 1.21.1.24 compositor: niri driver:
    gpu: i915,nvidia resolution: 1600x900~60Hz
  API: EGL v: 1.5 drivers: crocus platforms: active: wayland,x11,surfaceless
    inactive: gbm
  API: OpenGL v: 4.2 vendor: intel mesa v: 26.1.5 glx-v: 1.4
    direct-render: yes renderer: Mesa Intel HD Graphics 4000 (IVB GT2)
  API: Vulkan v: 1.4.341 drivers: intel,llvmpipe surfaces: N/A devices: 2
  Info: Tools: api: eglinfo, glxinfo, vulkaninfo
    gpu: nvidia-settings,nvidia-smi x11: xprop,xrandr

Any and all help would be greatly apppreciated

Do you want any output routed to the dGPU working, do you want the GPU working with Nvidia drivers, or do you want it working at all? I think do-nothing (striking out any mention of nvidia in configuration) has pretty good chances to have it working with Nouveau, OpenGL + Vulkan. Should work better in terms of accessing extra outputs. Might be slower than «CUDA under ideal conditions».

I’d like to have it work at all, since so far I had no luck with even that.
I’ll have at it some more tomorrow, since one of the other issues I had seemingly resolved itself (or rather I found an idiotic workaround for ot)

For more context, this is a laptop GPU specifically.
I’ll try deleting anything nvidia related but hardware.graphics.enable and we’ll see how it goes, though I’m fairly sure I tried that already

Make sure to use nixos-rebuild boot and then reboot your system to test the changes.