From 7cef911b6159bff46fd4239240e17de5200aa645 Mon Sep 17 00:00:00 2001 From: Bennett Wetters Date: Tue, 16 Jan 2024 02:46:09 +0100 Subject: [PATCH] Set -ldflags for spaceapid to set version string Co-authored-by: June --- config/hosts/public-web-static/spaceapid.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/hosts/public-web-static/spaceapid.nix b/config/hosts/public-web-static/spaceapid.nix index 0a87c4f..8c9cb87 100644 --- a/config/hosts/public-web-static/spaceapid.nix +++ b/config/hosts/public-web-static/spaceapid.nix @@ -6,11 +6,15 @@ let ref = "main"; rev = "bbeb0d0e2b4538faed275b9891fb55149bc3a2f8"; }; - spaceapid = pkgs.buildGoModule { + spaceapid = pkgs.buildGoModule rec { pname = "spaceapid"; version = "main"; src = spaceapidSrc; + + ldflags = [ + "-X main.version=${version}-${spaceapidSrc.rev}" + ]; # Since spaceapid doesn't have any dependencies, we can set this to null and # use the nonexistend vendored dependencies.