Skip to content

Commit

Permalink
#3003 nix: allow shell completion
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed Apr 12, 2024
1 parent 5093ccc commit fc83788
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
, wrapQtAppsHook
, botan2
, pkg-config
, xvfb-run
, installShellFiles
}:

let
Expand All @@ -31,6 +33,8 @@ stdenv.mkDerivation {
qttools
wrapQtAppsHook
pkg-config
installShellFiles
xvfb-run
] ++ lib.optionals stdenv.isDarwin [ makeWrapper ];

buildInputs = [
Expand All @@ -46,9 +50,16 @@ stdenv.mkDerivation {
"USE_SYSTEM_BOTAN=1"
];

postInstall =
postInstall = ''
installShellCompletion --cmd ${appname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
installShellCompletion --cmd ${pname} \
--bash <(xvfb-run $out/bin/${appname} --completion bash) \
--fish <(xvfb-run $out/bin/${appname} --completion fish)
''
# Create a lowercase symlink for Linux
lib.optionalString stdenv.isLinux ''
+ lib.optionalString stdenv.isLinux ''
ln -s $out/bin/${appname} $out/bin/${pname}
''
# Wrap application for macOS as lowercase binary
Expand Down

0 comments on commit fc83788

Please sign in to comment.