prometheus: buildFlags{,Array} -> ldflags, tags

This commit is contained in:
zowoq 2021-08-08 10:11:16 +10:00
parent 7b2efac5ac
commit 4db0983ae4

View file

@ -47,21 +47,19 @@ buildGoModule rec {
ln -s ${webui} web/ui/static/react ln -s ${webui} web/ui/static/react
''; '';
buildFlags = "-tags=builtinassets"; tags = [ "builtinassets" ];
buildFlagsArray =
ldflags =
let let
t = "${goPackagePath}/vendor/github.com/prometheus/common/version"; t = "${goPackagePath}/vendor/github.com/prometheus/common/version";
in in
[ [
'' "-X ${t}.Version=${version}"
-ldflags= "-X ${t}.Revision=unknown"
-X ${t}.Version=${version} "-X ${t}.Branch=unknown"
-X ${t}.Revision=unknown "-X ${t}.BuildUser=nix@nixpkgs"
-X ${t}.Branch=unknown "-X ${t}.BuildDate=unknown"
-X ${t}.BuildUser=nix@nixpkgs "-X ${t}.GoVersion=${lib.getVersion go}"
-X ${t}.BuildDate=unknown
-X ${t}.GoVersion=${lib.getVersion go}
''
]; ];
# only run this in the real build, not during the vendor build # only run this in the real build, not during the vendor build