summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-07-10 16:37:25 +0200
committerGitHub <noreply@github.com>2021-07-10 16:37:25 +0200
commita85e99d1e14b0d43df4c135c095c922964385f58 (patch)
tree33d73782b60fea155814ea1771e15cc936c70c0f /nixos/modules
parent8d8d78f1f684b6f7176073c23d34b4fc472d5d54 (diff)
parentfc1e0e863c60dc9740304de36ffa883cbaddd760 (diff)
downloadnixpkgs-a85e99d1e14b0d43df4c135c095c922964385f58.tar
nixpkgs-a85e99d1e14b0d43df4c135c095c922964385f58.tar.gz
nixpkgs-a85e99d1e14b0d43df4c135c095c922964385f58.tar.bz2
nixpkgs-a85e99d1e14b0d43df4c135c095c922964385f58.tar.lz
nixpkgs-a85e99d1e14b0d43df4c135c095c922964385f58.tar.xz
nixpkgs-a85e99d1e14b0d43df4c135c095c922964385f58.tar.zst
nixpkgs-a85e99d1e14b0d43df4c135c095c922964385f58.zip
Merge pull request #129684 from jtojnar/ddccontrol-module
nixos/ddccontrol: init
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/hardware/ddccontrol.nix36
2 files changed, 37 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index be640f53eb6..f510f395161 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
+    ];
+  };
+}