light-control: fix log level

This commit is contained in:
Ingolf Wagner 2020-06-04 01:44:50 +02:00
parent 24fea3101a
commit b972289a3f
Signed by: palo
GPG key ID: 76BF5F1928B9618B
2 changed files with 6 additions and 1 deletions

View file

@ -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";

View file

@ -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}
'';