about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-04-27 21:34:47 +0200
committerAlan Pearce2024-04-27 21:34:47 +0200
commita04ec2d5658a85913c81061636309893d96f0531 (patch)
treef7a1c2c17bee41d7734859b4ceca7727f8799b06
parent2a4c795d5a165f995e9f7dc84e07465b140f3770 (diff)
downloadwebsite-a04ec2d5658a85913c81061636309893d96f0531.tar.lz
website-a04ec2d5658a85913c81061636309893d96f0531.tar.zst
website-a04ec2d5658a85913c81061636309893d96f0531.zip
fix missing commit hashes in binary
-rw-r--r--internal/server/server.go5
-rw-r--r--nix/default.nix4
2 files changed, 7 insertions, 2 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 2e9796d..cbee989 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -25,6 +25,11 @@ import (
 
 var config *cfg.Config
 
+var (
+	CommitSHA string
+	ShortSHA  string
+)
+
 type Config struct {
 	Production    bool    `conf:"default:false"`
 	InDevServer   bool    `conf:"default:false"`
diff --git a/nix/default.nix b/nix/default.nix
index e818c5a..de427db 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -80,9 +80,9 @@ with pkgs; rec {
       "-s"
       "-w"
       "-X"
-      "main.CommitSHA=${fullSHA}"
+      "website/internal/server.CommitSHA=${fullSHA}"
       "-X"
-      "main.ShortSHA=${shortSHA}"
+      "website/internal/server.ShortSHA=${shortSHA}"
     ];
   };
   docker-stream = mkDockerStream { inherit server website; };