nix:inject version into binary via ldflags
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I396e26784dc0d47cb9644f01bdb6a8ae6a6a6964
This commit is contained in:
parent
7765fea445
commit
2626cba348
1 changed files with 4 additions and 4 deletions
|
|
@ -2,9 +2,9 @@
|
||||||
lib,
|
lib,
|
||||||
buildGoModule,
|
buildGoModule,
|
||||||
}:
|
}:
|
||||||
buildGoModule {
|
buildGoModule (finalAttrs: {
|
||||||
pname = "ncro";
|
pname = "ncro";
|
||||||
version = "0.1.0";
|
version = "1.0.0";
|
||||||
|
|
||||||
src = let
|
src = let
|
||||||
fs = lib.fileset;
|
fs = lib.fileset;
|
||||||
|
|
@ -22,5 +22,5 @@ buildGoModule {
|
||||||
|
|
||||||
vendorHash = "sha256-vhCOK0cD92F9xMBS4APH+0nvLftaPuRl2LJio4mYWhY=";
|
vendorHash = "sha256-vhCOK0cD92F9xMBS4APH+0nvLftaPuRl2LJio4mYWhY=";
|
||||||
|
|
||||||
ldflags = ["-s" "-w"];
|
ldflags = ["-s" "-w" "-X main.version=${finalAttrs.version}"];
|
||||||
}
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue