nixpkgs/pkgs/tools/security/age/default.nix

42 lines
983 B
Nix
Raw Normal View History

2021-09-08 04:20:00 +00:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "age";
2021-09-06 17:35:06 +00:00
version = "1.0.0";
vendorSha256 = "sha256-cnFDs5Qos1KHn7TqaEgmt4sSzpjZor615euwxka14mY=";
src = fetchFromGitHub {
owner = "FiloSottile";
repo = "age";
rev = "v${version}";
2021-09-06 17:35:06 +00:00
sha256 = "sha256-MfyW8Yv8swKqA7Hl45l5Zn4wZrQmE661eHsKIywy36U=";
};
2021-09-06 17:56:04 +00:00
ldflags = [
2021-09-08 04:20:00 +00:00
"-s" "-w" "-X main.Version=${version}"
2021-09-06 17:56:04 +00:00
];
2021-09-08 04:20:00 +00:00
nativeBuildInputs = [ installShellFiles ];
preInstall = ''
installManPage doc/*.1
'';
2021-09-06 17:56:04 +00: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
'';
meta = with lib; {
homepage = "https://age-encryption.org/";
description = "Modern encryption tool with small explicit keys";
license = licenses.bsd3;
maintainers = with maintainers; [ tazjin ];
};
}