From f92d5bec9bc069fa58f14a98dec3f7e7f3c99597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 6 Nov 2024 06:16:37 +0100 Subject: [PATCH] fix eval with 24.05 --- lenovo/legion/16ach6h/edid/default.nix | 30 +++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lenovo/legion/16ach6h/edid/default.nix b/lenovo/legion/16ach6h/edid/default.nix index 481d1f5c3..f536d90c2 100644 --- a/lenovo/legion/16ach6h/edid/default.nix +++ b/lenovo/legion/16ach6h/edid/default.nix @@ -1,4 +1,9 @@ -{ pkgs, ... }: +{ + pkgs, + lib, + options, + ... +}: let # This file was obtained from the display while "DDG" mode was enabled. @@ -8,18 +13,19 @@ let ''; in { - hardware.display = { - edid.packages = [ chip_edid ]; + config = lib.optionalAttrs (options ? hardware.display) { + hardware.display = { + edid.packages = [ chip_edid ]; - 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"; + 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"; + }; }; - }; - - # 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"; + # 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"; + }; }