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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitHub, autoreconfHook, libsodium }:
stdenv.mkDerivation rec {
pname = "mkp224o";
2022-07-29 00:25:17 +00:00
version = "1.6.1";
src = fetchFromGitHub {
owner = "cathugger";
repo = "mkp224o";
rev = "v${version}";
2022-07-29 00:25:17 +00:00
sha256 = "sha256-+TJ137DmgaFZX+/N6VwXJwfVCoTWtC8NqfXfYJC8UHo=";
};
buildCommand =
let
# compile few variants with different implementation of crypto
# the fastest depends on a particular cpu
variants = [
{ suffix = "ref10"; configureFlags = ["--enable-ref10"]; }
{ suffix = "donna"; configureFlags = ["--enable-donna"]; }
] ++ lib.optionals stdenv.hostPlatform.isx86 [
{ suffix = "donna-sse2"; configureFlags = ["--enable-donna-sse2"]; }
2022-01-03 14:43:59 +00:00
] ++ lib.optionals (!stdenv.isDarwin && stdenv.isx86_64) [
{ suffix = "amd64-51-30k"; configureFlags = ["--enable-amd64-51-30k"]; }
{ suffix = "amd64-64-24k"; configureFlags = ["--enable-amd64-64-24k"]; }
];
in
lib.concatMapStrings ({suffix, configureFlags}: ''
install -D ${
stdenv.mkDerivation {
name = "mkp224o-${suffix}-${version}";
inherit version src configureFlags;
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ libsodium ];
installPhase = "install -D mkp224o $out";
}
} $out/bin/mkp224o-${suffix}
'') variants;
meta = with lib; {
description = "Vanity address generator for tor onion v3 (ed25519) hidden services";
homepage = "http://cathug2kyi4ilneggumrenayhuhsvrgn6qv2y47bgeet42iivkpynqad.onion/";
license = licenses.cc0;
2022-01-03 14:43:59 +00:00
platforms = platforms.unix;
maintainers = with maintainers; [ ];
};
}