1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-03 19:15:39 +00:00
nixpkgs/pkgs/servers/monitoring/prometheus/postfix-exporter.nix
Vladimír Čunát 2e6bf42a22
Merge branch 'master' into staging-next
There ver very many conflicts, basically all due to
name -> pname+version.  Fortunately, almost everything was auto-resolved
by kdiff3, and for now I just fixed up a couple evaluation problems,
as verified by the tarball job.  There might be some fallback to these
conflicts, but I believe it should be minimal.

Hydra nixpkgs: ?compare=1538299
2019-08-24 08:55:37 +02:00

57 lines
1.6 KiB
Nix

{ stdenv, buildGoPackage, fetchFromGitHub, systemd, makeWrapper
, withSystemdSupport ? true }:
with stdenv.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;
buildFlags = optional (!withSystemdSupport) "-tags 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 $bin/bin/postfix_exporter \
--prefix LD_LIBRARY_PATH : "${systemd.lib}/lib"
'';
meta = {
inherit (src.meta) homepage;
description = "A Prometheus exporter for Postfix";
license = licenses.asl20;
maintainers = with maintainers; [ willibutz globin ];
};
}