Loading nixos/modules/services/monitoring/prometheus/exporters.nix +1 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ let "junos-czerwonk" "kea" "keylight" "klipper" "knot" "lnd" "mail" Loading nixos/modules/services/monitoring/prometheus/exporters/klipper.nix 0 → 100644 +55 −0 Original line number Diff line number Diff line { config, lib, pkgs, ... }: let cfg = config.services.prometheus.exporters.klipper; inherit (lib) mkOption mkMerge mkIf types concatStringsSep any optionalString ; moonraker = config.services.moonraker; in { port = 9101; extraOpts = { package = lib.mkPackageOption pkgs "prometheus-klipper-exporter" { }; moonrakerApiKey = mkOption { type = types.str; default = ""; description = '' API Key to authenticate with the Moonraker APIs. Only needed if the host running the exporter is not a trusted client to Moonraker. ''; }; }; serviceOpts = mkMerge ( [ { serviceConfig = { ExecStart = concatStringsSep " " [ "${cfg.package}/bin/prometheus-klipper-exporter" (optionalString (cfg.moonrakerApiKey != "") "--moonraker.apikey ${cfg.moonrakerApiKey}") "--web.listen-address ${cfg.listenAddress}:${toString cfg.port}" "${concatStringsSep " " cfg.extraFlags}" ]; }; } ] ++ [ (mkIf config.services.moonraker.enable { after = [ "moonraker.service" ]; requires = [ "moonraker.service" ]; }) ] ); } pkgs/by-name/pr/prometheus-klipper-exporter/package.nix 0 → 100644 +34 −0 Original line number Diff line number Diff line { lib, buildGoModule, fetchFromGitHub, nixosTests, }: buildGoModule rec { pname = "prometheus-klipper-exporter"; version = "0.11.2"; src = fetchFromGitHub { owner = "scross01"; repo = "prometheus-klipper-exporter"; rev = "v${version}"; sha256 = "sha256-ow7bzgaY4pYccslITlkNBKfZBJv9uwPk25I1Y3bnjbU="; }; vendorHash = "sha256-0nbLHZ2WMLMK0zKZuUYz355K01Xspn9svmlFCtQjed0="; doCheck = true; passthru.tests = { inherit (nixosTests.prometheus-exporters) process; }; meta = with lib; { description = " Prometheus Exporter for Klipper "; homepage = "https://github.com/scross01/prometheus-klipper-exporter"; license = licenses.mit; maintainers = with maintainers; [ wulfsta ]; platforms = platforms.linux; }; } Loading
nixos/modules/services/monitoring/prometheus/exporters.nix +1 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ let "junos-czerwonk" "kea" "keylight" "klipper" "knot" "lnd" "mail" Loading
nixos/modules/services/monitoring/prometheus/exporters/klipper.nix 0 → 100644 +55 −0 Original line number Diff line number Diff line { config, lib, pkgs, ... }: let cfg = config.services.prometheus.exporters.klipper; inherit (lib) mkOption mkMerge mkIf types concatStringsSep any optionalString ; moonraker = config.services.moonraker; in { port = 9101; extraOpts = { package = lib.mkPackageOption pkgs "prometheus-klipper-exporter" { }; moonrakerApiKey = mkOption { type = types.str; default = ""; description = '' API Key to authenticate with the Moonraker APIs. Only needed if the host running the exporter is not a trusted client to Moonraker. ''; }; }; serviceOpts = mkMerge ( [ { serviceConfig = { ExecStart = concatStringsSep " " [ "${cfg.package}/bin/prometheus-klipper-exporter" (optionalString (cfg.moonrakerApiKey != "") "--moonraker.apikey ${cfg.moonrakerApiKey}") "--web.listen-address ${cfg.listenAddress}:${toString cfg.port}" "${concatStringsSep " " cfg.extraFlags}" ]; }; } ] ++ [ (mkIf config.services.moonraker.enable { after = [ "moonraker.service" ]; requires = [ "moonraker.service" ]; }) ] ); }
pkgs/by-name/pr/prometheus-klipper-exporter/package.nix 0 → 100644 +34 −0 Original line number Diff line number Diff line { lib, buildGoModule, fetchFromGitHub, nixosTests, }: buildGoModule rec { pname = "prometheus-klipper-exporter"; version = "0.11.2"; src = fetchFromGitHub { owner = "scross01"; repo = "prometheus-klipper-exporter"; rev = "v${version}"; sha256 = "sha256-ow7bzgaY4pYccslITlkNBKfZBJv9uwPk25I1Y3bnjbU="; }; vendorHash = "sha256-0nbLHZ2WMLMK0zKZuUYz355K01Xspn9svmlFCtQjed0="; doCheck = true; passthru.tests = { inherit (nixosTests.prometheus-exporters) process; }; meta = with lib; { description = " Prometheus Exporter for Klipper "; homepage = "https://github.com/scross01/prometheus-klipper-exporter"; license = licenses.mit; maintainers = with maintainers; [ wulfsta ]; platforms = platforms.linux; }; }