Merge pull request #129684 from jtojnar/ddccontrol-module

nixos/ddccontrol: init
This commit is contained in:
Jan Tojnar 2021-07-10 16:37:25 +02:00 committed by GitHub
commit a85e99d1e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 0 deletions

View file

@ -388,6 +388,7 @@
./services/hardware/bluetooth.nix
./services/hardware/bolt.nix
./services/hardware/brltty.nix
./services/hardware/ddccontrol.nix
./services/hardware/fancontrol.nix
./services/hardware/freefall.nix
./services/hardware/fwupd.nix

View file

@ -0,0 +1,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
];
};
}

View file

@ -34,6 +34,10 @@ stdenv.mkDerivation rec {
ddccontrol-db
];
configureFlags = [
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
];
prePatch = ''
oldPath="\$""{datadir}/ddccontrol-db"
newPath="${ddccontrol-db}/share/ddccontrol-db"