git.iko.soy/typeable/nixpkgs
on master help sign in
prometheus-postfix-exporter: 0.1.1 -> 0.1.2

With this release systemd support became optional. It can now be disabled by passing `withSystemdSupport = false` to `callPackage`.

commit23d98f9e8ff8d88ba1adc576c14285e0d84a1785 authorWilliButz <wbutz@cyberfnord.de> dateFri 4 May 2018, 13:21 (9 years ago) parent977f9a1
2 files changed+35−29
pkgs/servers/monitoring/prometheus/postfix-exporter-deps.nix+4−22 pkgs/servers/monitoring/prometheus/postfix-exporter.nix+31−7
pkgs/servers/monitoring/prometheus/postfix-exporter-deps.nix+4−22
@@ -9,31 +9,13 @@
99 sha256 = "1l2lns4f5jabp61201sh88zf3b0q793w4zdgp9nll7mmfcxxjif3";
1010 };
1111 }
12− {
13− goPackagePath = "github.com/coreos/go-systemd";
14− fetch = {
15− type = "git";
16− url = "https://github.com/coreos/go-systemd";
17− rev = "d1b7d058aa2adfc795ad17ff4aaa2bc64ec11c78";
18− sha256 = "1nz3v1b90hnmj2vjjwq96pr6psxlndqjyd30v9sgiwygzb7db9mv";
19− };
20− }
21− {
22− goPackagePath = "github.com/coreos/pkg";
23− fetch = {
24− type = "git";
25− url = "https://github.com/coreos/pkg";
26− rev = "97fdf19511ea361ae1c100dd393cc47f8dcfa1e1";
27− sha256 = "1srn87wih25l09f75483hnxsr8fc6rq3bk7w1x8125ym39p6mg21";
28− };
29− }
3012 {
3113 goPackagePath = "github.com/golang/protobuf";
3214 fetch = {
3315 type = "git";
3416 url = "https://github.com/golang/protobuf";
35− rev = "e09c5db296004fbe3f74490e84dcd62c3c5ddb1b";
36− sha256 = "1acnmalkqwrq6k3l71c4pyws0zn18r2609kqaq55lhbdcjgzid31";
17+ rev = "b4deda0973fb4c70b50d226b1af49f3da59f5265";
18+ sha256 = "0ya4ha7m20bw048m1159ppqzlvda4x0vdprlbk5sdgmy74h3xcdq";
3719 };
3820 }
3921 {
@@ -68,8 +50,8 @@
6850 fetch = {
6951 type = "git";
7052 url = "https://github.com/prometheus/common";
71− rev = "d0f7cd64bda49e08b22ae8a730aa57aa0db125d6";
72− sha256 = "1d4hfbb66xsf0wq317fwhgrwakqzhvryw4d7ip851lwrpql5fqcx";
53+ rev = "d811d2e9bf898806ecfb6ef6296774b13ffc314c";
54+ sha256 = "0r4067r4ysmljksqw3awcxx5qplqhykahc5igdzgkky7i4bvaik1";
7355 };
7456 }
7557 {
pkgs/servers/monitoring/prometheus/postfix-exporter.nix+31−7
@@ -1,8 +1,11 @@
1−{ stdenv, buildGoPackage, fetchFromGitHub, systemd, makeWrapper }:
1+{ stdenv, buildGoPackage, fetchFromGitHub, systemd, makeWrapper
2+, withSystemdSupport ? true }:
3+
4+with stdenv.lib;
25
36buildGoPackage rec {
47 name = "postfix_exporter-${version}";
5− version = "0.1.1";
8+ version = "0.1.2";
69
710 goPackagePath = "github.com/kumina/postfix_exporter";
811
@@ -10,20 +13,41 @@ buildGoPackage rec {
1013 owner = "kumina";
1114 repo = "postfix_exporter";
1215 rev = version;
13− sha256 = "1p2j66jzzgyv2w832pw57g02vrac6ldrblqllgwyy0i8krb3ibyz";
16+ sha256 = "1b9ib3scxni6hlw55wv6f0z1xfn27l0p29as24f71rs70pyzy4hm";
1417 };
1518
16− nativeBuildInputs = [ makeWrapper ];
17− buildInputs = [ systemd ];
19+ nativeBuildInputs = optional withSystemdSupport makeWrapper;
20+ buildInputs = optional withSystemdSupport systemd;
21+ buildFlags = optional (!withSystemdSupport) "-tags nosystemd";
1822
1923 goDeps = ./postfix-exporter-deps.nix;
24+ extraSrcs = optionals withSystemdSupport [
25+ {
26+ goPackagePath = "github.com/coreos/go-systemd";
27+ src = fetchFromGitHub {
28+ owner = "coreos";
29+ repo = "go-systemd";
30+ rev = "d1b7d058aa2adfc795ad17ff4aaa2bc64ec11c78";
31+ sha256 = "1nz3v1b90hnmj2vjjwq96pr6psxlndqjyd30v9sgiwygzb7db9mv";
32+ };
33+ }
34+ {
35+ goPackagePath = "github.com/coreos/pkg";
36+ src = fetchFromGitHub {
37+ owner = "coreos";
38+ repo = "pkg";
39+ rev = "97fdf19511ea361ae1c100dd393cc47f8dcfa1e1";
40+ sha256 = "1srn87wih25l09f75483hnxsr8fc6rq3bk7w1x8125ym39p6mg21";
41+ };
42+ }
43+ ];
2044
21− postInstall = ''
45+ postInstall = optionalString withSystemdSupport ''
2246 wrapProgram $bin/bin/postfix_exporter \
2347 --prefix LD_LIBRARY_PATH : "${systemd.lib}/lib"
2448 '';
2549
26− meta = with stdenv.lib; {
50+ meta = {
2751 inherit (src.meta) homepage;
2852 description = "A Prometheus exporter for Postfix";
2953 license = licenses.asl20;