2018-03-20 16:58:34 +03:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, systemd, makeWrapper }:
|
2018-01-26 20:39:25 +03:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2018-03-20 16:58:34 +03:00
|
|
|
name = "postfix_exporter-${version}";
|
|
|
|
version = "0.1.1";
|
2018-01-26 20:39:25 +03:00
|
|
|
|
|
|
|
goPackagePath = "github.com/kumina/postfix_exporter";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kumina";
|
|
|
|
repo = "postfix_exporter";
|
2018-03-20 16:58:34 +03:00
|
|
|
rev = version;
|
|
|
|
sha256 = "1p2j66jzzgyv2w832pw57g02vrac6ldrblqllgwyy0i8krb3ibyz";
|
2018-01-26 20:39:25 +03:00
|
|
|
};
|
|
|
|
|
2018-04-20 21:31:17 +03:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ systemd ];
|
2018-03-20 16:58:34 +03:00
|
|
|
|
2018-01-26 20:39:25 +03:00
|
|
|
goDeps = ./postfix-exporter-deps.nix;
|
|
|
|
|
2018-03-20 16:58:34 +03:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $bin/bin/postfix_exporter \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${systemd.lib}/lib"
|
|
|
|
'';
|
|
|
|
|
2018-01-26 20:39:25 +03:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "A Prometheus exporter for Postfix";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ willibutz ];
|
|
|
|
};
|
|
|
|
}
|