# DDC/CI helper + i2c-dev + ddcutil (implementation under `package/`).
{ ... }: {
  flake.nixosModules.systemMonitorInput =
    { config, lib, pkgs, ... }:
    let
      cfg = config.chiasson.system.monitorInput;
      monitorInputPkg = pkgs.callPackage ./package { };
    in
    {
      options.chiasson.system.monitorInput.enable = lib.mkEnableOption ''
        `i2c-dev`, ddcutil, and `monitor-input` for DDC/CI input switching.
      '';

      config = lib.mkIf cfg.enable {
        boot.kernelModules = [ "i2c-dev" ];
        environment.systemPackages = [
          pkgs.ddcutil
          monitorInputPkg
        ];
      };
    };
}
