Derive build version from git tags via VERSION file.
flake.nix reads from VERSION instead of hardcoding; Makefile gains a version target that syncs VERSION from the latest git tag and injects it into go build ldflags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,11 +11,14 @@
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
let
|
||||
version = builtins.replaceStrings [ "\n" ] [ "" ] (builtins.readFile ./VERSION);
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
sgard = pkgs.buildGoModule rec {
|
||||
pname = "sgard";
|
||||
version = "2.1.0";
|
||||
inherit version;
|
||||
src = pkgs.lib.cleanSource ./.;
|
||||
subPackages = [ "cmd/sgard" "cmd/sgardd" ];
|
||||
|
||||
@@ -31,7 +34,7 @@
|
||||
|
||||
sgard-fido2 = pkgs.buildGoModule rec {
|
||||
pname = "sgard-fido2";
|
||||
version = "2.1.0";
|
||||
inherit version;
|
||||
src = pkgs.lib.cleanSource ./.;
|
||||
subPackages = [ "cmd/sgard" "cmd/sgardd" ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user