bitcoin: add shell completions

This commit is contained in:
Erik Arvstedt 2023-09-19 12:55:53 +02:00
parent 19c6ce8a9b
commit 5dacf3a0d8
No known key found for this signature in database
GPG Key ID: 33312B944DD97846

View File

@ -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