2023-05-24 13:37:59 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, nix-update-script }:
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "passphrase2pgp";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.3.0";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "skeeto";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-it1XYzLiteL0oq4SZp5E3s6oSkFKi3ZY0Lt+P0gmNag=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
vendorSha256 = "sha256-2H9YRVCaari47ppSkcQYg/P4Dzb4k5PLjKAtfp39NR8=";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/doc/$name
|
|
|
|
cp README.md $out/share/doc/$name
|
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
checkPhase = ''
|
|
|
|
output=$(echo NONE | ../go/bin/passphrase2pgp -a -u NONE -i /dev/stdin | sha256sum)
|
|
|
|
if [[ "$output" != "23f59f4346f35e2feca6ef703ea64973524dec365ea672f23e7afe79be1049dd -" ]] ; then
|
|
|
|
echo "passphrase2pgp introduced backward-incompatible change"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Predictable, passphrase-based PGP key generator";
|
|
|
|
homepage = "https://github.com/skeeto/passphrase2pgp";
|
|
|
|
license = licenses.unlicense;
|
|
|
|
maintainers = with maintainers; [ kaction ];
|
|
|
|
};
|
|
|
|
}
|