age: set and check version

This commit is contained in:
0x4A6F 2021-09-06 19:56:04 +02:00
parent fabddcd7b6
commit a9fe9e8a32
No known key found for this signature in database
GPG key ID: 8DEDBA5BE07080E1

View file

@ -12,6 +12,20 @@ buildGoModule rec {
sha256 = "sha256-MfyW8Yv8swKqA7Hl45l5Zn4wZrQmE661eHsKIywy36U=";
};
ldflags = [
"-X main.Version=${version}"
];
doInstallCheck = true;
installCheckPhase = ''
if [[ "$("$out/bin/${pname}" --version)" == "${version}" ]]; then
echo '${pname} smoke check passed'
else
echo '${pname} smoke check failed'
return 1
fi
'';
meta = with lib; {
homepage = "https://age-encryption.org/";
description = "Modern encryption tool with small explicit keys";