about summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers
diff options
context:
space:
mode:
authorEmery Hemingway <emery@vfemail.net>2014-08-05 20:02:26 -0400
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-09-21 00:53:49 +0100
commitd566fffc43b23f727800c0ddb33f55128bc81fca (patch)
tree24de1a8c90b930b2ad360323180bdb691aec1d1c /pkgs/applications/networking/browsers
parent1a87e651e9ea964b6fa1428619be349d3a1dacd6 (diff)
downloadnixlib-d566fffc43b23f727800c0ddb33f55128bc81fca.tar
nixlib-d566fffc43b23f727800c0ddb33f55128bc81fca.tar.gz
nixlib-d566fffc43b23f727800c0ddb33f55128bc81fca.tar.bz2
nixlib-d566fffc43b23f727800c0ddb33f55128bc81fca.tar.lz
nixlib-d566fffc43b23f727800c0ddb33f55128bc81fca.tar.xz
nixlib-d566fffc43b23f727800c0ddb33f55128bc81fca.tar.zst
nixlib-d566fffc43b23f727800c0ddb33f55128bc81fca.zip
initial package for TREZOR browser plugin
This plugin allows a browser to access a TREZOR device.
It requires a udev rule and a wrapped browser to operate.

Closes #3475
Diffstat (limited to 'pkgs/applications/networking/browsers')
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/trezor/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/trezor/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/trezor/default.nix
new file mode 100644
index 000000000000..10b2ffaff5bf
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/trezor/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl, dpkg, zlib }:
+
+assert stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux";
+
+stdenv.mkDerivation {
+  name = "TREZOR-bridge-1.0.5";
+
+  passthru = {
+    mozillaPlugin = "/lib/mozilla/plugins";
+  };
+
+  src =
+    if stdenv.system == "x86_64-linux" then
+      fetchurl {
+        url    = https://mytrezor.com/data/plugin/1.0.5/browser-plugin-trezor_1.0.5_amd64.deb;
+        sha256 = "0097h4v88yca4aayzprrh4pk03xvvj7ncz2mi83chm81gsr2v67z";
+      }
+    else
+      fetchurl {
+        url    = https://mytrezor.com/data/plugin/1.0.5/browser-plugin-trezor_1.0.5_i386.deb;
+        sha256 = "0xzbq78s3ivg00f0bj6gyjgf47pvjx2l4mm05jjmdar60bf1xr1n";
+      };
+
+  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+
+  dontStrip = true;
+  dontPatchELF = true;
+
+  unpackPhase = "${dpkg}/bin/dpkg-deb -x $src .";
+
+  installPhase = ''
+    mkdir -p $out/etc/udev/rules.d/ $out/lib/mozilla/plugins
+    cp ./lib/udev/rules.d/51-trezor-udev.rules $out/etc/udev/rules.d/
+    cp ./usr/lib/mozilla/plugins/npBitcoinTrezorPlugin.so $out/lib/mozilla/plugins
+  '';
+
+  meta = with stdenv.lib;
+    { description = "Plugin for browser to TREZOR device communication";
+      homepage = https://mytrezor.com;
+      license = licenses.unfree;
+      maintainers = with maintainers; [ emery ];
+    };
+
+}
\ No newline at end of file