{ lib, pkgs, ... }: let # get the last working revision with nvidia 410.x nixos-unstable-pinned = import (pkgs.fetchFromGitHub { owner = "NixOS"; repo = "nixpkgs"; rev = "d680ded26da5cf104dd2735a51e88d2d8f487b4d"; sha256 = "sha256-fkJGNjEmTPvqBs215EQU4r9ivecV5Qge5cF/QDLVn3U="; }) { system = "x86_64-linux"; config.allowUnfree = true; }; # We'll use this twice pinnedKernelPackages = nixos-unstable-pinned.linuxPackages_latest; in { nixpkgs.config.packageOverrides = pkgs: { # swap out all of the linux packages linuxPackages_latest = pinnedKernelPackages; oldLinuxPackages = pkgs.linuxPackages_latest; # make sure x11 will use the correct package as well nvidia_x11 = nixos-unstable-pinned.nvidia_x11; }; # line up your kernel packages at boot boot.kernelPackages = pinnedKernelPackages; warnings = lib.optional (pkgs.oldLinuxPackages.nvidia_x11.version != "545.29.02") "New nvidia drivers (${pkgs.oldLinuxPackages.nvidia_x11.version}) available, does this fix the backlight issues on the thinkpad?"; }