about summary refs log tree commit diff stats
path: root/nix/default.nix
diff options
context:
space:
mode:
authorAlan Pearce2024-04-19 22:13:14 +0200
committerAlan Pearce2024-04-19 22:13:42 +0200
commit0d1de2258553f16c9cd492f02f591c4d5457f958 (patch)
tree6c3055dc10983f5d7dcad75a48295a1801136879 /nix/default.nix
parentbf469bae36ebad75bfd167074f104b6b2d66a3b0 (diff)
downloadwebsite-0d1de2258553f16c9cd492f02f591c4d5457f958.tar.lz
website-0d1de2258553f16c9cd492f02f591c4d5457f958.tar.zst
website-0d1de2258553f16c9cd492f02f591c4d5457f958.zip
Brand executable with commit hash for server header
Diffstat (limited to 'nix/default.nix')
-rw-r--r--nix/default.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/nix/default.nix b/nix/default.nix
index e6102cf..2a7792a 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -1,7 +1,7 @@
 { pkgs, self }:
 let
-  revision = "${self.lastModifiedDate}-${self.shortRev or "dirty"}";
-  version = "unstable-${self.shortRev or "dirty"}";
+  revision = "${self.lastModifiedDate}-${self.shortRev or self.dirtyShortRev or "dirty"}";
+  version = self.shortRev or self.dirtyShortRev or "unstable-${self.lastModified}";
   mkDocker = server:
     let
       PORT = 3000;
@@ -63,7 +63,7 @@ rec {
       ${builder}/bin/build
     '';
     modules = ./gomod2nix.toml;
-    ldflags = [ "-s" "-w" ];
+    ldflags = [ "-s" "-w" "-X" "main.Commit=${version}" ];
   };
   docker = mkDocker server;
   docker-aarch64-linux = mkDocker (self.packages.aarch64-linux.server);