2024-04-20 13:42:06 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
2022-04-29 02:12:16 +00:00
|
|
|
|
2023-04-15 16:58:37 +00:00
|
|
|
config = lib.mkIf config.gui.enable {
|
|
|
|
|
2024-04-20 13:42:06 +00:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
ddcutil # Monitor brightness control
|
|
|
|
];
|
2023-04-15 16:58:37 +00:00
|
|
|
|
|
|
|
# Reduce blue light at night
|
|
|
|
services.redshift = {
|
|
|
|
enable = true;
|
|
|
|
brightness = {
|
|
|
|
day = "1.0";
|
|
|
|
night = "1.0";
|
2022-12-21 21:18:03 +00:00
|
|
|
};
|
2023-04-15 16:58:37 +00:00
|
|
|
};
|
2022-04-29 02:12:16 +00:00
|
|
|
|
2023-04-15 16:58:37 +00:00
|
|
|
# Detect monitors (brightness) for ddcutil
|
|
|
|
hardware.i2c.enable = true;
|
|
|
|
|
|
|
|
# Grant main user access to external monitors
|
|
|
|
users.users.${config.user}.extraGroups = [ "i2c" ];
|
|
|
|
|
|
|
|
services.xserver.displayManager = {
|
|
|
|
|
|
|
|
# Put the login screen on the left monitor
|
|
|
|
lightdm.greeters.gtk.extraConfig = ''
|
|
|
|
active-monitor=0
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Set up screen position and rotation
|
|
|
|
setupCommands = ''
|
|
|
|
${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-1 \
|
|
|
|
--mode 1920x1200 \
|
|
|
|
--pos 1920x0 \
|
|
|
|
--rotate left \
|
2024-03-19 02:48:12 +00:00
|
|
|
--output HDMI-A-0 \
|
2023-04-15 16:58:37 +00:00
|
|
|
--primary \
|
|
|
|
--mode 1920x1080 \
|
|
|
|
--pos 0x560 \
|
|
|
|
--rotate normal \
|
|
|
|
--output DVI-0 --off \
|
|
|
|
--output DVI-1 --off \
|
|
|
|
'';
|
2022-12-21 21:18:03 +00:00
|
|
|
};
|
2023-04-15 16:58:37 +00:00
|
|
|
};
|
2022-04-29 02:12:16 +00:00
|
|
|
}
|