Commit c3392ad3 authored by Peter Hoeg's avatar Peter Hoeg
Browse files

nixos/prometheus-smartctl-exporter: providing the path to the binary is no longer needed

parent 0bab1a6d
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -2,14 +2,17 @@

let
  cfg = config.services.prometheus.exporters.smartctl;

  inherit (lib) mkOption types literalExpression;

  args = lib.escapeShellArgs ([
    "--web.listen-address=${cfg.listenAddress}:${toString cfg.port}"
    "--smartctl.path=${pkgs.smartmontools}/bin/smartctl"
    "--smartctl.interval=${cfg.maxInterval}"
  ] ++ map (device: "--smartctl.device=${device}") cfg.devices
  ++ cfg.extraFlags);
in {

in
{
  port = 9633;

  extraOpts = {
@@ -24,6 +27,7 @@ in {
        all disks if none given.
      '';
    };

    maxInterval = mkOption {
      type = types.str;
      default = "60s";
@@ -50,9 +54,7 @@ in {
        "block-sd rw"
        "char-nvme rw"
      ];
      ExecStart = ''
        ${pkgs.prometheus-smartctl-exporter}/bin/smartctl_exporter ${args}
      '';
      ExecStart = "${pkgs.prometheus-smartctl-exporter}/bin/smartctl_exporter ${args}";
      PrivateDevices = lib.mkForce false;
      ProtectProc = "invisible";
      ProcSubset = "pid";