@@ -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