diff --git a/services.nix b/services.nix index 1e920ef..a40d926 100644 --- a/services.nix +++ b/services.nix @@ -63,6 +63,9 @@ in system = {}; disk = {}; ipmi_sensor = { path = "${pkgs.ipmitool}/bin/ipmitool"; }; + smart = { + path = "${pkgs.writeShellScriptBin "smartctl" "/run/wrappers/bin/sudo ${pkgs.smartmontools}/bin/smartctl $@"}/bin/smartctl"; + }; }; outputs = { influxdb = { database = "telegraf"; urls = [ "http://localhost:8086" ]; }; @@ -73,6 +76,10 @@ in KERNEL=="ipmi*", MODE="660", OWNER="telegraf" ''; + security.sudo.extraRules = [ + { commands = [ { command = "${pkgs.smartmontools}/bin/smartctl"; options = [ "NOPASSWD" ]; } ]; users = [ "telegraf" ]; } + ]; + services.grafana.enable = true; services.grafana.addr = "127.0.0.1"; services.grafana.dataDir = "/var/lib/grafana";