From 078e8ea33d29af21bad55313d75d716db8d5a617 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Tue, 19 Aug 2025 21:46:07 -0500 Subject: make ddcutil toggleable --- modules/root/software/ddcutil.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'modules/root/software/ddcutil.nix') diff --git a/modules/root/software/ddcutil.nix b/modules/root/software/ddcutil.nix index 93e0af5..0c62370 100644 --- a/modules/root/software/ddcutil.nix +++ b/modules/root/software/ddcutil.nix @@ -1,6 +1,10 @@ -{ pkgs, ... }: { - hardware.i2c.enable = true; - environment.systemPackages = with pkgs; [ - ddcutil - ]; +{ pkgs, lib, config ... }: { + options = { + programs.ddcutil.enable = lib.mkEnableOption "enables ddcutil and i2c control"; + }; + + config = lib.mkIf programs.ddcutil.enable { + hardware.i2c.enable = true; + environment.systemPackages = [ pkgs.ddcutil ]; + } } -- cgit v1.2.3