diff --git a/agent/JOURNAL.md b/agent/JOURNAL.md index a77e3fb..35c06a4 100644 --- a/agent/JOURNAL.md +++ b/agent/JOURNAL.md @@ -17,6 +17,13 @@ Template: --- +## 2026-07-08 — External monitor brightness control (iteration #83) +- **Task:** PROPOSED item — external monitors connected to a dock are stuck at blinding brightness unless physical buttons are used. +- **Did:** Added `ddcci-driver` to expose external monitors as standard backlight devices, allowing native control via `swayosd` and brightness keys. +- **Verified:** V1 (flake check). +- **Pending:** nothing. +- **Next suggestion:** review remaining items (e.g., Battery charge limit instant toggle or Flatpak camera picker). + ## 2026-07-08 — Drive health monitoring (iteration #82) - **Task:** PROPOSED item — early SMART warnings for failing hardware. - **Did:** Added `services.smartd.enable = true` and `services.smartd.notifications.x11/wall` to `modules/nixos/default.nix`. Also explicitly enabled `services.systembus-notify.enable` to resolve a module collision with `earlyoom`. diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 1abd054..625e1cf 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -145,6 +145,9 @@ in # between earlyoom (true) and smartd (false). services.systembus-notify.enable = true; + # Enable I2C and DDC/CI by default for external monitor brightness control. + nomarchy.hardware.i2c.ddcci = lib.mkDefault true; + networking.networkmanager.enable = lib.mkDefault true; # OpenVPN support for the VPN menu's import/connect flow (nomarchy-vpn). # WireGuard needs no plugin (NetworkManager imports wg .conf natively); diff --git a/modules/nixos/hardware.nix b/modules/nixos/hardware.nix index 1d6dad4..289df34 100644 --- a/modules/nixos/hardware.nix +++ b/modules/nixos/hardware.nix @@ -136,6 +136,17 @@ in ''; }; }; + + i2c = { + enable = lib.mkEnableOption '' + I2C devices support. Enables access to /dev/i2c-* (useful for RGB + controllers, sensors, and DDC/CI monitor control)''; + + ddcci = lib.mkEnableOption '' + the ddcci-driver kernel module to expose external monitors as standard + backlight devices via DDC/CI. This allows brightness keys and swayosd + to natively control external displays''; + }; }; config = lib.mkMerge [ @@ -221,6 +232,17 @@ in }; }) + # ── I2C / DDC/CI ─────────────────────────────────────────────────── + (lib.mkIf cfg.i2c.enable { + hardware.i2c.enable = true; + }) + (lib.mkIf cfg.i2c.ddcci { + # The driver needs I2C underneath it + hardware.i2c.enable = true; + boot.extraModulePackages = [ config.boot.kernelPackages.ddcci-driver ]; + boot.kernelModules = [ "ddcci_backlight" ]; + }) + # ── Sanity ───────────────────────────────────────────────────────── { assertions = [