Skip to content

Commit

Permalink
pythonPackages.trezor: enable shell completion
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilata committed Jul 24, 2020
1 parent ea63a04 commit 681268d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkgs/development/python-modules/trezor/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
, rlp
, shamir-mnemonic
, trezor-udev-rules
, installShellFiles
}:

buildPythonPackage rec {
Expand All @@ -25,6 +26,8 @@ buildPythonPackage rec {
sha256 = "0ycmpwjv5xp25993divjhaq5j766zgcy22xx39xfc1pcvldq5g7n";
};

nativeBuildInputs = [ installShellFiles ];

propagatedBuildInputs = [ typing-extensions protobuf hidapi ecdsa mnemonic requests pyblake2 click construct libusb1 rlp shamir-mnemonic trezor-udev-rules ];

checkInputs = [
Expand All @@ -38,6 +41,16 @@ buildPythonPackage rec {
runHook postCheck
'';

postFixup = ''
mkdir completions
_TREZORCTL_COMPLETE=source_bash $out/bin/trezorctl > completions/trezorctl || true
_TREZORCTL_COMPLETE=source_zsh $out/bin/trezorctl > completions/_trezorctl || true
_TREZORCTL_COMPLETE=source_fish $out/bin/trezorctl > completions/trezorctl.fish || true
installShellCompletion --bash completions/trezorctl
installShellCompletion --zsh completions/_trezorctl
installShellCompletion --fish completions/trezorctl.fish
'';

meta = with lib; {
description = "Python library for communicating with TREZOR Bitcoin Hardware Wallet";
homepage = "https://github.com/trezor/trezor-firmware/tree/master/python";
Expand Down

0 comments on commit 681268d

Please sign in to comment.