]> git.giacomolli.uk - onechat/blobdiff - nix/package.nix
Send terminal images by local path
[onechat] / nix / package.nix
index b38dcc05783e8b2c95b41c0bbfe28b647346d1e7..41cd24f8e0782767d6b8515b51776f4ed7fc2120 100644 (file)
@@ -2,14 +2,15 @@
   lib,
   buildGoModule,
   src,
+  version,
 }:
 buildGoModule {
   pname = "onechat";
-  version = "0.1.0";
-  inherit src;
+  inherit src version;
 
   subPackages = [ "." ];
-  vendorHash = "sha256-35kAjo+7gbOOzNbKJyMYUcAF11HK7WzO3m9ZcrOsqY0=";
+  ldflags = [ "-X main.version=${version}" ];
+  vendorHash = "sha256-nRDUAGSXAK5/L2xyfDh3NbMOZmrGGEIm4vtgfWsxHYU=";
 
   # The flake check runs the full replay.
   checkFlags = [ "-short" ];
@@ -24,6 +25,7 @@ buildGoModule {
   installCheckPhase = ''
     runHook preInstallCheck
     [[ "$("$out/bin/onechat" help)" == "Usage: onechat "* ]]
+    [[ "$("$out/bin/onechat" version)" == "${version}" ]]
     runHook postInstallCheck
   '';