diff --git a/configs/pepe/home-assistant/light-control.nix b/configs/pepe/home-assistant/light-control.nix index 6e2c47d..9e691ed 100644 --- a/configs/pepe/home-assistant/light-control.nix +++ b/configs/pepe/home-assistant/light-control.nix @@ -1,6 +1,7 @@ { pkgs, lib, config, ... }: { services.mqtt.light-control.enable = true; + services.mqtt.light-control.loglevel = "debug"; services.mqtt.light-control.config = { credentials = { host = "tcp://localhost:1883"; diff --git a/modules/services/light-control.nix b/modules/services/light-control.nix index 6a1b2ab..6d01dcc 100644 --- a/modules/services/light-control.nix +++ b/modules/services/light-control.nix @@ -32,6 +32,10 @@ in { options.services.mqtt.light-control = { enable = mkEnableOption "enable mqtt.light-control"; + loglevel = mkOption { + default = "info"; + type = with types; enum [ "info" "trace" "debug" "error" "warning" ]; + }; config = mkMagicMergeOption { description = "configuration of light-control"; }; }; @@ -39,7 +43,7 @@ in { config = mkIf cfg.enable { systemd.services."light-control" = { wantedBy = [ "multi-user.target" ]; - environment = { RUST_LOG = "light_control=trace"; }; + environment = { RUST_LOG = "light_control=${cfg.loglevel}"; }; script = '' ${pkgs.light-control}/bin/light-control ${lightControlConfig} '';