From 4db0983ae49122e31b6eb8387154e397b4269d12 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sun, 8 Aug 2021 10:11:16 +1000 Subject: [PATCH] prometheus: buildFlags{,Array} -> ldflags, tags --- .../servers/monitoring/prometheus/default.nix | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/servers/monitoring/prometheus/default.nix b/pkgs/servers/monitoring/prometheus/default.nix index f4ad8a8e7b9..19136a39778 100644 --- a/pkgs/servers/monitoring/prometheus/default.nix +++ b/pkgs/servers/monitoring/prometheus/default.nix @@ -47,21 +47,19 @@ buildGoModule rec { ln -s ${webui} web/ui/static/react ''; - buildFlags = "-tags=builtinassets"; - buildFlagsArray = + tags = [ "builtinassets" ]; + + ldflags = 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} - '' + "-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