summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/hardware/illum.nix
blob: c36143a9975ca28d765b40b1515c7297f96eeee6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.services.illum;
in
{

  options = {

    services.illum = {

      enable = lib.mkOption {
        default = false;
        type = lib.types.bool;
        description = ''
          Enable illum, a daemon for controlling screen brightness with brightness buttons.
        '';
      };

    };

  };

  config = lib.mkIf cfg.enable {

    systemd.services.illum = {
      description = "Backlight Adjustment Service";
      wantedBy = [ "multi-user.target" ];
      serviceConfig.ExecStart = "${pkgs.illum}/bin/illum-d";
      serviceConfig.Restart = "on-failure";
    };

  };

}