mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-01 11:22:58 +00:00
40 lines
592 B
Nix
40 lines
592 B
Nix
{ 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 {
|
|
# Load the i2c-dev module
|
|
boot.kernelModules = [ "i2c_dev" ];
|
|
|
|
# Give users access to the "gddccontrol" tool
|
|
environment.systemPackages = [
|
|
pkgs.ddccontrol
|
|
];
|
|
|
|
services.dbus.packages = [
|
|
pkgs.ddccontrol
|
|
];
|
|
|
|
systemd.packages = [
|
|
pkgs.ddccontrol
|
|
];
|
|
};
|
|
}
|