prometheus: nixpkgs-fmt

This commit is contained in:
happysalada 2021-07-22 15:01:13 +09:00 committed by Raphael Megzari
parent 4e82d2e6d0
commit 56ceaa6c8b

View file

@ -1,4 +1,10 @@
{ stdenv, lib, go, buildGoModule, fetchFromGitHub, mkYarnPackage, nixosTests
{ stdenv
, lib
, go
, buildGoModule
, fetchFromGitHub
, mkYarnPackage
, nixosTests
, fetchpatch
}:
@ -27,7 +33,8 @@ let
installPhase = "mv build $out";
distPhase = "true";
};
in buildGoModule rec {
in
buildGoModule rec {
pname = "prometheus";
inherit src version;
@ -41,19 +48,21 @@ in buildGoModule rec {
'';
buildFlags = "-tags=builtinassets";
buildFlagsArray = let
t = "${goPackagePath}/vendor/github.com/prometheus/common/version";
in [
''
-ldflags=
-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}
''
];
buildFlagsArray =
let
t = "${goPackagePath}/vendor/github.com/prometheus/common/version";
in
[
''
-ldflags=
-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}
''
];
# only run this in the real build, not during the vendor build
# this should probably be fixed in buildGoModule