tailscale: Include version in build flags
This commit adds the user-facing version to the tailscale version output. Prior to this change, it used a hardcoded fallback that is fairly infrequently updated (https://github.com/tailscale/tailscale/commits/main/version/version.go). After this change, we print the user-friendlier tag version, which is helpful when wanting to e.g check to see if you have a version that is compatible with a feature like [magic dns][magic-dns]. E.g: ``` [nixpkgs(dani/tailscale-version)] $ ./result/bin/tailscale version 1.0.5 ``` [magic-dns]: https://tailscale.com/kb/1081/magic-dns
This commit is contained in:
parent
5e67d80a8b
commit
7526ae55d7
@ -21,6 +21,13 @@ buildGoModule rec {
|
|||||||
|
|
||||||
subPackages = [ "cmd/tailscale" "cmd/tailscaled" ];
|
subPackages = [ "cmd/tailscale" "cmd/tailscaled" ];
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
export buildFlagsArray=(
|
||||||
|
-tags="xversion"
|
||||||
|
-ldflags="-X tailscale.com/version.LONG=${version} -X tailscale.com/version.SHORT=${version}"
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
wrapProgram $out/bin/tailscaled --prefix PATH : ${
|
wrapProgram $out/bin/tailscaled --prefix PATH : ${
|
||||||
lib.makeBinPath [ iproute iptables ]
|
lib.makeBinPath [ iproute iptables ]
|
||||||
|
Loading…
Reference in New Issue
Block a user