vanadium/display: use lib.mkMerge

This commit is contained in:
Primrose 2025-10-20 00:11:26 +08:00
parent 5fd498fbed
commit 688389edeb
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -85,7 +85,7 @@
# Note: the "position" field corresponds to the "pos" field outputted by autorandr # Note: the "position" field corresponds to the "pos" field outputted by autorandr
# To get the current config, run `xrandr --auto` and then `autorandr --config` # To get the current config, run `xrandr --auto` and then `autorandr --config`
configs = { configs = {
allOff = lib.genAttrs devices.all (_: {enable = false;}); allOff = lib.genAttrs devices.all (_: {enable = lib.mkDefault false;});
enableBuiltin = { enableBuiltin = {
eDP-1 = { eDP-1 = {
enable = true; enable = true;
@ -109,27 +109,37 @@
frameworkBuiltin = { frameworkBuiltin = {
fingerprint = fingerprints.built-in; fingerprint = fingerprints.built-in;
config = configs.allOff // configs.enableBuiltin; config = lib.mkMerge [
configs.allOff
configs.enableBuiltin
];
hooks.postswitch = switches.setDPI {dpi = 150;}; hooks.postswitch = switches.setDPI {dpi = 150;};
}; };
mkAsusProfile = name: { mkAsusProfile = name: {
fingerprint = fingerprints.built-in // fingerprints.asus-monitor name; fingerprint = lib.mkMerge [
config = configs.allOff // configs.enableDevice name; fingerprints.built-in
hooks.postswitch = (fingerprints.asus-monitor name)
switches.setDPI {dpi = 110;} ];
// switches.setSoftwareBrightness { config = lib.mkMerge [
configs.allOff
(configs.enableDevice name)
];
hooks.postswitch = lib.mkMerge [
(switches.setDPI {dpi = 110;})
(switches.setSoftwareBrightness {
device = name; device = name;
brightness = 1; brightness = 1;
} })
// switches.setDDCBrightness { (switches.setDDCBrightness {
modelName = "VG27AQL3A"; modelName = "VG27AQL3A";
brightness = 0; brightness = 0;
} })
// switches.setDDCContrast { (switches.setDDCContrast {
modelName = "VG27AQL3A"; modelName = "VG27AQL3A";
contrast = 0.5; contrast = 0.5;
}; })
];
}; };
in in
lib.mkMerge [ lib.mkMerge [