Hello, I have a Lenovo W520 laptop with the Nvidia 1000M chipset. It works fine with NixOS 21.11 but I can’t make it work with 22.05. Apparently it needs the legacy 390 drivers. I tried copying my working configuration from the 21.11 installation but it shows a message at boot about needing the legacy drivers, and it drives just the laptop display, not the displays plugged into the docking station.
You can also try the nouveau driver (default if you don’t set a driver), I believe its performance is much closer to proprietary for legacy cards, and it’s not like you’ll be playing graphically intensive games on a 12 year old mobile gpu.
Edit: Hrm, maybe still not, power management is the big bugbear that they still haven’t cracked (yours is NVC0): FeatureMatrix · freedesktop.org. Oh well, hopefully with the new open source drivers.
The manual says to define services.xserver.videoDrivers but nixos-rebuild says that since 19.03, the correct name is hardware.nvidia.package.
With this configuration, when sddm starts, the two external screens do momentarily receive a signal, but nevertheless the login screen appears on the built-in laptop screen only.
{ config, pkgs, lib, ... }:
{
hardware.nvidia.package = [ "nvidiaLegacy390" ];
# For nvidia
nixpkgs.config.allowUnfree = true;
hardware.nvidia.prime = {
# offload.enable = true;
sync.enable = true;
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
};
}
That hardware.nvidia.prime block is copied from my working 21.11 laptop (I have two W520s) and the momentary driving of the external displays occurs if it is removed. I also tried offload.enable = true; with the same results.
If you use hardware.nvidia.package you need to set an actual package, rather than a string:
{ config, pkgs, lib, ... }:
{
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_390;
# For nvidia
nixpkgs.config.allowUnfree = true;
hardware.nvidia.prime = {
# offload.enable = true;
sync.enable = true;
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
};
}
Nope, no change, regrettably. I tried offload.enable = true; as well, just in case, and although it’s not the NixOS way, I rebooted, to ensure that the selected kernel modules were loaded.
Sorry to disappoint but I managed to get Nouveau working adequately. As I see it, the Nouveau driver chain is only going to improve and the official Nvidia drivers are going to be harder and harder to deploy. My configuration is here – I hope it helps you.
Nouveau is by no means perfect for me and one particular defect is that if I undock my laptop and take it to another docking station with a different screen setup, it won’t adapt to the new layout, frequently leaving one screen showing ‘noise’. I have to log out and in again to fix that.
Thanks for your repply, nouveau work also for me, but my problem is with the HDMI sound output. I got no sound with it and got sound with nvidia legacy.
Maybe I can fix the sound problem with nouveau (if I look at the feature matrix for NVC0, which is my chipset, it should be ok) ?