Expose prometheus generic builder.

So that people can easily try newer prometheus version
 in overlays:

 self: super: {
   prometheus_2 = (super.callPackage <nixpkgs/pkgs/servers/monitoring/prometheus> {}).generic {
     version = "2.8.1";
     sha256 = "0x8w0qdh4lcf19nmdlhvgzpy08c2a932d3k49cjwhi5npcsf858n";
     doCheck = false;
   };
 }
This commit is contained in:
Jean-Baptiste Giraudeau 2019-03-25 15:54:13 +01:00
parent 0c0954781e
commit 670359e8da
No known key found for this signature in database
GPG Key ID: E96EF57FD501B961

View File

@ -2,8 +2,8 @@
let let
goPackagePath = "github.com/prometheus/prometheus"; goPackagePath = "github.com/prometheus/prometheus";
in rec {
generic = { version, sha256, ... }@attrs: generic = { version, sha256, doCheck ? true, ... }@attrs:
let attrs' = builtins.removeAttrs attrs ["version" "sha256"]; in let attrs' = builtins.removeAttrs attrs ["version" "sha256"]; in
buildGoPackage ({ buildGoPackage ({
name = "prometheus-${version}"; name = "prometheus-${version}";
@ -17,8 +17,6 @@ let
inherit sha256; inherit sha256;
}; };
doCheck = true;
buildFlagsArray = let t = "${goPackagePath}/vendor/github.com/prometheus/common/version"; in '' buildFlagsArray = let t = "${goPackagePath}/vendor/github.com/prometheus/common/version"; in ''
-ldflags= -ldflags=
-X ${t}.Version=${version} -X ${t}.Version=${version}
@ -43,7 +41,7 @@ let
platforms = platforms.unix; platforms = platforms.unix;
}; };
} // attrs'); } // attrs');
in rec {
prometheus_1 = generic { prometheus_1 = generic {
version = "1.8.2"; version = "1.8.2";
sha256 = "088flpg3qgnj9afl9vbaa19v2s1d21yxy38nrlv5m7cxwy2pi5pv"; sha256 = "088flpg3qgnj9afl9vbaa19v2s1d21yxy38nrlv5m7cxwy2pi5pv";