Skip to content

Commit

Permalink
prometheus-folder-size-exporter: init at 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetrucciani committed Mar 25, 2024
1 parent 874c4dc commit 4eedc7a
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions pkgs/server/prometheus-folder-size-exporter.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ lib
, rustPlatform
, fetchFromGitHub
, stdenv
, darwin
}:

rustPlatform.buildRustPackage rec {
pname = "prometheus-folder-size-exporter";
version = "0.5.0";

src = fetchFromGitHub {
owner = "MindFlavor";
repo = "prometheus_folder_size_exporter";
rev = version;
hash = "sha256-G1oWGiTyftloPxgOuiYFO7hofHdbwPCG4QDXK1t5qWk=";
};

postPatch = ''
# patch to use gauge instead of counter
# from https://github.com/MindFlavor/prometheus_folder_size_exporter/pull/18/files
sed -i -E 's/(MetricType::)Counter/\1Gauge/g' ./src/main.rs
'';

cargoHash = "sha256-M9kvf0XNDtBzvCHVDs+JPC+oNTsWuDFKdjqVgNUnRLg=";

buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];

meta = with lib; {
description = "A Rust only folder size exporter for Prometheus (Grafana";
homepage = "https://github.com/MindFlavor/prometheus_folder_size_exporter";
license = licenses.mit;
maintainers = with maintainers; [ jpetrucciani ];
mainProgram = "prometheus_folder_size_exporter";
};
}

0 comments on commit 4eedc7a

Please sign in to comment.