light-control: fix log level
This commit is contained in:
parent
24fea3101a
commit
b972289a3f
2 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
{ pkgs, lib, config, ... }: {
|
{ pkgs, lib, config, ... }: {
|
||||||
|
|
||||||
services.mqtt.light-control.enable = true;
|
services.mqtt.light-control.enable = true;
|
||||||
|
services.mqtt.light-control.loglevel = "debug";
|
||||||
services.mqtt.light-control.config = {
|
services.mqtt.light-control.config = {
|
||||||
credentials = {
|
credentials = {
|
||||||
host = "tcp://localhost:1883";
|
host = "tcp://localhost:1883";
|
||||||
|
|
|
@ -32,6 +32,10 @@ in {
|
||||||
|
|
||||||
options.services.mqtt.light-control = {
|
options.services.mqtt.light-control = {
|
||||||
enable = mkEnableOption "enable mqtt.light-control";
|
enable = mkEnableOption "enable mqtt.light-control";
|
||||||
|
loglevel = mkOption {
|
||||||
|
default = "info";
|
||||||
|
type = with types; enum [ "info" "trace" "debug" "error" "warning" ];
|
||||||
|
};
|
||||||
config =
|
config =
|
||||||
mkMagicMergeOption { description = "configuration of light-control"; };
|
mkMagicMergeOption { description = "configuration of light-control"; };
|
||||||
};
|
};
|
||||||
|
@ -39,7 +43,7 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.services."light-control" = {
|
systemd.services."light-control" = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
environment = { RUST_LOG = "light_control=trace"; };
|
environment = { RUST_LOG = "light_control=${cfg.loglevel}"; };
|
||||||
script = ''
|
script = ''
|
||||||
${pkgs.light-control}/bin/light-control ${lightControlConfig}
|
${pkgs.light-control}/bin/light-control ${lightControlConfig}
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue