2024-11-06 06:16:37 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
options,
|
|
|
|
...
|
|
|
|
}:
|
2022-12-16 00:59:45 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2024-11-06 06:16:37 +01:00
|
|
|
config = lib.optionalAttrs (options ? hardware.display) {
|
|
|
|
hardware.display = {
|
|
|
|
edid.packages = [ chip_edid ];
|
2024-08-05 01:27:42 +02:00
|
|
|
|
2024-11-06 06:16:37 +01:00
|
|
|
outputs = {
|
|
|
|
# For some reason, the internal display is sometimes eDP-1, and sometimes it's eDP-2
|
|
|
|
"eDP-1".edid = "16ach6h.bin";
|
|
|
|
"eDP-2".edid = "16ach6h.bin";
|
|
|
|
};
|
2024-08-05 01:27:42 +02:00
|
|
|
};
|
2022-12-16 00:59:45 +01:00
|
|
|
|
2024-11-06 06:16:37 +01:00
|
|
|
# This fails at the moment, https://github.com/NixOS/nixos-hardware/issues/795
|
|
|
|
# Extra refresh rates seem to work regardless
|
|
|
|
# boot.initrd.extraFiles."lib/firmware/edid/16ach6h.bin".source = pkgs.runCommandLocal "chip_edid" { } "cp ${./16ach6h.bin} $out";
|
|
|
|
};
|
2024-01-19 19:46:38 +01:00
|
|
|
}
|