1 { config, lib, pkgs, ... }:
4 cfg = config.programs.light;
11 enable = lib.mkOption {
13 type = lib.types.bool;
15 Whether to install Light backlight control command
16 and udev rules granting access to members of the "video" group.
21 enable = lib.mkOption {
22 type = lib.types.bool;
25 Whether to enable brightness control with keyboard keys.
27 This is mainly useful for minimalistic (desktop) environments. You
28 may want to leave this disabled if you run a feature-rich desktop
29 environment such as KDE, GNOME or Xfce as those handle the
30 brightness keys themselves. However, enabling brightness control
31 with this setting makes the control independent of X, so the keys
32 work in non-graphical ttys, so you might want to consider using this
33 instead of the default offered by the desktop environment.
35 Enabling this will turn on {option}`services.actkbd`.
43 The percentage value by which to increase/decrease brightness.
52 config = lib.mkIf cfg.enable {
53 environment.systemPackages = [ pkgs.light ];
54 services.udev.packages = [ pkgs.light ];
55 services.actkbd = lib.mkIf cfg.brightnessKeys.enable {
58 light = "${pkgs.light}/bin/light";
59 step = builtins.toString cfg.brightnessKeys.step;
64 # Use minimum brightness 0.1 so the display won't go totally black.
65 command = "${light} -N 0.1 && ${light} -U ${step}";
70 command = "${light} -A ${step}";