From 596882c402553b004b0e033527e9195c562eef98 Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Tue, 7 Sep 2021 11:56:15 +0300 Subject: [PATCH] change hardware conf --- modules/boot.nix | 10 ---------- modules/hardware.nix | 12 +++++++++--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/modules/boot.nix b/modules/boot.nix index a874d60..9884a57 100644 --- a/modules/boot.nix +++ b/modules/boot.nix @@ -5,20 +5,10 @@ # efi.canTouchEfiVariables = true; }; - # kernelPackages = if config.deviceSpecific.isVM then - # pkgs.linuxPackages - # else - # # pkgs.linuxPackages_latest; - # pkgs.linuxPackages; # FIXME kernelPackages = pkgs.linuxPackages_latest; supportedFilesystems = [ "ntfs" ]; - initrd.kernelModules = if config.deviceSpecific.devInfo.gpu.vendor == "intel" then - [ "i915" ] - else - [ ]; - extraModprobeConfig = lib.mkIf (config.device == "AMD-Workstation") '' options snd slots=snd_virtuoso,snd_usb_audio ''; diff --git a/modules/hardware.nix b/modules/hardware.nix index 1195b53..f1d66cb 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -15,18 +15,24 @@ with config.deviceSpecific; { driSupport32Bit = true; extraPackages = if devInfo.gpu.vendor == "intel" then [ pkgs.intel-media-driver - ] else if devInfo.gpu.vendor == "intel" then [ + ] else if devInfo.gpu.vendor == "amd" then [ + pkgs.rocm-opencl-icd + pkgs.rocm-opencl-runtime pkgs.amdvlk ] else [ ]; extraPackages32 = lib.mkIf (devInfo.gpu.vendor == "amd") [ pkgs.driversi686Linux.amdvlk ]; }; - environment.sessionVariables = { + environment.sessionVariables = lib.mkIf (devInfo.gpu.vendor == "intel") { GST_VAAPI_ALL_DRIVERS = "1"; LIBVA_DRIVER_NAME = "iHD"; }; - boot.initrd.kernelModules = lib.mkIf (devInfo.gpu.vendor == "amd") [ "amdgpu" ]; + boot.initrd.kernelModules = if devInfo.gpu.vendor == "amd" then [ + "amdgpu" + ] else if devInfo.gpu.vendor == "intel" then [ + i915 + ] else [ ]; # environment.systemPackages = if devInfo.gpu.vendor == "amd" then # # [ (pkgs.mesa.override { enableRadv = true; }) ] # [ pkgs.mesa ]