2021-07-14 22:03:04 +00:00
|
|
|
{ config
|
|
|
|
, lib
|
|
|
|
, pkgs
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.ddccontrol;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
services.ddccontrol = {
|
2022-09-09 14:08:57 +00:00
|
|
|
enable = lib.mkEnableOption (lib.mdDoc "ddccontrol for controlling displays");
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2022-02-10 20:34:41 +00:00
|
|
|
# Load the i2c-dev module
|
|
|
|
boot.kernelModules = [ "i2c_dev" ];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
# Give users access to the "gddccontrol" tool
|
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.ddccontrol
|
|
|
|
];
|
|
|
|
|
|
|
|
services.dbus.packages = [
|
|
|
|
pkgs.ddccontrol
|
|
|
|
];
|
|
|
|
|
|
|
|
systemd.packages = [
|
|
|
|
pkgs.ddccontrol
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|