colima: embed version and git revision
These are shown on `colima version` See also https://github.com/abiosoft/colima/issues/301
This commit is contained in:
parent
c777cdf5c5
commit
6a065534bb
1 changed files with 13 additions and 1 deletions
|
@ -14,13 +14,25 @@ buildGoModule rec {
|
|||
owner = "abiosoft";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-g7q2DmtyArtW7Ii2XF5umXQ0+BlCSa1Q7VNNuIuX65k=";
|
||||
sha256 = "sha256-KYW3gxf21aWnuRHkysOjArzMSNH3m3XDoi6Sic3N+Po=";
|
||||
|
||||
# We need the git revision
|
||||
leaveDotGit = true;
|
||||
postFetch = ''
|
||||
git -C $out rev-parse HEAD > $out/.git-revision
|
||||
rm -rf $out/.git
|
||||
'';
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
||||
|
||||
vendorSha256 = "sha256-Z4+qwoX04VnLsUIYRfOowFLgcaA9w8oGRl77jzFigIc=";
|
||||
|
||||
preConfigure = ''
|
||||
ldflags="-X github.com/abiosoft/colima/config.appVersion=${version}
|
||||
-X github.com/abiosoft/colima/config.revision=$(cat .git-revision)"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/colima \
|
||||
--prefix PATH : ${lib.makeBinPath [ lima ]}
|
||||
|
|
Loading…
Reference in a new issue