Unverified Commit ef656380 authored by rewine's avatar rewine Committed by GitHub
Browse files

Merge pull request #303547 from pbek/feature/qownnotes-shell-completion

qownnotes: add shell completion
parents 62d5453a 1277f7d1
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@
, botan2
, pkg-config
, nixosTests
, installShellFiles
, xvfb-run
}:

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

  buildInputs = [
@@ -49,9 +53,16 @@ stdenv.mkDerivation {
    "USE_SYSTEM_BOTAN=1"
  ];

  postInstall =
  postInstall = ''
    installShellCompletion --cmd ${appname} \
      --bash <(xvfb-run $out/bin/${appname} --completion bash --allow-multiple-instances) \
      --fish <(xvfb-run $out/bin/${appname} --completion fish --allow-multiple-instances)
    installShellCompletion --cmd ${pname} \
      --bash <(xvfb-run $out/bin/${appname} --completion bash --allow-multiple-instances) \
      --fish <(xvfb-run $out/bin/${appname} --completion fish --allow-multiple-instances)
  ''
  # 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