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
# 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 [