summary refs log tree commit diff
path: root/nixos/modules/services/hardware/ddccontrol.nix
blob: 766bf12ee9f0b1b106df1606e4657e7d43e09b94 (plain) (blame)
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
{ config
, lib
, pkgs
, ...
}:

let
  cfg = config.services.ddccontrol;
in

{
  ###### interface

  options = {
    services.ddccontrol = {
      enable = lib.mkEnableOption "ddccontrol for controlling displays";
    };
  };

  ###### implementation

  config = lib.mkIf cfg.enable {
    # Give users access to the "gddccontrol" tool
    environment.systemPackages = [
      pkgs.ddccontrol
    ];

    services.dbus.packages = [
      pkgs.ddccontrol
    ];

    systemd.packages = [
      pkgs.ddccontrol
    ];
  };
}