From a377fb23dc22097a120f10a281074ef0f678901b Mon Sep 17 00:00:00 2001 From: Luflosi Date: Thu, 15 Feb 2024 21:12:20 +0100 Subject: [PATCH] cpu/amd/igpu: change condition to check actually used kernel version Change condition to check actually used kernel version instead of which kernel version is the default. Without this change, if a user changes the kernel version to a newer version, the kernel parameter will not actually be added. --- common/cpu/amd/raphael/igpu.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/cpu/amd/raphael/igpu.nix b/common/cpu/amd/raphael/igpu.nix index 6faffd0..b094077 100644 --- a/common/cpu/amd/raphael/igpu.nix +++ b/common/cpu/amd/raphael/igpu.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, ... }: +{ lib, pkgs, config, ... }: { # Sets the kernel version to the latest kernel to make the usage of the iGPU possible if your kernel version is too old @@ -10,10 +10,9 @@ boot = lib.mkMerge [ (lib.mkIf (lib.versionOlder pkgs.linux.version "6.1") { kernelPackages = pkgs.linuxPackages_latest; - kernelParams = ["amdgpu.sg_display=0"]; }) - (lib.mkIf (lib.versionAtLeast pkgs.linux.version "6.2") { + (lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.2") { kernelParams = ["amdgpu.sg_display=0"]; }) ];