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

authored by Emery Hemingway and committed by Mateusz Kowalczyk d566fffc 1a87e651

+47
+44
pkgs/applications/networking/browsers/mozilla-plugins/trezor/default.nix
··· 1 + { stdenv, fetchurl, dpkg, zlib }: 2 + 3 + assert stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux"; 4 + 5 + stdenv.mkDerivation { 6 + name = "TREZOR-bridge-1.0.5"; 7 + 8 + passthru = { 9 + mozillaPlugin = "/lib/mozilla/plugins"; 10 + }; 11 + 12 + src = 13 + if stdenv.system == "x86_64-linux" then 14 + fetchurl { 15 + url = https://mytrezor.com/data/plugin/1.0.5/browser-plugin-trezor_1.0.5_amd64.deb; 16 + sha256 = "0097h4v88yca4aayzprrh4pk03xvvj7ncz2mi83chm81gsr2v67z"; 17 + } 18 + else 19 + fetchurl { 20 + url = https://mytrezor.com/data/plugin/1.0.5/browser-plugin-trezor_1.0.5_i386.deb; 21 + sha256 = "0xzbq78s3ivg00f0bj6gyjgf47pvjx2l4mm05jjmdar60bf1xr1n"; 22 + }; 23 + 24 + phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; 25 + 26 + dontStrip = true; 27 + dontPatchELF = true; 28 + 29 + unpackPhase = "${dpkg}/bin/dpkg-deb -x $src ."; 30 + 31 + installPhase = '' 32 + mkdir -p $out/etc/udev/rules.d/ $out/lib/mozilla/plugins 33 + cp ./lib/udev/rules.d/51-trezor-udev.rules $out/etc/udev/rules.d/ 34 + cp ./usr/lib/mozilla/plugins/npBitcoinTrezorPlugin.so $out/lib/mozilla/plugins 35 + ''; 36 + 37 + meta = with stdenv.lib; 38 + { description = "Plugin for browser to TREZOR device communication"; 39 + homepage = https://mytrezor.com; 40 + license = licenses.unfree; 41 + maintainers = with maintainers; [ emery ]; 42 + }; 43 + 44 + }
+3
pkgs/top-level/all-packages.nix
··· 10234 10234 10235 10235 tree = callPackage ../tools/system/tree {}; 10236 10236 10237 + trezor-bridge = callPackage ../applications/networking/browsers/mozilla-plugins/trezor { }; 10238 + 10237 10239 tribler = callPackage ../applications/networking/p2p/tribler { }; 10238 10240 10239 10241 twister = callPackage ../applications/networking/p2p/twister { }; ··· 10423 10425 ++ lib.optional (cfg.enableGoogleTalkPlugin or false) google_talk_plugin 10424 10426 ++ lib.optional (cfg.enableFriBIDPlugin or false) fribid 10425 10427 ++ lib.optional (cfg.enableGnomeExtensions or false) gnome3.gnome_shell 10428 + ++ lib.optional (cfg.enableTrezor or false) trezor-bridge 10426 10429 ); 10427 10430 libs = [ gstreamer gst_plugins_base ] ++ lib.optionals (cfg.enableQuakeLive or false) 10428 10431 (with xlibs; [ stdenv.gcc libX11 libXxf86dga libXxf86vm libXext libXt alsaLib zlib ]);