fix(hardware/thinkpad-p1-gen3): nvidia usage

This commit is contained in:
Malte Tammena 2024-04-29 11:15:04 +02:00
parent 157da97182
commit 29b136c983
4 changed files with 5 additions and 38 deletions

View file

@ -9,7 +9,7 @@
availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"];
luks.devices."enc".device = "/dev/disk/by-uuid/1f1e51d6-3084-4f4d-9b4b-6caa0352f542";
};
kernelModules = ["kvm-intel" "acpi_call" "nvidia"];
kernelModules = ["kvm-intel" "acpi_call" "nvidia" "nvidia_modeset" "nvidia_umv" "nvidia_drm"];
extraModulePackages = with config.boot.kernelPackages; [acpi_call];
supportedFilesystems = ["btrfs"];
kernelParams = ["acpi_backlight=native"];
@ -54,6 +54,7 @@
driSupport32Bit = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
nvidia-vaapi-driver
vaapiVdpau
libvdpau-va-gl
libva

View file

@ -13,7 +13,6 @@
inputs.custom-udev-rules.nixosModule
../../hardware/thinkpad-p1-gen3.nix
../../modules/light-actkbd.nix
../../modules/nvidia-fixed.nix
];
config = {

View file

@ -1,36 +0,0 @@
{
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?";
}

View file

@ -122,9 +122,12 @@
env =
(lib.lists.optionals nixosConfig.settings.nvidiaUsed [
"WLR_NO_HARDWARE_CURSORS,1"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia-drm"
"NVD_BACKEND,direct"
"ELECTRON_OZONE_PLATFORM_HINT,auto"
])
++ [
"PASSWORD_STORE_DIR,${config.programs.password-store.settings.PASSWORD_STORE_DIR}"