From 7517ecd7016cd451fe334718443387242d01642c Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Tue, 26 May 2020 21:50:05 +0800 Subject: [PATCH 1/2] powerdevil: add DDC support --- pkgs/desktops/plasma-5/powerdevil.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/desktops/plasma-5/powerdevil.nix b/pkgs/desktops/plasma-5/powerdevil.nix index 65fc5446c16..e53e986060f 100644 --- a/pkgs/desktops/plasma-5/powerdevil.nix +++ b/pkgs/desktops/plasma-5/powerdevil.nix @@ -3,7 +3,7 @@ extra-cmake-modules, kdoctools, bluez-qt, kactivities, kauth, kconfig, kdbusaddons, kdelibs4support, kglobalaccel, ki18n, kidletime, kio, knotifyconfig, kwayland, libkscreen, - networkmanager-qt, plasma-workspace, qtx11extras, solid, udev + ddcutil, networkmanager-qt, plasma-workspace, qtx11extras, solid, udev }: mkDerivation { @@ -13,5 +13,9 @@ mkDerivation { kconfig kdbusaddons knotifyconfig solid udev bluez-qt kactivities kauth kdelibs4support kglobalaccel ki18n kio kidletime kwayland libkscreen networkmanager-qt plasma-workspace qtx11extras + ddcutil + ]; + cmakeFlags = [ + "-DHAVE_DDCUTIL=On" ]; } From a3aec35383b5a4bfd89035b6d2501e03d647772e Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Tue, 26 May 2020 22:13:33 +0800 Subject: [PATCH 2/2] nixos/plasma: support setting brightness via DDC --- .../services/x11/desktop-managers/plasma5.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 60ef0159ff1..6d48b899d23 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -158,6 +158,19 @@ in example = "vlc"; description = "Phonon audio backend to install."; }; + + supportDDC = mkOption { + type = types.bool; + default = false; + description = '' + Support setting monitor brightness via DDC. + + + This is not needed for controlling brightness of the internal monitor + of a laptop and as it is considered experimental by upstream, it is + disabled by default. + ''; + }; }; }; @@ -184,6 +197,12 @@ in }; }; + # DDC support + boot.kernelModules = lib.optional cfg.supportDDC "i2c_dev"; + services.udev.extraRules = lib.optionalString cfg.supportDDC '' + KERNEL=="i2c-[0-9]*", TAG+="uaccess" + ''; + environment.systemPackages = with pkgs; with qt5; with libsForQt5; with plasma5; with kdeApplications; [ frameworkintegration