From 18b3e0efa4152b6812757da463464e79752243ad Mon Sep 17 00:00:00 2001 From: Tootbrute Date: Thu, 19 Jun 2025 08:12:06 +0800 Subject: [PATCH] add gpu stuff --- configuration.nix | 5 ++++- modules/intel-gpu.nix | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/configuration.nix b/configuration.nix index 57939e6..0632b4e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -19,7 +19,10 @@ boot.loader.efi.canTouchEfiVariables = true; boot.loader.grub.configurationLimit = 10; - boot.initrd.luks.devices."luks-886090f3-1ba1-4134-9734-5b922106820d".device = "/dev/disk/by-uuid/886090f3-1ba1-4134-9734-5b922106820d"; + boot.initrd.luks.devices."luks-886090f3-1ba1-4134-9734-5b922106820d".device = "/dev/disk/by-uuid/886090f3-1ba1-4134-9734-5b922106820d"; + + # Let the system detect and handle plugged-in hardware + services.udev.enable = true; # Clear /tmp during boot boot.tmp.cleanOnBoot = true; diff --git a/modules/intel-gpu.nix b/modules/intel-gpu.nix index 79486df..6763929 100644 --- a/modules/intel-gpu.nix +++ b/modules/intel-gpu.nix @@ -5,11 +5,24 @@ { hardware.graphics = { enable = true; + enable32Bit = true; # Recommended for legacy/32-bit support. extraPackages = with pkgs; [ - intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD - intel-vaapi-driver # For older processors. LIBVA_DRIVER_NAME=i965, works better for firefox/chromium? - vpl-gpu-rt # For Quick Sync Video + intel-media-driver # Intel Vulkan/media driver (Gen9+ iGPUs). + intel-vaapi-driver # For older processors. LIBVA_DRIVER_NAME=i965, works better for firefox/chromium? + vpl-gpu-rt # For Quick Sync Video + vulkan-loader # Core Vulkan runtime. + vulkan-tools # Diagnostic tools (for example, `vulkaninfo`). + mesa # Open-source Vulkan drivers (RADV for AMD, ANV for Intel). + amdvlk # AMD's official Vulkan driver (alternative to RADV). ]; }; + + hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [ + vulkan-loader # Vulkan runtime (32-bit). + driversi686Linux.mesa # 32-bit Vulkan drivers for AMD/Intel. + driversi686Linux.intel-media-driver # Intel 32-bit media driver. + driversi686Linux.amdvlk # 32-bit support for AMD's official Vulkan driver. + ]; + environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; # Optionally, set the environment variable }