summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/stats/telegraf/airsensor.nix
blob: 09d23e7d4fea7006de48d8d230a83b96f04c199e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ pkgs, ...}:

{
  services.udev.extraRules = ''
    SUBSYSTEMS=="usb", ATTRS{product}=="iAQ Stick", GROUP="input"
  '';
  users.users.telegraf.extraGroups = [ "input" ];
  services.telegraf.extraConfig.inputs.exec = [
    {
      commands = [ "${pkgs.airsensor-py}/bin/airsensor-py"];
      timeout = "10s";
      data_format = "value";
      data_type = "integer";
      name_override = "airquality";
      interval = "10s";
      tags.unit="VOC";
    }
  ];
}