diff --git a/lenovo/legion/16ach6h/default.nix b/lenovo/legion/16ach6h/default.nix index db13b9f..afdc7d9 100644 --- a/lenovo/legion/16ach6h/default.nix +++ b/lenovo/legion/16ach6h/default.nix @@ -7,8 +7,11 @@ ../../../common/gpu/nvidia/prime.nix ../../../common/pc/laptop ../../../common/pc/laptop/ssd + ./edid ]; + hardware.amdgpu.loadInInitrd = lib.mkDefault false; + hardware.nvidia.prime = { amdgpuBusId = "PCI:6:0:0"; nvidiaBusId = "PCI:1:0:0"; diff --git a/lenovo/legion/16ach6h/edid/16ach6h.bin b/lenovo/legion/16ach6h/edid/16ach6h.bin new file mode 100644 index 0000000..8725613 Binary files /dev/null and b/lenovo/legion/16ach6h/edid/16ach6h.bin differ diff --git a/lenovo/legion/16ach6h/edid/default.nix b/lenovo/legion/16ach6h/edid/default.nix new file mode 100644 index 0000000..d9d8b52 --- /dev/null +++ b/lenovo/legion/16ach6h/edid/default.nix @@ -0,0 +1,15 @@ +{ config, pkgs, lib, ...}: + +let + # This file was obtained from the display while "DDG" mode was enabled. + chip_edid = pkgs.runCommandNoCC "chip_edid" { } '' + mkdir -p $out/lib/firmware/edid + cp ${./16ach6h.bin} $out/lib/firmware/edid/16ach6h.bin + ''; +in +{ + hardware.firmware = [ chip_edid ]; + + boot.kernelParams = [ "drm.edid_firmware=edid/16ach6h.bin" ]; + boot.initrd.extraFiles."lib/firmware/edid/16ach6h.bin".source = pkgs.runCommandLocal "chip_edid" { } "cp ${./16ach6h.bin} $out"; +} \ No newline at end of file