git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/plasma: support setting brightness via DDC
commita3aec35383b5a4bfd89035b6d2501e03d647772e authorPeter Hoeg <peter@hoeg.com> dateTue 26 May 2020, 22:13 (6 years ago) parent7517ecd
1 file changed+19
nixos/modules/services/x11/desktop-managers/plasma5.nix+19
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