git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #88942 from peterhoeg/m/kde_ddc

powerdevil: add DDC support

commitad0df8414e35ffbc73fdb884f546c472b02ea7c8 authorPeter Hoeg <peter@hoeg.com> dateThu 28 May 2020, 19:14 (6 years ago) parenteb2a77aa3aec35
2 files changed+24−1
nixos/modules/services/x11/desktop-managers/plasma5.nix+19 pkgs/desktops/plasma-5/powerdevil.nix+5−1
nixos/modules/services/x11/desktop-managers/plasma5.nix+19
@@ -158,6 +158,19 @@ in
158158 example = "vlc";
159159 description = "Phonon audio backend to install.";
160160 };
161+
162+ supportDDC = mkOption {
163+ type = types.bool;
164+ default = false;
165+ description = ''
166+ Support setting monitor brightness via DDC.
167+ </para>
168+ <para>
169+ This is not needed for controlling brightness of the internal monitor
170+ of a laptop and as it is considered experimental by upstream, it is
171+ disabled by default.
172+ '';
173+ };
161174 };
162175
163176 };
@@ -184,6 +197,12 @@ in
184197 };
185198 };
186199
200+ # DDC support
201+ boot.kernelModules = lib.optional cfg.supportDDC "i2c_dev";
202+ services.udev.extraRules = lib.optionalString cfg.supportDDC ''
203+ KERNEL=="i2c-[0-9]*", TAG+="uaccess"
204+ '';
205+
187206 environment.systemPackages = with pkgs; with qt5; with libsForQt5; with plasma5; with kdeApplications;
188207 [
189208 frameworkintegration
pkgs/desktops/plasma-5/powerdevil.nix+5−1
@@ -3,7 +3,7 @@
33 extra-cmake-modules, kdoctools,
44 bluez-qt, kactivities, kauth, kconfig, kdbusaddons, kdelibs4support,
55 kglobalaccel, ki18n, kidletime, kio, knotifyconfig, kwayland, libkscreen,
6− networkmanager-qt, plasma-workspace, qtx11extras, solid, udev
6+ ddcutil, networkmanager-qt, plasma-workspace, qtx11extras, solid, udev
77}:
88
99mkDerivation {
@@ -13,5 +13,9 @@ mkDerivation {
1313 kconfig kdbusaddons knotifyconfig solid udev bluez-qt kactivities kauth
1414 kdelibs4support kglobalaccel ki18n kio kidletime kwayland libkscreen
1515 networkmanager-qt plasma-workspace qtx11extras
16+ ddcutil
17+ ];
18+ cmakeFlags = [
19+ "-DHAVE_DDCUTIL=On"
1620 ];
1721}