uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,44 @@
{ lib, go, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "alertmanager";
version = "0.24.0";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "alertmanager";
sha256 = "sha256-hoCE0wD9/Sh/oBce7kCg/wG44FmMs6dAKnEYP+2sH0w=";
};
vendorSha256 = "sha256-ePb9qdCTEHHIV6JlbrBlaZjD5APwQuoGloO88W5S7Oc=";
subPackages = [ "cmd/alertmanager" "cmd/amtool" ];
ldflags = let t = "github.com/prometheus/common/version"; in [
"-X ${t}.Version=${version}"
"-X ${t}.Revision=${src.rev}"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
"-X ${t}.GoVersion=${lib.getVersion go}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
$out/bin/amtool --completion-script-bash > amtool.bash
installShellCompletion amtool.bash
$out/bin/amtool --completion-script-zsh > amtool.zsh
installShellCompletion amtool.zsh
'';
meta = with lib; {
description = "Alert dispatcher for the Prometheus monitoring system";
homepage = "https://github.com/prometheus/alertmanager";
license = licenses.asl20;
maintainers = with maintainers; [ benley fpletz globin Frostman ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,24 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "apcupsd-exporter";
version = "0.3.0";
src = fetchFromGitHub {
owner = "mdlayher";
repo = "apcupsd_exporter";
rev = "v${version}";
sha256 = "sha256-c0LsUqpJbmWQmbmSGdEy7Bbk20my6iWNLeqtU5BjYlw=";
};
vendorSha256 = "sha256-bvLwHLviIAGmxYY1O0wFDWAMginEUklicrbjIbbPuUw=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) apcupsd; };
meta = with lib; {
description = "Provides a Prometheus exporter for the apcupsd Network Information Server (NIS)";
homepage = "https://github.com/mdlayher/apcupsd_exporter";
license = licenses.mit;
maintainers = with maintainers; [ _1000101 mdlayher ];
};
}

View file

@ -0,0 +1,35 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "artifactory_exporter";
version = "1.9.1";
rev = "v${version}";
src = fetchFromGitHub {
owner = "peimanja";
repo = pname;
rev = rev;
sha256 = "1m68isplrs3zvkg0mans9bgablsif6264x3w475bpnhf68r87v1q";
};
vendorSha256 = "0acwgb0h89parkx75jp057m2hrqyd95vr2zcfqnxbnyy98gxip73";
subPackages = [ "." ];
ldflags = [
"-s" "-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=${rev}"
"-X github.com/prometheus/common/version.Branch=master"
"-X github.com/prometheus/common/version.BuildDate=19700101-00:00:00"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) artifactory; };
meta = with lib; {
description = "JFrog Artifactory Prometheus Exporter";
homepage = "https://github.com/peimanja/artifactory_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ lbpdt ];
};
}

View file

@ -0,0 +1,24 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "aws-s3-exporter";
version = "0.5.0";
src = fetchFromGitHub {
owner = "ribbybibby";
repo = "s3_exporter";
rev = "v${version}";
sha256 = "sha256-dYkMCCAIlFDFOFUNJd4NvtAeJDTsHeJoH90b5pSGlQE=";
};
vendorSha256 = null;
ldflags = [ "-s" "-w" ];
meta = with lib; {
description = "Exports Prometheus metrics about S3 buckets and objects";
homepage = "https://github.com/ribbybibby/s3_exporter";
license = licenses.asl20;
maintainers = [ maintainers.mmahut ];
};
}

View file

@ -0,0 +1,25 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "bind_exporter";
version = "0.5.0";
src = fetchFromGitHub {
rev = "v${version}";
owner = "prometheus-community";
repo = "bind_exporter";
sha256 = "sha256-ta+uy0FUEMcL4SW1K3v2j2bfDRmdAIz42MKPsNj4FbA=";
};
vendorSha256 = "sha256-L0jZM83u423tiLf7kcqnXsQi7QBvNEXhuU+IwXXAhE0=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) bind; };
meta = with lib; {
description = "Prometheus exporter for bind9 server";
homepage = "https://github.com/digitalocean/bind_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ rtreffer ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,24 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "bird-exporter";
version = "1.4.1";
src = fetchFromGitHub {
owner = "czerwonk";
repo = "bird_exporter";
rev = version;
sha256 = "sha256-QCnOMiAcvn0HcppGJlf3sdllApKcjHpucvk9xxD/MqE=";
};
vendorSha256 = "sha256-jBwaneVv1a8iIqnhDbQOnvaJdnXgO8P90Iv51IfGaM0=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) bird; };
meta = with lib; {
description = "Prometheus exporter for the bird routing daemon";
homepage = "https://github.com/czerwonk/bird_exporter";
license = licenses.mit;
maintainers = with maintainers; [ lukegb ];
};
}

View file

