summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorvolth <volth@webmaster.ms>2019-02-15 10:52:46 +0000
committerxeji <36407913+xeji@users.noreply.github.com>2019-02-15 11:52:46 +0100
commit293ca25fea3a0206ac67a8b265ba65fa1de1cba8 (patch)
treecda8482fdea4b2cb62365d06a22abe25b7c21654 /pkgs/tools
parentfe16c54d1a7311cf6e42254e4c39cbf30913360e (diff)
downloadnixpkgs-293ca25fea3a0206ac67a8b265ba65fa1de1cba8.tar
nixpkgs-293ca25fea3a0206ac67a8b265ba65fa1de1cba8.tar.gz
nixpkgs-293ca25fea3a0206ac67a8b265ba65fa1de1cba8.tar.bz2
nixpkgs-293ca25fea3a0206ac67a8b265ba65fa1de1cba8.tar.lz
nixpkgs-293ca25fea3a0206ac67a8b265ba65fa1de1cba8.tar.xz
nixpkgs-293ca25fea3a0206ac67a8b265ba65fa1de1cba8.tar.zst
nixpkgs-293ca25fea3a0206ac67a8b265ba65fa1de1cba8.zip
mkp224o: init at 1.2.0 (#55104)
* mkp224o: init at 1.2.0

* mkp224o: remove unwanted spaces
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/security/mkp224o/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/tools/security/mkp224o/default.nix b/pkgs/tools/security/mkp224o/default.nix
new file mode 100644
index 00000000000..b649c57b346
--- /dev/null
+++ b/pkgs/tools/security/mkp224o/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, libsodium }:
+
+stdenv.mkDerivation rec {
+  name = "mkp224o-${version}";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "cathugger";
+    repo = "mkp224o";
+    rev = "v${version}";
+    sha256 = "1m7r0jfm6na6rk75v1kals3bx2cs6jsfxdgpxdljn39j3qr4mxvd";
+  };
+
+  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.isi686 || stdenv.isx86_64) [
+        { suffix = "donna-sse2";    configureFlags = ["--enable-donna-sse2"]; }
+      ] ++ lib.optionals stdenv.isx86_64 [
+        { suffix = "amd64-51-30k";  configureFlags = ["--enable-amd64-51-30k"]; }
+        { suffix = "amd64-64-20k";  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;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ volth ];
+  };
+}