From 2626cba348cfad50b9a3fc13b1b65293825da72f Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 6 Mar 2026 23:36:59 +0300 Subject: [PATCH] nix:inject version into binary via ldflags Signed-off-by: NotAShelf Change-Id: I396e26784dc0d47cb9644f01bdb6a8ae6a6a6964 --- nix/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/package.nix b/nix/package.nix index e2ac658..0e07d75 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -2,9 +2,9 @@ lib, buildGoModule, }: -buildGoModule { +buildGoModule (finalAttrs: { pname = "ncro"; - version = "0.1.0"; + version = "1.0.0"; src = let fs = lib.fileset; @@ -22,5 +22,5 @@ buildGoModule { vendorHash = "sha256-vhCOK0cD92F9xMBS4APH+0nvLftaPuRl2LJio4mYWhY="; - ldflags = ["-s" "-w"]; -} + ldflags = ["-s" "-w" "-X main.version=${finalAttrs.version}"]; +})