diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 326428b95c3..7910e47ca0c 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -383,6 +383,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 diff --git a/nixos/modules/services/hardware/ddccontrol.nix b/nixos/modules/services/hardware/ddccontrol.nix new file mode 100644 index 00000000000..766bf12ee9f --- /dev/null +++ b/nixos/modules/services/hardware/ddccontrol.nix @@ -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 + ]; + }; +} diff --git a/pkgs/tools/misc/ddccontrol/default.nix b/pkgs/tools/misc/ddccontrol/default.nix index b7d0f2c3aad..2a85c0dc2b8 100644 --- a/pkgs/tools/misc/ddccontrol/default.nix +++ b/pkgs/tools/misc/ddccontrol/default.nix @@ -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"