2021-07-08 20:37:08 +01:00
|
|
|
{ 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 {
|
2021-10-20 12:26:28 +01:00
|
|
|
# Load the i2c-dev module
|
|
|
|
boot.kernelModules = [ "i2c_dev" ];
|
|
|
|
|
2021-07-08 20:37:08 +01:00
|
|
|
# Give users access to the "gddccontrol" tool
|
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.ddccontrol
|
|
|
|
];
|
|
|
|
|
|
|
|
services.dbus.packages = [
|
|
|
|
pkgs.ddccontrol
|
|
|
|
];
|
|
|
|
|
|
|
|
systemd.packages = [
|
|
|
|
pkgs.ddccontrol
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|