@ -0,0 +1,42 @@
{ lib, fetchFromGitHub, fetchpatch, python3Packages }:
python3Packages.buildPythonApplication rec {
pname = "bitcoin-prometheus-exporter";
version = "0.5.0";
format = "other";
src = fetchFromGitHub {
owner = "jvstein";
repo = pname;
rev = "v${version}";
sha256 = "0l0j6dyb0vflh386z3g8srysay5sf47g5rg2f5xrkckv86rjr115";
};
patches = [
# remove after update to new release
(fetchpatch {
name = "configurable-listening-address.patch";
url = "https://patch-diff.githubusercontent.com/raw/jvstein/bitcoin-prometheus-exporter/pull/11.patch";
sha256 = "0a2l8aqgprc1d5k8yg1gisn6imh9hzg6j0irid3pjvp5i5dcnhyq";
})
];
propagatedBuildInputs = with python3Packages; [ prometheus-client bitcoinlib riprova ];
installPhase = ''
mkdir -p $out/bin
cp bitcoind-monitor.py $out/bin/
mkdir -p $out/share/${pname}
cp -r dashboard README.md $out/share/${pname}/
'';
meta = with lib; {
description = "Prometheus exporter for Bitcoin Core nodes";
homepage = "https://github.com/jvstein/bitcoin-prometheus-exporter";
license = licenses.bsd3;
maintainers = with maintainers; [ mmilata ];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,39 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "blackbox_exporter";
version = "0.20.0";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "blackbox_exporter";
sha256 = "sha256-Y3HdFIChkQVooxy2I2Gbqw3WLHsI4Zm+osHTzFluRZA=";
};
vendorSha256 = "sha256-KFLR0In4txQQp5dt8P0yAFtf82b4SBq2xMnlz+vMuuU=";
# dns-lookup is performed for the tests
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) blackbox; };
ldflags = [
"-s"
"-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=${rev}"
"-X github.com/prometheus/common/version.Branch=unknown"
"-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
"-X github.com/prometheus/common/version.BuildDate=unknown"
];
meta = with lib; {
description = "Blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP";
homepage = "https://github.com/prometheus/blackbox_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ globin fpletz willibutz Frostman ma27 ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,26 @@
{ lib, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "collectd-exporter";
version = "0.5.0";
rev = version;
goPackagePath = "github.com/prometheus/collectd_exporter";
src = fetchFromGitHub {
rev = "v${version}";
owner = "prometheus";
repo = "collectd_exporter";
sha256 = "0vb6vnd2j87iqxdl86j30dk65vrv4scprv200xb83203aprngqgh";
};
passthru.tests = { inherit (nixosTests.prometheus-exporters) collectd; };
meta = with lib; {
description = "Relay server for exporting metrics from collectd to Prometheus";
homepage = "https://github.com/prometheus/collectd_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ benley fpletz ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,25 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "consul_exporter";
version = "0.8.0";
src = fetchFromGitHub {
owner = "prometheus";
repo = "consul_exporter";
rev = "v${version}";
sha256 = "sha256-5odAKMWK2tDZ3a+bIVIdPgzxrW64hF8nNqItGO7sODI=";
};
vendorSha256 = "sha256-vbaiHeQRo9hsHa/10f4202xLe9mduELRJMCDFuyKlW0=";
ldflags = [ "-s" "-w" ];
meta = with lib; {
description = "Prometheus exporter for Consul metrics";
homepage = "https://github.com/prometheus/consul_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ hectorj ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,134 @@
{ stdenv
, lib
, go
, pkgs
, buildGoModule
, fetchFromGitHub
, fetchurl
, nixosTests
, enableAWS ? true
, enableAzure ? true
, enableConsul ? true
, enableDigitalOcean ? true
, enableEureka ? true
, enableGCE ? true
, enableHetzner ? true
, enableKubernetes ? true
, enableLinode ? true
, enableMarathon ? true
, enableMoby ? true
, enableOpenstack ? true
, enablePuppetDB ? true
, enableScaleway ? true
, enableTriton ? true
, enableUyuni ? true
, enableXDS ? true
, enableZookeeper ? true
}:
let
version = "2.35.0";
webUiStatic = fetchurl {
url = "https://github.com/prometheus/prometheus/releases/download/v${version}/prometheus-web-ui-${version}.tar.gz";
sha256 = "sha256-66zWOjFTYwmspiKeklt3NAAT1uJJrZqeyQvWWsCN9fQ=";
};
in
buildGoModule rec {
pname = "prometheus";
inherit version;
src = fetchFromGitHub {
rev = "v${version}";
owner = "prometheus";
repo = "prometheus";
sha256 = "sha256-h0uBs3xMKpRH3A1VG5xrhjXVAT7GL5L3UZWb3HJ2Fz4=";
};
vendorSha256 = "sha256-0I6hmjhdfB41rWOQ9FM9CMq5w5437ka/jLuFXcBQBlM=";
excludedPackages = [ "documentation/prometheus-mixin" ];
postPatch = ''
tar -C web/ui -xzf ${webUiStatic}
patchShebangs scripts
# Enable only select service discovery to shrink binaries.
(
true # prevent bash syntax error when all plugins are disabled
${lib.optionalString (enableAWS)
"echo - github.com/prometheus/prometheus/discovery/aws"}
${lib.optionalString (enableAzure)
"echo - github.com/prometheus/prometheus/discovery/azure"}
${lib.optionalString (enableConsul)
"echo - github.com/prometheus/prometheus/discovery/consul"}
${lib.optionalString (enableDigitalOcean)
"echo - github.com/prometheus/prometheus/discovery/digitalocean"}
${lib.optionalString (enableEureka)
"echo - github.com/prometheus/prometheus/discovery/eureka"}
${lib.optionalString (enableGCE)
"echo - github.com/prometheus/prometheus/discovery/gce"}
${lib.optionalString (enableHetzner)
"echo - github.com/prometheus/prometheus/discovery/hetzner"}
${lib.optionalString (enableKubernetes)
"echo - github.com/prometheus/prometheus/discovery/kubernetes"}
${lib.optionalString (enableLinode)
"echo - github.com/prometheus/prometheus/discovery/linode"}
${lib.optionalString (enableMarathon)
"echo - github.com/prometheus/prometheus/discovery/marathon"}
${lib.optionalString (enableMoby)
"echo - github.com/prometheus/prometheus/discovery/moby"}
${lib.optionalString (enableOpenstack)
"echo - github.com/prometheus/prometheus/discovery/openstack"}
${lib.optionalString (enablePuppetDB)
"echo - github.com/prometheus/prometheus/discovery/puppetdb"}
${lib.optionalString (enableScaleway)
"echo - github.com/prometheus/prometheus/discovery/scaleway"}
${lib.optionalString (enableTriton)
"echo - github.com/prometheus/prometheus/discovery/triton"}
${lib.optionalString (enableUyuni)
"echo - github.com/prometheus/prometheus/discovery/uyuni"}
${lib.optionalString (enableXDS)
"echo - github.com/prometheus/prometheus/discovery/xds"}
${lib.optionalString (enableZookeeper)
"echo - github.com/prometheus/prometheus/discovery/zookeeper"}
) > plugins.yml
'';
preBuild = ''
if [[ -d vendor ]]; then make -o assets assets-compress plugins; fi
'';
tags = [ "builtinassets" ];
ldflags =
let
t = "github.com/prometheus/common/version";
in
[
"-X ${t}.Version=${version}"
"-X ${t}.Revision=unknown"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
"-X ${t}.GoVersion=${lib.getVersion go}"
];
preInstall = ''
mkdir -p "$out/share/doc/prometheus" "$out/etc/prometheus"
cp -a $src/documentation/* $out/share/doc/prometheus
cp -a $src/console_libraries $src/consoles $out/etc/prometheus
'';
doCheck = !stdenv.isDarwin; # https://hydra.nixos.org/build/130673870/nixlog/1
passthru.tests = { inherit (nixosTests) prometheus; };
meta = with lib; {
description = "Service monitoring system and time series database";
homepage = "https://prometheus.io";
license = licenses.asl20;
maintainers = with maintainers; [ benley fpletz globin willibutz Frostman ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,69 @@
{ lib
, python3
, fetchpatch
}:
python3.pkgs.buildPythonApplication rec {
pname = "dmarc-metrics-exporter";
version = "0.5.1";
disabled = python3.pythonOlder "3.7";
format = "pyproject";
src = python3.pkgs.fetchPypi {
inherit pname version;
sha256 = "22ec361f9a4c86abefbfab541f588597e21bf4fbedf2911f230e560b2ec3503a";
};
patches = [
# https://github.com/jgosmann/dmarc-metrics-exporter/pull/23
(fetchpatch {
url = "https://github.com/jgosmann/dmarc-metrics-exporter/commit/3fe401f5dfb9e0304601a2a89ac987ff853b7cba.patch";
hash = "sha256-MjVLlFQMp2r3AhBMu1lEmRm0Y2H9FdvCfPgAK5kvwWE=";
})
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'python = "^3.7,<3.10"' 'python = "^3.7,<3.11"' \
--replace poetry.masonry.api poetry.core.masonry.api \
--replace '"^' '">='
'';
nativeBuildInputs = with python3.pkgs; [
poetry-core
];
propagatedBuildInputs = with python3.pkgs; [
bite-parser
dataclasses-serialization
prometheus-client
typing-extensions
uvicorn
xsdata
];
checkInputs = with python3.pkgs; [
aiohttp
pytest-asyncio
pytestCheckHook
requests
];
disabledTestPaths = [
# require networking
"dmarc_metrics_exporter/tests/test_e2e.py"
"dmarc_metrics_exporter/tests/test_imap_client.py"
"dmarc_metrics_exporter/tests/test_imap_queue.py"
];
pythonImportsCheck = [ "dmarc_metrics_exporter" ];
meta = {
description = "Export Prometheus metrics from DMARC reports";
homepage = "https://github.com/jgosmann/dmarc-metrics-exporter";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ma27 ];
};
}

View file

@ -0,0 +1,26 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "dnsmasq_exporter";
version = "0.2.0";
src = fetchFromGitHub {
owner = "google";
repo = "dnsmasq_exporter";
sha256 = "1i7imid981l0a9k8lqyr9igm3qkk92kid4xzadkwry4857k6mgpj";
rev = "v${version}";
};
vendorSha256 = "1dqpa180pbdi2gcmp991d4cry560mx5rm5l9x065s9n9gnd38hvl";
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) dnsmasq; };
meta = with lib; {
inherit (src.meta) homepage;
description = "A dnsmasq exporter for Prometheus";
license = licenses.asl20;
maintainers = with maintainers; [ willibutz globin ma27 ];
};
}

View file

@ -0,0 +1,26 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "domain-exporter";
version = "1.11.0";
src = fetchFromGitHub {
owner = "caarlos0";
repo = "domain_exporter";
rev = "v${version}";
sha256 = "018y0xwdn2f2shhwaa0hqm4y8xsbqwif0733qb0377wpjbj4v137";
};
vendorSha256 = "0s1hs8byba9y57abg386n09wfg1wcqpzs164ap0km8ap2i96bdlb";
doCheck = false; # needs internet connection
passthru.tests = { inherit (nixosTests.prometheus-exporters) domain; };
meta = with lib; {
homepage = "https://github.com/caarlos0/domain_exporter";
description = "Exports the expiration time of your domains as prometheus metrics";
license = licenses.mit;
maintainers = with maintainers; [ mmilata prusnak ];
};
}

View file

@ -0,0 +1,102 @@
# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
[
{
goPackagePath = "github.com/alecthomas/template";
fetch = {
type = "git";
url = "https://github.com/alecthomas/template";
rev = "a0175ee3bccc567396460bf5acd36800cb10c49c";
sha256 = "0qjgvvh26vk1cyfq9fadyhfgdj36f1iapbmr5xp6zqipldz8ffxj";
};
}
{
goPackagePath = "github.com/alecthomas/units";
fetch = {
type = "git";
url = "https://github.com/alecthomas/units";
rev = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a";
sha256 = "1j65b91qb9sbrml9cpabfrcf07wmgzzghrl7809hjjhrmbzri5bl";
};
}
{
goPackagePath = "github.com/beorn7/perks";
fetch = {
type = "git";
url = "https://github.com/beorn7/perks";
rev = "3a771d992973f24aa725d07868b467d1ddfceafb";
sha256 = "1l2lns4f5jabp61201sh88zf3b0q793w4zdgp9nll7mmfcxxjif3";
};
}
{
goPackagePath = "github.com/gogo/protobuf";
fetch = {
type = "git";
url = "https://github.com/gogo/protobuf";
rev = "4aa4cc277ae58d2fab6cfe51dd17df5dceaf457d";
sha256 = "009z6rpivyakgsxs0zkm94c9i7l65hcw2ljvah94wq3y6v6j47gs";
};
}
{
goPackagePath = "github.com/golang/protobuf";
fetch = {
type = "git";
url = "https://github.com/golang/protobuf";
rev = "0f2620f554cf5c8e281a2eb655a035f5a0f6dc90";
sha256 = "0lxngq1a8cnsy6dlr6gi8pjv3fir2wiw76qh075pa9g02h7ywhv3";
};
}
{
goPackagePath = "github.com/matttproud/golang_protobuf_extensions";
fetch = {
type = "git";
url = "https://github.com/matttproud/golang_protobuf_extensions";
rev = "c12348ce28de40eed0136aa2b644d0ee0650e56c";
sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya";
};
}
{
goPackagePath = "github.com/prometheus/client_golang";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_golang";
rev = "b5bfa0eb2c8d46bd91dc58271e973c5f0bbebcfa";
sha256 = "1msxzkdgi0ing4ddmp0s4qrf267n6ylafw9mbz5yrr7spb1dgxgk";
};
}
{
goPackagePath = "github.com/prometheus/client_model";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_model";
rev = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f";
sha256 = "04psf81l9fjcwascsys428v03fx4fi894h7fhrj2vvcz723q57k0";
};
}
{
goPackagePath = "github.com/prometheus/common";
fetch = {
type = "git";
url = "https://github.com/prometheus/common";
rev = "c7de2306084e37d54b8be01f3541a8464345e9a5";
sha256 = "11dqfm2d0m4sjjgyrnayman96g59x2apmvvqby9qmww2qj2k83ig";
};
}
{
goPackagePath = "github.com/prometheus/procfs";
fetch = {
type = "git";
url = "https://github.com/prometheus/procfs";
rev = "05ee40e3a273f7245e8777337fc7b46e533a9a92";
sha256 = "0f6fnczxa42b9rys2h3l0m8fy3x5hrhaq707vq0lbx5fcylw8lis";
};
}
{
goPackagePath = "gopkg.in/alecthomas/kingpin.v2";
fetch = {
type = "git";
url = "https://gopkg.in/alecthomas/kingpin.v2";
rev = "947dcec5ba9c011838740e680966fd7087a71d0d";
sha256 = "0mndnv3hdngr3bxp7yxfd47cas4prv98sqw534mx7vp38gd88n5r";
};
}
]

View file

@ -0,0 +1,26 @@
{ lib, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "dovecot_exporter";
version = "0.1.3";
goPackagePath = "github.com/kumina/dovecot_exporter";
src = fetchFromGitHub {
owner = "kumina";
repo = "dovecot_exporter";
rev = version;
sha256 = "1lnxnnm45fhcyv40arcvpiiibwdnxdwhkf8sbjpifx1wspvphcj9";
};
goDeps = ./dovecot-exporter-deps.nix;
passthru.tests = { inherit (nixosTests.prometheus-exporters) dovecot; };
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus metrics exporter for Dovecot";
license = licenses.asl20;
maintainers = with maintainers; [ willibutz globin ];
};
}

View file

@ -0,0 +1,22 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "fastly-exporter";
version = "7.0.1";
src = fetchFromGitHub {
owner = "peterbourgon";
repo = pname;
rev = "v${version}";
sha256 = "sha256-KL+UfYuHtfQ9sKad7Q1KqIK4CFzDsIWvgG1YO1ZbUQc=";
};
vendorSha256 = "sha256-yE7yvnyDfrrFdBmBBYe2gBU7b4gOWl5kfqkoblE51EQ=";
meta = with lib; {
description = "Prometheus exporter for the Fastly Real-time Analytics API";
homepage = "https://github.com/peterbourgon/fastly-exporter";
license = licenses.asl20;
maintainers = teams.deshaw.members;
};
}

View file

@ -0,0 +1,23 @@
{ buildGoModule, fetchFromGitHub, lib }:
buildGoModule rec {
pname = "flow-exporter";
version = "1.1.1";
src = fetchFromGitHub {
rev = "v${version}";
owner = "neptune-networks";
repo = pname;
sha256 = "sha256-6FqupoYWRvex7XhM7ly8f7ICnuS9JvCRIVEBIJe+64k=";
};
vendorSha256 = "sha256-2raOUOPiMUMydIsfSsnwUAAiM7WyMio1NgL1EoADr2s=";
meta = with lib; {
description = "Export network flows from kafka to Prometheus";
homepage = "https://github.com/neptune-networks/flow-exporter";
license = licenses.mit;
maintainers = with maintainers; [ kloenk ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,27 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "fritzbox-exporter";
version = "unstable-2021-04-13";
src = fetchFromGitHub {
rev = "fd36539bd7db191b3734e17934b5f1e78e4e9829";
owner = "mxschmitt";
repo = "fritzbox_exporter";
sha256 = "0w9gdcnfc61q6mzm95i7kphsf1rngn8rb6kz1b6knrh5d8w61p1n";
};
subPackages = [ "cmd/exporter" ];
vendorSha256 = "0k6bd052pjfg5c1ba1yhni8msv3wl512vfzy2hrk49jibh8h052n";
passthru.tests = { inherit (nixosTests.prometheus-exporters) fritzbox; };
meta = with lib; {
description = "Prometheus Exporter for FRITZ!Box (TR64 and UPnP)";
homepage = "https://github.com/mxschmitt/fritzbox_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ bachp flokli sbruder ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,29 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "gitlab-ci-pipelines-exporter";
version = "0.5.3";
src = fetchFromGitHub {
owner = "mvisonneau";
repo = pname;
rev = "v${version}";
sha256 = "1i0ry93w2pk8m7i4fbdn1xvsmvjn83d6lr6l7yywid9d0kmkjz13";
};
subPackages = [ "cmd/${pname}" ];
ldflags = [
"-X main.version=v${version}"
];
vendorSha256 = "UszZaxql5sO4DSDVD/UIjeeDojCQEPF+ATL7O9MaTG8=";
doCheck = true;
meta = with lib; {
description = "Prometheus / OpenMetrics exporter for GitLab CI pipelines insights";
homepage = "https://github.com/mvisonneau/gitlab-ci-pipelines-exporter";
license = licenses.asl20;
maintainers = with maintainers; [ mmahut mvisonneau ];
};
}

View file

@ -0,0 +1,25 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "haproxy_exporter";
version = "0.13.0";
src = fetchFromGitHub {
owner = "prometheus";
repo = "haproxy_exporter";
rev = "v${version}";
sha256 = "sha256-F0yYUIKTIGyhzL0QwmioQYnWBb0GeFOhBwL3IqDKoQA=";
};
vendorSha256 = "sha256-iJ2doxsLqTitsKJg3PUFLzEtLlP5QckSdFZkXX3ALIE=";
ldflags = [ "-s" "-w" ];
meta = with lib; {
description = "HAProxy Exporter for the Prometheus monitoring system";
homepage = "https://github.com/prometheus/haproxy_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ benley fpletz ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,35 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "influxdb_exporter";
version = "0.8.0";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "influxdb_exporter";
sha256 = "sha256-aNj4ru3yDet+jdcEpckFVaymmjWmKzTMPcTxPMNFbgo=";
};
vendorSha256 = null;
ldflags = [
"-s"
"-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=${rev}"
"-X github.com/prometheus/common/version.Branch=unknown"
"-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
"-X github.com/prometheus/common/version.BuildDate=unknown"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) influxdb; };
meta = with lib; {
description = "Prometheus exporter that accepts InfluxDB metrics";
homepage = "https://github.com/prometheus/influxdb_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ hexa ];
};
}

View file

@ -0,0 +1,23 @@
{ lib, buildGoModule, fetchgit, nixosTests }:
buildGoModule rec {
pname = "jitsiexporter";
version = "0.2.18";
src = fetchgit {
url = "https://git.xsfx.dev/prometheus/jitsiexporter";
rev = "v${version}";
sha256 = "1cf46wp96d9dwlwlffcgbcr0v3xxxfdv6il0zqkm2i7cfsfw0skf";
};
vendorSha256 = null;
passthru.tests = { inherit (nixosTests.prometheus-exporters) jitsi; };
meta = with lib; {
description = "Export Jitsi Videobridge metrics to Prometheus";
homepage = "https://git.xsfx.dev/prometheus/jitsiexporter";
license = licenses.mit;
maintainers = with maintainers; [ petabyteboy ];
};
}

View file

@ -0,0 +1,34 @@
{ lib, stdenv, fetchurl, jre, makeWrapper }:
stdenv.mkDerivation rec {
pname = "jmx-prometheus-httpserver";
version = "0.15.0";
jarName = "jmx_prometheus_httpserver-${version}-jar-with-dependencies.jar";
src = fetchurl {
url = "mirror://maven/io/prometheus/jmx/jmx_prometheus_httpserver/${version}/${jarName}";
sha256 = "0fr3svn8kjp7bq1wzbkvv5awylwn8b01bngj04zvk7fpzqpgs7mz";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
dontUnpack = true;
installPhase = ''
mkdir -p $out/libexec
mkdir -p $out/bin
cp $src $out/libexec/$jarName
makeWrapper "${jre}/bin/java" $out/bin/jmx_prometheus_httpserver --add-flags "-jar $out/libexec/$jarName"
'';
meta = with lib; {
homepage = "https://github.com/prometheus/jmx_exporter";
description = "A process for exposing JMX Beans via HTTP for Prometheus consumption";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.asl20;
maintainers = [ maintainers.offline ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,25 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "prometheus-json-exporter";
version = "0.4.0";
src = fetchFromGitHub {
owner = "prometheus-community";
repo = "json_exporter";
rev = "v${version}";
sha256 = "sha256-BzzDa+5YIyaqG88AZumGVEbbHomcNWhVWhSrITdD6XA=";
};
vendorSha256 = "sha256-Xw5xsEwd+v2f4DBsjY4q0tzABgNo4NuEtiTMoZ/pFNE=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) json; };
meta = with lib; {
description = "A prometheus exporter which scrapes remote JSON by JSONPath";
homepage = "https://github.com/prometheus-community/json_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ willibutz ];
mainProgram = "json_exporter";
};
}

View file

@ -0,0 +1,33 @@
{ lib, python3Packages, nixosTests }:
python3Packages.buildPythonApplication rec {
pname = "kea-exporter";
version = "0.4.2";
src = python3Packages.fetchPypi {
inherit pname version;
sha256 = "0dpzicv0ksyda2lprldkj452c23qycl5c9avca6x7f7rbqry9pnd";
};
propagatedBuildInputs = with python3Packages; [
click
prometheus-client
];
checkPhase = ''
$out/bin/kea-exporter --help > /dev/null
$out/bin/kea-exporter --version | grep -q ${version}
'';
passthru.tests = {
inherit (nixosTests.prometheus-exporters) kea;
};
meta = with lib; {
description = "Export Kea Metrics in the Prometheus Exposition Format";
homepage = "https://github.com/mweinelt/kea-exporter";
license = licenses.mit;
maintainers = with maintainers; [ hexa ];
};
}

View file

@ -0,0 +1,26 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "keylight-exporter";
version = "0.1.1";
src = fetchFromGitHub {
owner = "mdlayher";
repo = "keylight_exporter";
rev = "v${version}";
sha256 = "141npawcnxj3sz2xqsnyf06r4x1azk3g55941i8gjr7pwcla34r7";
};
vendorSha256 = "0w065ls8dp687jmps4xdffcarss1wyls14dngr43g58xjw6519gb";
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) keylight; };
meta = with lib; {
homepage = "https://github.com/mdlayher/keylight_exporter";
description = "Prometheus exporter for Elgato Key Light devices";
license = licenses.mit;
maintainers = with maintainers; [ mdlayher ];
};
}

View file

@ -0,0 +1,39 @@
{ stdenv, fetchFromGitHub, lib, python3, nixosTests }:
stdenv.mkDerivation rec {
pname = "knot-exporter";
version = "unstable-2021-08-21";
src = fetchFromGitHub {
owner = "ghedo";
repo = "knot_exporter";
rev = "b18eb7db735b50280f0815497475f4c7092a6550";
sha256 = "sha256-FGzkO/KHDhkM3PA2urNQcrMi3MHADkd0YwAvu1jvfrU=";
};
dontBuild = true;
nativeBuildInputs = [ python3.pkgs.wrapPython ];
buildInputs = [ python3 ];
installPhase = ''
runHook preInstall
install -Dm0755 knot_exporter $out/bin/knot_exporter
patchShebangs $out/bin
buildPythonPath ${python3.pkgs.prometheus-client}
patchPythonScript $out/bin/knot_exporter
runHook postInstall
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) knot; };
meta = with lib; {
homepage = "https://github.com/ghedo/knot_exporter";
description = " Prometheus exporter for Knot DNS";
license = licenses.gpl3Only;
maintainers = with maintainers; [ ma27 ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,24 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "lndmon";
version = "unstable-2021-03-26";
src = fetchFromGitHub {
owner = "lightninglabs";
repo = "lndmon";
sha256 = "14lmmjq61p8yhc86swigs43risqi31vlmz7ri8j0n0fyp8lm2kxs";
rev = "3aa925aa4f633a6c4d132601922e78f173ae8ac1";
};
vendorSha256 = "06if387b9m02ciqgcissih1x06l33djp87vgspwzz589f77vczk8";
passthru.tests = { inherit (nixosTests.prometheus-exporters) lnd; };
meta = with lib; {
homepage = "https://github.com/lightninglabs/lndmon";
description = "Prometheus exporter for lnd (Lightning Network Daemon)";
license = licenses.mit;
maintainers = with maintainers; [ mmilata ];
};
}

View file

@ -0,0 +1,32 @@
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, nixosTests }:
buildGoModule {
pname = "mailexporter";
version = "2020-07-16";
src = fetchFromGitHub {
owner = "cherti";
repo = "mailexporter";
rev = "f5a552c736ac40ccdc0110d2e9a71619c1cd6862";
sha256 = "0y7sg9qrd7q6g5gi65sjvw6byfmk2ph0a281wjc9cr4pd25xkciz";
};
vendorSha256 = "1hwahk8v3qnmyn6bwk9l2zpr0k7p2w7zjzxmjwgjyx429g9rzqs0";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage $src/man/mailexporter.1
installManPage $src/man/mailexporter.conf.5
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) mail; };
meta = with lib; {
description = "Export Prometheus-style metrics about mail server functionality";
homepage = "https://github.com/cherti/mailexporter";
license = licenses.gpl3;
maintainers = with maintainers; [ willibutz globin ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,26 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "mikrotik-exporter-unstable";
version = "2021-08-10";
src = fetchFromGitHub {
owner = "nshttpd";
repo = "mikrotik-exporter";
sha256 = "1vqn1f159g0l76021gifbxpjf7zjhrj807qqqn51h5413lbi6r66";
rev = "4bfa7adfef500ff621a677adfab1f7010af920d1";
};
vendorSha256 = "0b244z3hly5726vwkr7vhdzzm2fi38cv1qh7nvfp3vpsxnii04md";
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) mikrotik; };
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus MikroTik device(s) exporter";
license = licenses.bsd3;
maintainers = with maintainers; [ mmilata ];
};
}

View file

@ -0,0 +1,35 @@
{ lib, buildGoPackage, fetchFromGitHub, fetchpatch }:
buildGoPackage rec {
pname = "minio-exporter";
version = "0.2.0";
rev = "v${version}";
goPackagePath = "github.com/joe-pll/minio-exporter";
src= fetchFromGitHub {
inherit rev;
owner = "joe-pll";
repo = "minio-exporter";
sha256 = "1my3ii5s479appiapw8gjzkq1pk62fl7d7if8ljvdj6qw4man6aa";
};
# Required to make 0.2.0 build against latest dependencies
# TODO: Remove on update to 0.3.0
patches = [
(fetchpatch {
url = "https://github.com/joe-pll/minio-exporter/commit/50ab89d42322dc3e2696326a9ae4d3f951f646de.patch";
sha256 = "0aiixhvb4x8c8abrlf1i4hmca9i6xd6b638a5vfkvawx0q7gxl97";
})
];
goDeps = ./deps.nix;
meta = with lib; {
description = "A Prometheus exporter for Minio cloud storage server";
homepage = "https://github.com/joe-pll/minio-exporter";
license = licenses.asl20;
maintainers = with maintainers; [ bachp ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,174 @@
# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
[
{
goPackagePath = "github.com/alecthomas/template";
fetch = {
type = "git";
url = "https://github.com/alecthomas/template";
rev = "a0175ee3bccc567396460bf5acd36800cb10c49c";
sha256 = "0qjgvvh26vk1cyfq9fadyhfgdj36f1iapbmr5xp6zqipldz8ffxj";
};
}
{
goPackagePath = "github.com/alecthomas/units";
fetch = {
type = "git";
url = "https://github.com/alecthomas/units";
rev = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a";
sha256 = "1j65b91qb9sbrml9cpabfrcf07wmgzzghrl7809hjjhrmbzri5bl";
};
}
{
goPackagePath = "github.com/beorn7/perks";
fetch = {
type = "git";
url = "https://github.com/beorn7/perks";
rev = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9";
sha256 = "1hrybsql68xw57brzj805xx2mghydpdiysv3gbhr7f5wlxj2514y";
};
}
{
goPackagePath = "github.com/go-ini/ini";
fetch = {
type = "git";
url = "https://github.com/go-ini/ini";
rev = "32e4c1e6bc4e7d0d8451aa6b75200d19e37a536a";
sha256 = "0mhgxw5q6b0pryhikx3k4wby7g32rwjjljzihi47lwn34kw5y1qn";
};
}
{
goPackagePath = "github.com/golang/protobuf";
fetch = {
type = "git";
url = "https://github.com/golang/protobuf";
rev = "1e59b77b52bf8e4b449a57e6f79f21226d571845";
sha256 = "19bkh81wnp6njg3931wky6hsnnl2d1ig20vfjxpv450sd3k6yys8";
};
}
{
goPackagePath = "github.com/matttproud/golang_protobuf_extensions";
fetch = {
type = "git";
url = "https://github.com/matttproud/golang_protobuf_extensions";
rev = "c12348ce28de40eed0136aa2b644d0ee0650e56c";
sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya";
};
}
{
goPackagePath = "github.com/minio/minio-go";
fetch = {
type = "git";
url = "https://github.com/minio/minio-go";
rev = "d218e4cb1bfc13dcef0eb5c3e74507a35be0dd3a";
sha256 = "0d3am33xaavdffz791qi2s0vnkpjw9vlr5p5g4lw7h5vhmy1sjb4";
};
}
{
goPackagePath = "github.com/minio/minio";
fetch = {
type = "git";
url = "https://github.com/minio/minio";
rev = "bb73c84b104bc447eb603d63481cdc54b8ab3c83";
sha256 = "1gjkgdf59yxfr2a7pl3f7z3iid86zsd85xqxcv1s0d46v7j07iga";
};
}
{
goPackagePath = "github.com/mitchellh/go-homedir";
fetch = {
type = "git";
url = "https://github.com/mitchellh/go-homedir";
rev = "b8bc1bf767474819792c23f32d8286a45736f1c6";
sha256 = "13ry4lylalkh4g2vny9cxwvryslzyzwp9r92z0b10idhdq3wad1q";
};
}
{
goPackagePath = "github.com/prometheus/client_golang";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_golang";
rev = "06bc6e01f4baf4ee783ffcd23abfcb0b0f9dfada";
sha256 = "0dvv21214sn702kc25y5l0gd9d11358976d3w31fgwx7456mjx26";
};
}
{
goPackagePath = "github.com/prometheus/client_model";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_model";
rev = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c";
sha256 = "19y4ywsivhpxj7ikf2j0gm9k3cmyw37qcbfi78n526jxcc7kw998";
};
}
{
goPackagePath = "github.com/prometheus/common";
fetch = {
type = "git";
url = "https://github.com/prometheus/common";
rev = "89604d197083d4781071d3c65855d24ecfb0a563";
sha256 = "169rdlaf2mk9z4fydz7ajmngyhmf3q1lk96yhvx46bn986x5xkyn";
};
}
{
goPackagePath = "github.com/prometheus/procfs";
fetch = {
type = "git";
url = "https://github.com/prometheus/procfs";
rev = "b15cd069a83443be3154b719d0cc9fe8117f09fb";
sha256 = "1cr45wg2m40bj2za8f32mq09rjlcnk5kfam0h0hr8wcb015k4wxj";
};
}
{
goPackagePath = "github.com/sirupsen/logrus";
fetch = {
type = "git";
url = "https://github.com/sirupsen/logrus";
rev = "d682213848ed68c0a260ca37d6dd5ace8423f5ba";
sha256 = "0nzyqwzx3k7nqfq8q7yv32gaf3ymq3bpwhkmw1hj2zakq5a93d8x";
};
}
{
goPackagePath = "golang.org/x/crypto";
fetch = {
type = "git";
url = "https://go.googlesource.com/crypto";
rev = "a6600008915114d9c087fad9f03d75087b1a74df";
sha256 = "099vyf8133bjwaqcv377d9akam3j5xwamwqrihmjhvzbvqs649yc";
};
}
{
goPackagePath = "golang.org/x/net";
fetch = {
type = "git";
url = "https://go.googlesource.com/net";
rev = "5ccada7d0a7ba9aeb5d3aca8d3501b4c2a509fec";
sha256 = "0bdwdxy2gz48icnh023r5fga3z4x6c8gry8jlfjqr5w12y3s281g";
};
}
{
goPackagePath = "golang.org/x/sys";
fetch = {
type = "git";
url = "https://go.googlesource.com/sys";
rev = "2c42eef0765b9837fbdab12011af7830f55f88f0";
sha256 = "0gj9nwryyzf9rn33gl3zm6rxvg1zhrhwi36akipqj37x4g86h3gz";
};
}
{
goPackagePath = "golang.org/x/text";
fetch = {
type = "git";
url = "https://go.googlesource.com/text";
rev = "e19ae1496984b1c655b8044a65c0300a3c878dd3";
sha256 = "1cvnnx8nwx5c7gr6ajs7sldhbqh52n7h6fsa3i21l2lhx6xrsh4w";
};
}
{
goPackagePath = "gopkg.in/alecthomas/kingpin.v2";
fetch = {
type = "git";
url = "https://gopkg.in/alecthomas/kingpin.v2";
rev = "947dcec5ba9c011838740e680966fd7087a71d0d";
sha256 = "0mndnv3hdngr3bxp7yxfd47cas4prv98sqw534mx7vp38gd88n5r";
};
}
]

View file

@ -0,0 +1,26 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "modemmanager-exporter";
version = "0.1.0";
src = fetchFromGitHub {
owner = "mdlayher";
repo = "modemmanager_exporter";
rev = "v${version}";
sha256 = "0d8z7qzk5j5jj0ixkwpi8dw9kki78mxrajdlzzcj2rcgbnwair91";
};
vendorSha256 = "0f6v97cvzdz7wygswpm87wf8r169x5rw28908vqhmqk644hli4zy";
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) modemmanager; };
meta = with lib; {
homepage = "https://github.com/mdlayher/modemmanager_exporter";
description = "Prometheus exporter for ModemManager and its devices";
license = licenses.mit;
maintainers = with maintainers; [ mdlayher ];
};
}

View file

@ -0,0 +1,38 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "mysqld_exporter";
version = "0.14.0";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "mysqld_exporter";
sha256 = "sha256-SMcpQNygv/jVLNuQP8V6BH/CmSt5Y4dzYPsboTH2dos=";
};
vendorSha256 = "sha256-M6u+ZBEUqCd6cKVHPvHqRiXLbuWz66GK+ybIQm+5tQE=";
ldflags = let t = "github.com/prometheus/common/version"; in [
"-s" "-w"
"-X ${t}.Version=${version}"
"-X ${t}.Revision=${rev}"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
];
# skips tests with external dependencies, e.g. on mysqld
preCheck = ''
buildFlagsArray+="-short"
'';
meta = with lib; {
description = "Prometheus exporter for MySQL server metrics";
homepage = "https://github.com/prometheus/mysqld_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ benley globin ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,26 @@
{ lib, fetchFromGitHub, buildGoModule, nixosTests, fetchpatch }:
buildGoModule rec {
pname = "prometheus-nextcloud-exporter";
version = "0.5.1";
src = fetchFromGitHub {
owner = "xperimental";
repo = "nextcloud-exporter";
rev = "v${version}";
sha256 = "18xvxx0aplkj7xzi0zfsz7a5d45hh8blfqb105360pknvvi6apjv";
};
vendorSha256 = "1wr1ckz0klk9sqpyk96h8bwr1dg6aiirr1l1f23kbib91pfpd08r";
passthru.tests = { inherit (nixosTests.prometheus-exporters) nextcloud; };
meta = with lib; {
description = "Prometheus exporter for Nextcloud servers";
homepage = "https://github.com/xperimental/nextcloud-exporter";
license = licenses.mit;
maintainers = with maintainers; [ willibutz ];
mainProgram = "nextcloud-exporter";
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,27 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "nginx_exporter";
version = "0.10.0";
src = fetchFromGitHub {
owner = "nginxinc";
repo = "nginx-prometheus-exporter";
rev = "v${version}";
sha256 = "sha256-k9sbMIn5N3EJ7ZlfmD9pRV6lfywnKyFvpxC/pGGgNTA=";
};
vendorSha256 = "sha256-SaaHbn97cb/d8symyrBYLzK+5ukVLfGrFiRIz+tKPhw=";
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
passthru.tests = { inherit (nixosTests.prometheus-exporters) nginx; };
meta = with lib; {
description = "NGINX Prometheus Exporter for NGINX and NGINX Plus";
homepage = "https://github.com/nginxinc/nginx-prometheus-exporter";
license = licenses.asl20;
maintainers = with maintainers; [ benley fpletz willibutz globin ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,26 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "nginxlog_exporter";
version = "1.9.2";
src = fetchFromGitHub {
owner = "martin-helmich";
repo = "prometheus-nginxlog-exporter";
rev = "v${version}";
sha256 = "sha256-rRmWy6c5bvmJO0h7uleabQnBLm8Qarp2iEBGfodGdKE=";
};
vendorSha256 = "sha256-5C5xQx8I5aHgi9P5gpHmPw6nV76D68/agVAP1vGab4w=";
subPackages = [ "." ];
passthru.tests = { inherit (nixosTests.prometheus-exporters) nginxlog; };
meta = with lib; {
description = "Export metrics from Nginx access log files to Prometheus";
homepage = "https://github.com/martin-helmich/prometheus-nginxlog-exporter";
license = licenses.asl20;
maintainers = with maintainers; [ mmahut ];
};
}

View file

@ -0,0 +1,50 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests
# darwin
, CoreFoundation, IOKit
}:
buildGoModule rec {
pname = "node_exporter";
version = "1.3.1";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "node_exporter";
sha256 = "sha256-+0k9LBsHqNHmoOAY1UDzbbqni+ikj+c3ijfT41rCfLc=";
};
vendorSha256 = "sha256-nAvODyy+PfkGFAaq+3hBhQaPji5GUMU7N8xcgbGQMeI=";
# FIXME: tests fail due to read-only nix store
doCheck = false;
buildInputs = lib.optionals stdenv.isDarwin [ CoreFoundation IOKit ];
# upstream currently doesn't work with the version of the macOS SDK
# we're building against in nix-darwin without a patch.
# this patch has been submitted upstream at https://github.com/prometheus/node_exporter/pull/2327
# and only needs to be carried until it lands in a new release.
patches = lib.optionals stdenv.isDarwin [ ./node-exporter/node-exporter-darwin.patch ];
excludedPackages = [ "docs/node-mixin" ];
ldflags = [
"-s"
"-w"
"-X github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/common/version.Revision=${rev}"
"-X github.com/prometheus/common/version.Branch=unknown"
"-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
"-X github.com/prometheus/common/version.BuildDate=unknown"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) node; };
meta = with lib; {
description = "Prometheus exporter for machine metrics";
homepage = "https://github.com/prometheus/node_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ benley fpletz globin Frostman ];
};
}

View file

@ -0,0 +1,17 @@
diff --git a/collector/powersupplyclass_darwin.go b/collector/powersupplyclass_darwin.go
index a070f64..01d7f18 100644
--- a/collector/powersupplyclass_darwin.go
+++ b/collector/powersupplyclass_darwin.go
@@ -18,9 +18,11 @@ package collector
/*
#cgo LDFLAGS: -framework IOKit -framework CoreFoundation
+#include <CoreFoundation/CFNumber.h>
+#include <CoreFoundation/CFRunLoop.h>
+#include <CoreFoundation/CFString.h>
#include <IOKit/ps/IOPowerSources.h>
#include <IOKit/ps/IOPSKeys.h>
-#include <CoreFoundation/CFArray.h>
// values collected from IOKit Power Source APIs
// Functions documentation available at

View file

@ -0,0 +1,30 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "openldap_exporter";
version = "2.2.1";
src = fetchFromGitHub {
owner = "tomcz";
repo = pname;
rev = "v${version}";
sha256 = "sha256-ok2fTYz1oQiNdTPsssPb/VuFqny1i8nKTngSpKgCpC4=";
};
vendorSha256 = null;
ldflags = [
"-s"
"-w"
"-X github.com/tomcz/openldap_exporter.tag=v${version}"
"-X github.com/tomcz/openldap_exporter.commit=unknown"
];
meta = with lib; {
homepage = "https://github.com/tomcz/openldap_exporter";
description = "Simple service that scrapes metrics from OpenLDAP and exports them via HTTP for Prometheus consumption";
license = licenses.mit;
maintainers = with maintainers; [ ma27 ];
};
}

View file

@ -0,0 +1,23 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "openvpn_exporter-unstable";
version = "0.3.0";
src = fetchFromGitHub {
owner = "kumina";
repo = "openvpn_exporter";
rev = "v${version}";
sha256 = "14m4n5918zimdnyf0yg2948jb1hp1bdf27k07j07x3yrx357i05l";
};
vendorSha256 = "1jgw0nnibydhcd83kp6jqkf41mhwldp8wdhqk0yjw18v9m0p7g5s";
meta = with lib; {
inherit (src.meta) homepage;
description = "Prometheus exporter for OpenVPN";
broken = true;
license = licenses.asl20;
maintainers = with maintainers; [ fpletz globin ];
};
}

View file

@ -0,0 +1,22 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "pihole-exporter";
version = "0.2.0";
src = fetchFromGitHub {
owner = "eko";
repo = pname;
rev = "v${version}";
sha256 = "sha256-JxznxE4Pq1fhlt3l1jbGWD5eUg5VF0GmewkuSYECG0Y=";
};
vendorSha256 = "sha256-jfpM192LtFGVgsVv+F+P8avTGD5c8I+7JFsn4oVoqr0=";
meta = with lib; {
description = "Prometheus exporter for PI-Hole's Raspberry PI ad blocker";
homepage = "https://github.com/eko/pihole-exporter";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}

View file

@ -0,0 +1,66 @@
# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
[
{
goPackagePath = "github.com/beorn7/perks";
fetch = {
type = "git";
url = "https://github.com/beorn7/perks";
rev = "3a771d992973f24aa725d07868b467d1ddfceafb";
sha256 = "1l2lns4f5jabp61201sh88zf3b0q793w4zdgp9nll7mmfcxxjif3";
};
}
{
goPackagePath = "github.com/golang/protobuf";
fetch = {
type = "git";
url = "https://github.com/golang/protobuf";
rev = "b4deda0973fb4c70b50d226b1af49f3da59f5265";
sha256 = "0ya4ha7m20bw048m1159ppqzlvda4x0vdprlbk5sdgmy74h3xcdq";
};
}
{
goPackagePath = "github.com/matttproud/golang_protobuf_extensions";
fetch = {
type = "git";
url = "https://github.com/matttproud/golang_protobuf_extensions";
rev = "c12348ce28de40eed0136aa2b644d0ee0650e56c";
sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya";
};
}
{
goPackagePath = "github.com/prometheus/client_golang";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_golang";
rev = "82f5ff156b29e276022b1a958f7d385870fb9814";
sha256 = "111j329yrlgvh73dm80gawwxsh9dgjkw74254kyj5c2rfmra7znz";
};
}
{
goPackagePath = "github.com/prometheus/client_model";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_model";
rev = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c";
sha256 = "19y4ywsivhpxj7ikf2j0gm9k3cmyw37qcbfi78n526jxcc7kw998";
};
}
{
goPackagePath = "github.com/prometheus/common";
fetch = {
type = "git";
url = "https://github.com/prometheus/common";
rev = "d811d2e9bf898806ecfb6ef6296774b13ffc314c";
sha256 = "0r4067r4ysmljksqw3awcxx5qplqhykahc5igdzgkky7i4bvaik1";
};
}
{
goPackagePath = "github.com/prometheus/procfs";
fetch = {
type = "git";
url = "https://github.com/prometheus/procfs";
rev = "8b1c2da0d56deffdbb9e48d4414b4e674bd8083e";
sha256 = "0x128p15h35mgwqxkigfkk1lfrcz9g697ahl8v6xp9kwvcqvjrrf";
};
}
]

View file

@ -0,0 +1,58 @@
{ lib, buildGoPackage, fetchFromGitHub, makeWrapper, nixosTests
, systemd, withSystemdSupport ? true }:
with lib;
buildGoPackage rec {
pname = "postfix_exporter";
version = "0.1.2";
goPackagePath = "github.com/kumina/postfix_exporter";
src = fetchFromGitHub {
owner = "kumina";
repo = "postfix_exporter";
rev = version;
sha256 = "1b9ib3scxni6hlw55wv6f0z1xfn27l0p29as24f71rs70pyzy4hm";
};
nativeBuildInputs = optional withSystemdSupport makeWrapper;
buildInputs = optional withSystemdSupport systemd;
tags = optional (!withSystemdSupport) "nosystemd";
goDeps = ./postfix-exporter-deps.nix;
extraSrcs = optionals withSystemdSupport [
{
goPackagePath = "github.com/coreos/go-systemd";
src = fetchFromGitHub {
owner = "coreos";
repo = "go-systemd";
rev = "d1b7d058aa2adfc795ad17ff4aaa2bc64ec11c78";
sha256 = "1nz3v1b90hnmj2vjjwq96pr6psxlndqjyd30v9sgiwygzb7db9mv";
};
}
{
goPackagePath = "github.com/coreos/pkg";
src = fetchFromGitHub {
owner = "coreos";
repo = "pkg";
rev = "97fdf19511ea361ae1c100dd393cc47f8dcfa1e1";
sha256 = "1srn87wih25l09f75483hnxsr8fc6rq3bk7w1x8125ym39p6mg21";
};
}
];
postInstall = optionalString withSystemdSupport ''
wrapProgram $out/bin/postfix_exporter \
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) postfix; };
meta = {
inherit (src.meta) homepage;
description = "A Prometheus exporter for Postfix";
license = licenses.asl20;
maintainers = with maintainers; [ willibutz globin ];
};
}

View file

@ -0,0 +1,26 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "postgres_exporter";
version = "0.10.1";
src = fetchFromGitHub {
owner = "prometheus-community";
repo = "postgres_exporter";
rev = "v${version}";
sha256 = "sha256-AH4nVwmNS4YtKxrWlFNqN+Q59TaSCGdoiCfpelPtJuM=";
};
vendorSha256 = "sha256-ST/Mc8RDEu2G6ufus8Gi7dwdBNIpaKJjn+Fw1AKCaXs=";
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) postgres; };
meta = with lib; {
inherit (src.meta) homepage;
description = "A Prometheus exporter for PostgreSQL";
license = licenses.asl20;
maintainers = with maintainers; [ fpletz globin willibutz ma27 ];
};
}

View file

@ -0,0 +1,31 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "process-exporter";
version = "0.7.10";
src = fetchFromGitHub {
owner = "ncabatoff";
repo = pname;
rev = "v${version}";
sha256 = "sha256-TAgMA9IV3i8dpgOBDmnlt4iyGlmWN5Nj3BexXb5vzlc=";
};
vendorSha256 = "sha256-LAEnXJ3qShfCGjtsYAGyW5x/TTFQxQxXM0hebJrqiW4=";
postPatch = ''
substituteInPlace proc/read_test.go --replace /bin/cat cat
'';
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) process; };
meta = with lib; {
description = "Prometheus exporter that mines /proc to report on selected processes";
homepage = "https://github.com/ncabatoff/process-exporter";
license = licenses.mit;
maintainers = with maintainers; [ _1000101 ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,23 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "prom2json";
version = "1.3.0";
src = fetchFromGitHub {
rev = "v${version}";
owner = "prometheus";
repo = "prom2json";
sha256 = "09glf7br1a9k6j2hs94l2k4mlmlckdz5c9v6qg618c2nd4rk1mz6";
};
vendorSha256 = null;
meta = with lib; {
description = "Tool to scrape a Prometheus client and dump the result as JSON";
homepage = "https://github.com/prometheus/prom2json";
license = licenses.asl20;
maintainers = with maintainers; [ benley ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,17 @@
A Promscale test has a dependency on a package which was not intended to be
vendored, so `go mod vendor` breaks. The dependency is not required to build
Promscale, so it can be removed.
diff --git a/pkg/tests/end_to_end_tests/trace_query_integration_test.go b/pkg/tests/end_to_end_tests/trace_query_integration_test.go
index 84a0d08..efbe5e1 100644
--- a/pkg/tests/end_to_end_tests/trace_query_integration_test.go
+++ b/pkg/tests/end_to_end_tests/trace_query_integration_test.go
@@ -24,7 +24,6 @@ import (
ingstr "github.com/timescale/promscale/pkg/pgmodel/ingestor"
"github.com/timescale/promscale/pkg/pgxconn"
- jaegerQueryApp "github.com/jaegertracing/jaeger/cmd/query/app"
jaegerQueryService "github.com/jaegertracing/jaeger/cmd/query/app/querysvc"
jaegerJSONModel "github.com/jaegertracing/jaeger/model/json"
)

View file

@ -0,0 +1,56 @@
{ lib
, buildGoModule
, fetchFromGitHub
, promscale
, testers
}:
buildGoModule rec {
pname = "promscale";
version = "0.10.0";
src = fetchFromGitHub {
owner = "timescale";
repo = pname;
rev = version;
sha256 = "sha256-KF+aD9vJYqNJkJftx27ZsxmOIXZ/2ciKwjwcTw0GBvY=";
};
patches = [
./0001-remove-jaeger-test-dep.patch
];
vendorSha256 = "sha256-/cjRM8CrOKnx0BcRu2+MLV28MYLOrG5x1DN24mRUJzQ=";
ldflags = [
"-s"
"-w"
"-X github.com/timescale/promscale/pkg/version.Version=${version}"
"-X github.com/timescale/promscale/pkg/version.CommitHash=${src.rev}"
];
checkPhase = ''
runHook preCheck
# some checks requires access to a docker daemon
for pkg in $(getGoDirs test | grep -Ev 'testhelpers|upgrade_tests|end_to_end_tests|util'); do
buildGoDir test $checkFlags "$pkg"
done
runHook postCheck
'';
passthru.tests.version = testers.testVersion {
package = promscale;
command = "promscale -version";
};
meta = with lib; {
description = "An open-source analytical platform for Prometheus metrics";
homepage = "https://github.com/timescale/promscale";
changelog = "https://github.com/timescale/promscale/blob/${version}/CHANGELOG.md";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ _0x4A6F ];
};
}

View file

@ -0,0 +1,48 @@
{ lib, go, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
pname = "pushgateway";
version = "1.4.0";
rev = "v${version}";
goPackagePath = "github.com/prometheus/pushgateway";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "pushgateway";
sha256 = "sha256-230JgG+TtAuopkkcUda+0hl8E6WXOtTUygWoyorLiEU=";
};
buildUser = "nix@nixpkgs";
buildDate = "19700101-00:00:00";
ldflags = [
"-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.Version=${version}"
"-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.Revision=${rev}"
"-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.Branch=${rev}"
"-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.BuildUser=${buildUser}"
"-X github.com/prometheus/pushgateway/vendor/github.com/prometheus/common/version.BuildDate=${buildDate}"
"-X main.goVersion=${lib.getVersion go}"
];
doInstallCheck = true;
installCheckPhase = ''
export PATH=$PATH:$out/bin
pushgateway --help
# Make sure our -X options were included in the build
for s in ${version} ${rev} ${buildUser} ${buildDate}; do
pushgateway --version 2>&1 | fgrep -q -- "$s" || { echo "pushgateway --version output missing $s"; exit 1; }
done
'';
meta = with lib; {
description = "Allows ephemeral and batch jobs to expose metrics to Prometheus";
homepage = "https://github.com/prometheus/pushgateway";
license = licenses.asl20;
maintainers = with maintainers; [ benley fpletz ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,37 @@
{ lib
, python3
, nixosTests
}:
python3.pkgs.buildPythonApplication rec {
pname = "prometheus-pve-exporter";
version = "2.2.2";
src = python3.pkgs.fetchPypi {
inherit pname version;
sha256 = "0vvsiw8nj8zkx6v42f260xbsdd92l0ac4vwpm7w38j3qwvanar7k";
};
propagatedBuildInputs = with python3.pkgs; [
prometheus-client
proxmoxer
pyyaml
requests
werkzeug
];
doCheck = false;
pythonImportsCheck = [ "pve_exporter" ];
passthru.tests = {
inherit (nixosTests.prometheus-exporters) pve;
};
meta = with lib; {
description = "Exposes information gathered from Proxmox VE cluster for use by the Prometheus monitoring system";
homepage = "https://github.com/prometheus-pve/prometheus-pve-exporter";
license = licenses.asl20;
maintainers = with maintainers; [ nukaduka ];
};
}

View file

@ -0,0 +1,23 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "rabbitmq_exporter";
version = "1.0.0-RC8";
src = fetchFromGitHub {
owner = "kbudde";
repo = "rabbitmq_exporter";
rev = "v${version}";
sha256 = "162rjp1j56kcq0vdi0ch09ka101zslxp684x6jvw0jq0aix4zj3r";
};
vendorSha256 = "1cvdqf5pdwczhqz6xb6w86h7gdr0l8fc3lav88xq26r4x75cm6v0";
meta = with lib; {
description = "Prometheus exporter for RabbitMQ";
homepage = "https://github.com/kbudde/rabbitmq_exporter";
license = licenses.mit;
maintainers = with maintainers; [ ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,390 @@
# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix)
[
{
goPackagePath = "github.com/alecthomas/template";
fetch = {
type = "git";
url = "https://github.com/alecthomas/template";
rev = "fb15b899a751";
sha256 = "1vlasv4dgycydh5wx6jdcvz40zdv90zz1h7836z7lhsi2ymvii26";
};
}
{
goPackagePath = "github.com/alecthomas/units";
fetch = {
type = "git";
url = "https://github.com/alecthomas/units";
rev = "c3de453c63f4";
sha256 = "0js37zlgv37y61j4a2d46jh72xm5kxmpaiw0ya9v944bjpc386my";
};
}
{
goPackagePath = "github.com/beorn7/perks";
fetch = {
type = "git";
url = "https://github.com/beorn7/perks";
rev = "v1.0.1";
sha256 = "17n4yygjxa6p499dj3yaqzfww2g7528165cl13haj97hlx94dgl7";
};
}
{
goPackagePath = "github.com/cespare/xxhash";
fetch = {
type = "git";
url = "https://github.com/cespare/xxhash";
rev = "v2.1.1";
sha256 = "0rl5rs8546zj1vzggv38w93wx0b5dvav7yy5hzxa8kw7iikv1cgr";
};
}
{
goPackagePath = "github.com/davecgh/go-spew";
fetch = {
type = "git";
url = "https://github.com/davecgh/go-spew";
rev = "v1.1.1";
sha256 = "0hka6hmyvp701adzag2g26cxdj47g21x6jz4sc6jjz1mn59d474y";
};
}
{
goPackagePath = "github.com/go-kit/kit";
fetch = {
type = "git";
url = "https://github.com/go-kit/kit";
rev = "v0.9.0";
sha256 = "09038mnw705h7isbjp8dzgp2i04bp5rqkmifxvwc5xkh75s00qpw";
};
}
{
goPackagePath = "github.com/go-logfmt/logfmt";
fetch = {
type = "git";
url = "https://github.com/go-logfmt/logfmt";
rev = "v0.4.0";
sha256 = "06smxc112xmixz78nyvk3b2hmc7wasf2sl5vxj1xz62kqcq9lzm9";
};
}
{
goPackagePath = "github.com/go-stack/stack";
fetch = {
type = "git";
url = "https://github.com/go-stack/stack";
rev = "v1.8.0";
sha256 = "0wk25751ryyvxclyp8jdk5c3ar0cmfr8lrjb66qbg4808x66b96v";
};
}
{
goPackagePath = "github.com/gogo/protobuf";
fetch = {
type = "git";
url = "https://github.com/gogo/protobuf";
rev = "v1.1.1";
sha256 = "1525pq7r6h3s8dncvq8gxi893p2nq8dxpzvq0nfl5b4p6mq0v1c2";
};
}
{
goPackagePath = "github.com/golang/protobuf";
fetch = {
type = "git";
url = "https://github.com/golang/protobuf";
rev = "v1.4.0";
sha256 = "1fjvl5n77abxz5qsd4mgyvjq19x43c5bfvmq62mq3m5plx6zksc8";
};
}
{
goPackagePath = "github.com/gomodule/redigo";
fetch = {
type = "git";
url = "https://github.com/gomodule/redigo";
rev = "v1.8.2";
sha256 = "0wp37175n4lgkq234px9vx0c7mdx8sx3d45zky73az8zbabirwga";
};
}
{
goPackagePath = "github.com/google/go-cmp";
fetch = {
type = "git";
url = "https://github.com/google/go-cmp";
rev = "v0.4.0";
sha256 = "1x5pvl3fb5sbyng7i34431xycnhmx8xx94gq2n19g6p0vz68z2v2";
};
}
{
goPackagePath = "github.com/google/gofuzz";
fetch = {
type = "git";
url = "https://github.com/google/gofuzz";
rev = "v1.0.0";
sha256 = "0qz439qvccm91w0mmjz4fqgx48clxdwagkvvx89cr43q1d4iry36";
};
}
{
goPackagePath = "github.com/json-iterator/go";
fetch = {
type = "git";
url = "https://github.com/json-iterator/go";
rev = "v1.1.9";
sha256 = "0pkn2maymgl9v6vmq9q1si8xr5bbl88n6981y0lx09px6qxb29qx";
};
}
{
goPackagePath = "github.com/julienschmidt/httprouter";
fetch = {
type = "git";
url = "https://github.com/julienschmidt/httprouter";
rev = "v1.2.0";
sha256 = "1k8bylc9s4vpvf5xhqh9h246dl1snxrzzz0614zz88cdh8yzs666";
};
}
{
goPackagePath = "github.com/konsorten/go-windows-terminal-sequences";
fetch = {
type = "git";
url = "https://github.com/konsorten/go-windows-terminal-sequences";
rev = "v1.0.3";
sha256 = "1yrsd4s8vhjnxhwbigirymz89dn6qfjnhn28i33vvvdgf96j6ypl";
};
}
{
goPackagePath = "github.com/kr/logfmt";
fetch = {
type = "git";
url = "https://github.com/kr/logfmt";
rev = "b84e30acd515";
sha256 = "02ldzxgznrfdzvghfraslhgp19la1fczcbzh7wm2zdc6lmpd1qq9";
};
}
{
goPackagePath = "github.com/kr/pretty";
fetch = {
type = "git";
url = "https://github.com/kr/pretty";
rev = "v0.1.0";
sha256 = "18m4pwg2abd0j9cn5v3k2ksk9ig4vlwxmlw9rrglanziv9l967qp";
};
}
{
goPackagePath = "github.com/kr/pty";
fetch = {
type = "git";
url = "https://github.com/kr/pty";
rev = "v1.1.1";
sha256 = "0383f0mb9kqjvncqrfpidsf8y6ns5zlrc91c6a74xpyxjwvzl2y6";
};
}
{
goPackagePath = "github.com/kr/text";
fetch = {
type = "git";
url = "https://github.com/kr/text";
rev = "v0.1.0";
sha256 = "1gm5bsl01apvc84bw06hasawyqm4q84vx1pm32wr9jnd7a8vjgj1";
};
}
{
goPackagePath = "github.com/matttproud/golang_protobuf_extensions";
fetch = {
type = "git";
url = "https://github.com/matttproud/golang_protobuf_extensions";
rev = "v1.0.1";
sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya";
};
}
{
goPackagePath = "github.com/modern-go/concurrent";
fetch = {
type = "git";
url = "https://github.com/modern-go/concurrent";
rev = "bacd9c7ef1dd";
sha256 = "0s0fxccsyb8icjmiym5k7prcqx36hvgdwl588y0491gi18k5i4zs";
};
}
{
goPackagePath = "github.com/modern-go/reflect2";
fetch = {
type = "git";
url = "https://github.com/modern-go/reflect2";
rev = "v1.0.1";
sha256 = "06a3sablw53n1dqqbr2f53jyksbxdmmk8axaas4yvnhyfi55k4lf";
};
}
{
goPackagePath = "github.com/mwitkow/go-conntrack";
fetch = {
type = "git";
url = "https://github.com/mwitkow/go-conntrack";
rev = "cc309e4a2223";
sha256 = "0nbrnpk7bkmqg9mzwsxlm0y8m7s9qd9phr1q30qlx2qmdmz7c1mf";
};
}
{
goPackagePath = "github.com/pkg/errors";
fetch = {
type = "git";
url = "https://github.com/pkg/errors";
rev = "v0.8.1";
sha256 = "0g5qcb4d4fd96midz0zdk8b9kz8xkzwfa8kr1cliqbg8sxsy5vd1";
};
}
{
goPackagePath = "github.com/pmezard/go-difflib";
fetch = {
type = "git";
url = "https://github.com/pmezard/go-difflib";
rev = "v1.0.0";
sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw";
};
}
{
goPackagePath = "github.com/prometheus/client_golang";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_golang";
rev = "v1.6.0";
sha256 = "0wwkx69in9dy5kzd3z6rrqf5by8cwl9r7r17fswcpx9rl3g61x1l";
};
}
{
goPackagePath = "github.com/prometheus/client_model";
fetch = {
type = "git";
url = "https://github.com/prometheus/client_model";
rev = "v0.2.0";
sha256 = "0jffnz94d6ff39fr96b5w8i8yk26pwnrfggzz8jhi8k0yihg2c9d";
};
}
{
goPackagePath = "github.com/prometheus/common";
fetch = {
type = "git";
url = "https://github.com/prometheus/common";
rev = "v0.9.1";
sha256 = "12pyywb02p7d30ccm41mwn69qsgqnsgv1w9jlqrrln2f1svnbqch";
};
}
{
goPackagePath = "github.com/prometheus/procfs";
fetch = {
type = "git";
url = "https://github.com/prometheus/procfs";
rev = "v0.0.11";
sha256 = "1msc8bfywsmrgr2ryqjdqwkxiz1ll08r3qgvaka2507z1wpcpj2c";
};
}
{
goPackagePath = "github.com/sirupsen/logrus";
fetch = {
type = "git";
url = "https://github.com/sirupsen/logrus";
rev = "v1.6.0";
sha256 = "1zf9is1yxxnna0d1pyag2m9ziy3l27zb2j92p9msm1gx5jjrvzzj";
};
}
{
goPackagePath = "github.com/stretchr/objx";
fetch = {
type = "git";
url = "https://github.com/stretchr/objx";
rev = "v0.1.1";
sha256 = "0iph0qmpyqg4kwv8jsx6a56a7hhqq8swrazv40ycxk9rzr0s8yls";
};
}
{
goPackagePath = "github.com/stretchr/testify";
fetch = {
type = "git";
url = "https://github.com/stretchr/testify";
rev = "v1.5.1";
sha256 = "09r89m1wy4cjv2nps1ykp00qjpi0531r07q3s34hr7m6njk4srkl";
};
}
{
goPackagePath = "golang.org/x/crypto";
fetch = {
type = "git";
url = "https://go.googlesource.com/crypto";
rev = "c2843e01d9a2";
sha256 = "01xgxbj5r79nmisdvpq48zfy8pzaaj90bn6ngd4nf33j9ar1dp8r";
};
}
{
goPackagePath = "golang.org/x/net";
fetch = {
type = "git";
url = "https://go.googlesource.com/net";
rev = "d28f0bde5980";
sha256 = "18xj31h70m7xxb7gc86n9i21w6d7djbjz67zfaljm4jqskz6hxkf";
};
}
{
goPackagePath = "golang.org/x/sync";
fetch = {
type = "git";
url = "https://go.googlesource.com/sync";
rev = "cd5d95a43a6e";
sha256 = "1nqkyz2y1qvqcma52ijh02s8aiqmkfb95j08f6zcjhbga3ds6hds";
};
}
{
goPackagePath = "golang.org/x/sys";
fetch = {
type = "git";
url = "https://go.googlesource.com/sys";
rev = "1957bb5e6d1f";
sha256 = "0imqk4l9785rw7ddvywyf8zn7k3ga6f17ky8rmf8wrri7nknr03f";
};
}
{
goPackagePath = "golang.org/x/text";
fetch = {
type = "git";
url = "https://go.googlesource.com/text";
rev = "v0.3.0";
sha256 = "0r6x6zjzhr8ksqlpiwm5gdd7s209kwk5p4lw54xjvz10cs3qlq19";
};
}
{
goPackagePath = "golang.org/x/xerrors";
fetch = {
type = "git";
url = "https://go.googlesource.com/xerrors";
rev = "9bdfabe68543";
sha256 = "1yjfi1bk9xb81lqn85nnm13zz725wazvrx3b50hx19qmwg7a4b0c";
};
}
{
goPackagePath = "google.golang.org/protobuf";
fetch = {
type = "git";
url = "https://go.googlesource.com/protobuf";
rev = "v1.21.0";
sha256 = "12bwln8z1lf9105gdp6ip0rx741i4yfz1520gxnp8861lh9wcl63";
};
}
{
goPackagePath = "gopkg.in/alecthomas/kingpin.v2";
fetch = {
type = "git";
url = "https://gopkg.in/alecthomas/kingpin.v2";
rev = "v2.2.6";
sha256 = "0mndnv3hdngr3bxp7yxfd47cas4prv98sqw534mx7vp38gd88n5r";
};
}
{
goPackagePath = "gopkg.in/check.v1";
fetch = {
type = "git";
url = "https://gopkg.in/check.v1";
rev = "41f04d3bba15";
sha256 = "0vfk9czmlxmp6wndq8k17rhnjxal764mxfhrccza7nwlia760pjy";
};
}
{
goPackagePath = "gopkg.in/yaml.v2";
fetch = {
type = "git";
url = "https://gopkg.in/yaml.v2";
rev = "v2.2.5";
sha256 = "08smz8dfyxp02ha74my9iszqa5qzgl3ksi28ilyp8lqipssiq6fg";
};
}
]

View file

@ -0,0 +1,34 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "redis_exporter";
version = "1.37.0";
src = fetchFromGitHub {
owner = "oliver006";
repo = "redis_exporter";
rev = "v${version}";
sha256 = "sha256-S60/SwbMp6INf98MGc26zMZH8q7gBynyaT/ivN7o0rA=";
};
vendorSha256 = "sha256-u9FfKOD6kiCFTjwQ7LHE9WC4j2vPm0ZCluL8pC4aQIc=";
ldflags = [
"-X main.BuildVersion=${version}"
"-X main.BuildCommitSha=unknown"
"-X main.BuildDate=unknown"
];
# needs a redis server
doCheck = false;
passthru.tests = { inherit (nixosTests.prometheus-exporters) redis; };
meta = with lib; {
description = "Prometheus exporter for Redis metrics";
inherit (src.meta) homepage;
license = licenses.mit;
maintainers = with maintainers; [ eskytthe srhb ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,26 @@
{ lib, buildGoModule, fetchFromGitHub, bash, nixosTests }:
buildGoModule rec {
pname = "rtl_433-exporter";
version = "0.1";
src = fetchFromGitHub {
owner = "mhansen";
repo = "rtl_433_prometheus";
rev = "v${version}";
sha256 = "1998gvfa5310bxhi6kfv8bn99369dxph3pwrpp335997b25lc2w2";
};
postPatch = "substituteInPlace rtl_433_prometheus.go --replace /bin/bash ${bash}/bin/bash";
vendorSha256 = "03mnmzq72844hzyw7iq5g4gm1ihpqkg4i9dgj2yln1ghwk843hq6";
passthru.tests = { inherit (nixosTests.prometheus-exporters) rtl_433; };
meta = with lib; {
description = "Prometheus time-series DB exporter for rtl_433 433MHz radio packet decoder";
homepage = "https://github.com/mhansen/rtl_433_prometheus";
license = licenses.mit;
maintainers = with maintainers; [ zopieux ];
};
}

View file

@ -0,0 +1,25 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "script_exporter";
version = "1.2.0";
src = fetchFromGitHub {
owner = "adhocteam";
repo = pname;
rev = "v${version}";
sha256 = "t/xgRalcHxEcT1peU1ePJUItD02rQdfz1uWpXDBo6C0=";
};
vendorSha256 = "Hs1SNpC+t1OCcoF3FBgpVGkhR97ulq6zYhi8BQlgfVc=";
passthru.tests = { inherit (nixosTests.prometheus-exporters) script; };
meta = with lib; {
description = "Shell script prometheus exporter";
homepage = "https://github.com/adhocteam/script_exporter";
license = licenses.mit;
maintainers = with maintainers; [ Flakebi ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,51 @@
From e81b06df67b1d42ef915615fafa0b56ef956673b Mon Sep 17 00:00:00 2001
From: Andreas Fuchs <asf@boinkor.net>
Date: Thu, 11 Feb 2021 17:30:44 -0500
Subject: [PATCH] Return the cached value if it's not time to scan again yet
This should ensure that if we have a valid value cached (which ought
to be every time after the first scan), we return it as metrics.
This fixes the crashes that would happen if queries happened earlier
than the re-scan interval allowed.
Address review feedback: Shorten the time-to-scan logic
We can express this in a single if statement, so it takes fewer lines
to do the "should we check again" check.
---
readjson.go | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/readjson.go b/readjson.go
index da35448..c9996fd 100644
--- a/readjson.go
+++ b/readjson.go
@@ -78,14 +78,7 @@ func readData(device string) (gjson.Result, error) {
if _, err := os.Stat(device); err == nil {
cacheValue, cacheOk := jsonCache[device]
- timeToScan := false
- if cacheOk {
- timeToScan = time.Now().After(cacheValue.LastCollect.Add(options.SMARTctl.CollectPeriodDuration))
- } else {
- timeToScan = true
- }
-
- if timeToScan {
+ if !cacheOk || time.Now().After(cacheValue.LastCollect.Add(options.SMARTctl.CollectPeriodDuration)) {
json, ok := readSMARTctl(device)
if ok {
jsonCache[device] = JSONCache{JSON: json, LastCollect: time.Now()}
@@ -93,7 +86,7 @@ func readData(device string) (gjson.Result, error) {
}
return gjson.Parse(DEFAULT_EMPTY_JSON), fmt.Errorf("smartctl returned bad data for device %s", device)
}
- return gjson.Parse(DEFAULT_EMPTY_JSON), fmt.Errorf("Too early collect called for device %s", device)
+ return cacheValue.JSON, nil
}
return gjson.Parse(DEFAULT_EMPTY_JSON), fmt.Errorf("Device %s unavialable", device)
}
--
2.33.1

View file

@ -0,0 +1,41 @@
{ lib
, fetchFromGitHub
, fetchpatch
, buildGoModule
}:
buildGoModule rec {
pname = "smartctl_exporter";
version = "unstable-2020-11-14";
src = fetchFromGitHub {
owner = "prometheus-community";
repo = pname;
rev = "e27581d56ad80340fb076d3ce22cef337ed76679";
sha256 = "sha256-iWaFDjVLBIAA9zGe0utbuvmEdA3R5lge0iCh3j2JfE8=";
};
patches = [
# Fixes out of range panic (https://github.com/prometheus-community/smartctl_exporter/issues/19)
(fetchpatch {
url = "https://github.com/prometheus-community/smartctl_exporter/commit/15575301a8e2fe5802a8c066c6fa9765d50b8cfa.patch";
sha256 = "sha256-HLUrGXNz3uKpuQBUgQBSw6EGbGl23hQnimTGl64M5bQ=";
})
# Fix validation on empty smartctl response (https://github.com/prometheus-community/smartctl_exporter/pull/31)
(fetchpatch {
url = "https://github.com/prometheus-community/smartctl_exporter/commit/744b4e5f6a46e029d31d5aa46642e85f429c2cfa.patch";
sha256 = "sha256-MgLtYR1SpM6XrZQQ3AgQRmNF3OnaBCqXMJRV9BOzKPc=";
})
# Fixes missing metrics if outside of query interval (https://github.com/prometheus-community/smartctl_exporter/pull/18)
./0001-Return-the-cached-value-if-it-s-not-time-to-scan-aga.patch
];
vendorSha256 = "1xhrzkfm2p20k7prgdfax4408g4qpa4wbxigmcmfz7kjg2zi88ld";
meta = with lib; {
description = "Export smartctl statistics for Prometheus";
homepage = "https://github.com/prometheus-community/smartctl_exporter";
license = licenses.lgpl3;
maintainers = with maintainers; [ hexa ];
};
}

View file

@ -0,0 +1,42 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
let
baseVersion = "0.4.2";
commit = "722200c4adbd6d1e5d847dfbbd9dec07aa4ca38d";
in
buildGoModule rec {
pname = "smokeping_prober";
version = "${baseVersion}-g${commit}";
ldflags = let
setVars = {
Version = baseVersion;
Revision = commit;
Branch = commit;
BuildUser = "nix";
};
varFlags = lib.concatStringsSep " " (lib.mapAttrsToList (name: value: "-X github.com/prometheus/common/version.${name}=${value}") setVars);
in [
"${varFlags}" "-s" "-w"
];
src = fetchFromGitHub {
rev = commit;
owner = "SuperQ";
repo = "smokeping_prober";
sha256 = "1lpcjip6qxhalldgm6i2kgbajfqy3vwfyv9jy0jdpii13lv6mzlz";
};
vendorSha256 = "0p2jmlxpvpaqc445j39b4z4i3mnjrm25khv3sq6ylldcgfd31vz8";
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) smokeping; };
meta = with lib; {
description = "Prometheus exporter for sending continual ICMP/UDP pings";
homepage = "https://github.com/SuperQ/smokeping_prober";
license = licenses.asl20;
maintainers = with maintainers; [ lukegb ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,29 @@
{ lib, buildGoModule, fetchFromGitHub, net-snmp, nixosTests }:
buildGoModule rec {
pname = "snmp_exporter";
version = "0.20.0";
src = fetchFromGitHub {
owner = "prometheus";
repo = "snmp_exporter";
rev = "v${version}";
sha256 = "0qwbnx3l25460qbah4ik9mlcyrm31rwm51451gh0jprii80cf16x";
};
vendorSha256 = "1rivil3hwk269ikrwc4i22k2y5c9zs5ac058y7llz8ivrrjr2w4h";
buildInputs = [ net-snmp ];
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) snmp; };
meta = with lib; {
description = "SNMP Exporter for Prometheus";
homepage = "https://github.com/prometheus/snmp_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ oida willibutz Frostman ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,23 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "sql_exporter";
version = "0.4.2";
vendorSha256 = null;
src = fetchFromGitHub {
owner = "justwatchcom";
repo = pname;
rev = "v${version}";
sha256 = "sha256-Ujon6TLniQrYRxJe4+ZTu4/dI2K94r9M/lBmMizDZrA=";
};
meta = with lib; {
description = "Flexible SQL exporter for Prometheus";
homepage = "https://github.com/justwatchcom/sql_exporter";
license = licenses.mit;
maintainers = with maintainers; [ justinas ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,23 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "statsd_exporter";
version = "0.22.2";
src = fetchFromGitHub {
rev = "v${version}";
owner = "prometheus";
repo = "statsd_exporter";
sha256 = "sha256-pLzUbeSCMV0yr4gSR7m6NYrpm8ZhCPbwwZ5nQzy6lEM=";
};
vendorSha256 = "sha256-gBeeOxnVT0+x33VuwZhfjk3Fb8JHZdAzaDuFZlUfdgM=";
meta = with lib; {
description = "Receives StatsD-style metrics and exports them to Prometheus";
homepage = "https://github.com/prometheus/statsd_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ benley ivan ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,25 @@
{ lib, buildGoPackage, fetchFromGitHub, nixosTests }:
buildGoPackage rec {
pname = "surfboard_exporter";
version = "2.0.0";
goPackagePath = "github.com/ipstatic/surfboard_exporter";
src = fetchFromGitHub {
rev = version;
owner = "ipstatic";
repo = "surfboard_exporter";
sha256 = "11qms26648nwlwslnaflinxcr5rnp55s908rm1qpnbz0jnxf5ipw";
};
passthru.tests = { inherit (nixosTests.prometheus-exporters) surfboard; };
meta = with lib; {
description = "Arris Surfboard signal metrics exporter";
homepage = "https://github.com/ipstatic/surfboard_exporter";
license = licenses.mit;
maintainers = with maintainers; [ disassembler ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,25 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "systemd_exporter";
version = "0.4.0";
vendorSha256 = "sha256-bYoB0r+d0j3esi/kK2a7/Duup9cf4M3WJjiBNs2+bj8=";
src = fetchFromGitHub {
owner = "povilasv";
repo = pname;
rev = "v${version}";
sha256 = "sha256-JDfRHczFnTP9sxA7polUE9qzJhSPIiAU58GBNDYkX4c=";
};
passthru.tests = { inherit (nixosTests.prometheus-exporters) systemd; };
meta = with lib; {
description = "Exporter for systemd unit metrics";
homepage = "https://github.com/povilasv/systemd_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ chkno ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,39 @@
{ lib, fetchFromGitHub, python3Packages, nixosTests }:
python3Packages.buildPythonApplication rec {
pname = "tor-exporter";
version = "0.4";
# Just a single .py file to use as the application's main entry point.
format = "other";
src = fetchFromGitHub {
rev = "v${version}";
owner = "atx";
repo = "prometheus-tor_exporter";
sha256 = "1gzf42z0cgdqijbi9cwpjkqzkvnabaxkkfa5ac5h27r3pxx3q4n0";
};
propagatedBuildInputs = with python3Packages; [ prometheus-client stem retrying ];
installPhase = ''
mkdir -p $out/share/
cp prometheus-tor-exporter.py $out/share/
'';
fixupPhase = ''
makeWrapper "${python3Packages.python.interpreter}" "$out/bin/prometheus-tor-exporter" \
--set PYTHONPATH "$PYTHONPATH" \
--add-flags "$out/share/prometheus-tor-exporter.py"
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) tor; };
meta = with lib; {
description = "Prometheus exporter that exposes metrics from a Tor daemon";
homepage = "https://github.com/atx/prometheus-tor_exporter";
license = licenses.mit;
maintainers = with maintainers; [ delroth ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,31 @@
{ lib, stdenv, rustPlatform, fetchFromGitHub, openssl, pkg-config, nixosTests, Security }:
rustPlatform.buildRustPackage rec {
pname = "unbound-telemetry";
version = "unstable-2021-09-18";
src = fetchFromGitHub {
owner = "svartalf";
repo = pname;
rev = "19e53b05828a43b7062b67a9cc6c84836ca26439";
sha256 = "sha256-wkr9T6GlJP/PSv17z3MC7vC0cXg/Z6rGlhlCUHH3Ua4=";
};
cargoSha256 = "sha256-6V39Wfqin2RK73rehsIwmqDkOin4FEiqJQjTKAEx9Vs=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ]
++ lib.optional stdenv.isDarwin Security;
passthru.tests = {
inherit (nixosTests.prometheus-exporters) unbound;
};
meta = with lib; {
description = "Prometheus exporter for Unbound DNS resolver";
homepage = "https://github.com/svartalf/unbound-telemetry";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}

View file

@ -0,0 +1,31 @@
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, varnish, nixosTests }:
buildGoModule rec {
pname = "prometheus_varnish_exporter";
version = "1.6.1";
src = fetchFromGitHub {
owner = "jonnenauha";
repo = "prometheus_varnish_exporter";
rev = version;
sha256 = "15w2ijz621caink2imlp1666j0ih5pmlj62cbzggyb34ncl37ifn";
};
vendorSha256 = "00i9znb1pk5jpmyhxfg9zbw935fk3c1r0qrgf868xlcf9p8x2rrz";
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/prometheus_varnish_exporter \
--prefix PATH : "${varnish}/bin"
'';
passthru.tests = { inherit (nixosTests.prometheus-exporters) varnish; };
meta = {
homepage = "https://github.com/jonnenauha/prometheus_varnish_exporter";
description = "Varnish exporter for Prometheus";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ MostAwesomeDude willibutz ];
};
}

View file

@ -0,0 +1,26 @@
{ stdenv, rustPlatform, fetchFromGitHub, lib, libiconv, Security, nixosTests }:
rustPlatform.buildRustPackage rec {
pname = "wireguard-exporter";
version = "3.6.3";
src = fetchFromGitHub {
owner = "MindFlavor";
repo = "prometheus_wireguard_exporter";
rev = version;
sha256 = "sha256-m29/whlmhIkLin84NOWs2NVZcXNpVsyyHZ1CLp4FXd0=";
};
cargoSha256 = "sha256-XK4hjBIcOx6JMv61gOpIXaZy7Unw+Bk84TEb+8Fib6Q=";
buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ];
passthru.tests = { inherit (nixosTests.prometheus-exporters) wireguard; };
meta = with lib; {
description = "A Prometheus exporter for WireGuard, written in Rust";
homepage = "https://github.com/MindFlavor/prometheus_wireguard_exporter";
license = licenses.mit;
maintainers = with maintainers; [ ma27 globin ];
};
}

View file

@ -0,0 +1,41 @@
{ lib
, fetchFromGitHub
, python3Packages
, prometheus-alertmanager
}:
python3Packages.buildPythonApplication rec {
pname = "prometheus-xmpp-alerts";
version = "0.5.3";
src = fetchFromGitHub {
owner = "jelmer";
repo = pname;
rev = "v${version}";
sha256 = "sha256-gb7lFRqqw4w/B+Sw0iteDkuGsPfw/ZZ+sRMTu5vxIUo=";
};
propagatedBuildInputs = [
prometheus-alertmanager
] ++ (with python3Packages; [
aiohttp
slixmpp
prometheus-client
pyyaml
]);
checkInputs = with python3Packages; [
pytz
];
checkPhase = ''
${python3Packages.python.interpreter} -m unittest discover
'';
meta = {
description = "XMPP Web hook for Prometheus";
homepage = "https://github.com/jelmer/prometheus-xmpp-alerts";
maintainers = with lib.maintainers; [ fpletz ];
license = with lib.licenses; [ asl20 ];
};
}