2021-09-08 05:20:00 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2019-12-28 14:56:08 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "age";
|
2021-09-06 18:35:06 +01:00
|
|
|
version = "1.0.0";
|
2022-01-10 18:48:38 +00:00
|
|
|
vendorSha256 = "sha256-Hdsd+epcLFLkeHzJ2CUu4ss1qOd0+lTjhfs9MhI5Weg=";
|
2019-12-28 14:56:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FiloSottile";
|
|
|
|
repo = "age";
|
2020-06-28 16:17:43 +01:00
|
|
|
rev = "v${version}";
|
2021-09-06 18:35:06 +01:00
|
|
|
sha256 = "sha256-MfyW8Yv8swKqA7Hl45l5Zn4wZrQmE661eHsKIywy36U=";
|
2019-12-28 14:56:08 +00:00
|
|
|
};
|
|
|
|
|
2021-09-06 18:56:04 +01:00
|
|
|
ldflags = [
|
2021-09-08 05:20:00 +01:00
|
|
|
"-s" "-w" "-X main.Version=${version}"
|
2021-09-06 18:56:04 +01:00
|
|
|
];
|
|
|
|
|
2021-09-08 05:20:00 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
installManPage doc/*.1
|
|
|
|
'';
|
|
|
|
|
2021-09-06 18:56:04 +01:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
if [[ "$("$out/bin/${pname}" --version)" == "${version}" ]]; then
|
|
|
|
echo '${pname} smoke check passed'
|
|
|
|
else
|
|
|
|
echo '${pname} smoke check failed'
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2020-03-27 07:33:21 +00:00
|
|
|
meta = with lib; {
|
2019-12-28 14:56:08 +00:00
|
|
|
homepage = "https://age-encryption.org/";
|
|
|
|
description = "Modern encryption tool with small explicit keys";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ tazjin ];
|
|
|
|
};
|
2020-06-28 16:17:43 +01:00
|
|
|
}
|