From 688389edebdd028581796551c0c3b557ffc185ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Mon, 20 Oct 2025 00:11:26 +0800 Subject: [PATCH] vanadium/display: use lib.mkMerge --- nix/configurations/vanadium/nixos/display.nix | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/nix/configurations/vanadium/nixos/display.nix b/nix/configurations/vanadium/nixos/display.nix index 7bd85283..88eed034 100644 --- a/nix/configurations/vanadium/nixos/display.nix +++ b/nix/configurations/vanadium/nixos/display.nix @@ -85,7 +85,7 @@ # Note: the "position" field corresponds to the "pos" field outputted by autorandr # To get the current config, run `xrandr --auto` and then `autorandr --config` configs = { - allOff = lib.genAttrs devices.all (_: {enable = false;}); + allOff = lib.genAttrs devices.all (_: {enable = lib.mkDefault false;}); enableBuiltin = { eDP-1 = { enable = true; @@ -109,27 +109,37 @@ frameworkBuiltin = { fingerprint = fingerprints.built-in; - config = configs.allOff // configs.enableBuiltin; + config = lib.mkMerge [ + configs.allOff + configs.enableBuiltin + ]; hooks.postswitch = switches.setDPI {dpi = 150;}; }; mkAsusProfile = name: { - fingerprint = fingerprints.built-in // fingerprints.asus-monitor name; - config = configs.allOff // configs.enableDevice name; - hooks.postswitch = - switches.setDPI {dpi = 110;} - // switches.setSoftwareBrightness { + fingerprint = lib.mkMerge [ + fingerprints.built-in + (fingerprints.asus-monitor name) + ]; + config = lib.mkMerge [ + configs.allOff + (configs.enableDevice name) + ]; + hooks.postswitch = lib.mkMerge [ + (switches.setDPI {dpi = 110;}) + (switches.setSoftwareBrightness { device = name; brightness = 1; - } - // switches.setDDCBrightness { + }) + (switches.setDDCBrightness { modelName = "VG27AQL3A"; brightness = 0; - } - // switches.setDDCContrast { + }) + (switches.setDDCContrast { modelName = "VG27AQL3A"; contrast = 0.5; - }; + }) + ]; }; in lib.mkMerge [