From fc1e0e863c60dc9740304de36ffa883cbaddd760 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 8 Jul 2021 21:37:08 +0200 Subject: nixos/ddccontrol: init --- nixos/modules/module-list.nix | 1 + nixos/modules/services/hardware/ddccontrol.nix | 36 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 nixos/modules/services/hardware/ddccontrol.nix (limited to 'nixos/modules') diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 980e7027c98..2b42eda4cf3 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -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 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 + ]; + }; +} -- cgit 1.4.1