Unverified Commit 5dacf3a0 authored by Erik Arvstedt's avatar Erik Arvstedt
Browse files

bitcoin: add shell completions

parent 19c6ce8a
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
, fetchurl
, autoreconfHook
, pkg-config
, installShellFiles
, util-linux
, hexdump
, autoSignDarwinBinariesHook
@@ -43,7 +44,7 @@ stdenv.mkDerivation rec {
  };

  nativeBuildInputs =
    [ autoreconfHook pkg-config ]
    [ autoreconfHook pkg-config installShellFiles ]
    ++ lib.optionals stdenv.isLinux [ util-linux ]
    ++ lib.optionals stdenv.isDarwin [ hexdump ]
    ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
@@ -53,7 +54,19 @@ stdenv.mkDerivation rec {
    ++ lib.optionals withWallet [ db48 sqlite ]
    ++ lib.optionals withGui [ qrencode qtbase qttools ];

  postInstall = lib.optionalString withGui ''
  postInstall = ''
    installShellCompletion --cmd bitcoin-cli --bash contrib/completions/bash/bitcoin-cli.bash-completion
    installShellCompletion --cmd bitcoind --bash contrib/completions/bash/bitcoind.bash-completion
    installShellCompletion --cmd bitcoin-tx --bash contrib/completions/bash/bitcoin-tx.bash-completion

    installShellCompletion --fish contrib/completions/fish/bitcoin-cli.fish
    installShellCompletion --fish contrib/completions/fish/bitcoind.fish
    installShellCompletion --fish contrib/completions/fish/bitcoin-tx.fish
    installShellCompletion --fish contrib/completions/fish/bitcoin-util.fish
    installShellCompletion --fish contrib/completions/fish/bitcoin-wallet.fish
  '' + lib.optionalString withGui ''
    installShellCompletion --fish contrib/completions/fish/bitcoin-qt.fish

    install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop
    substituteInPlace $out/share/applications/bitcoin-qt.desktop --replace "Icon=bitcoin128" "Icon=bitcoin"
    install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png