From d75b20d22540d0df74451db0160b1996c42263dd Mon Sep 17 00:00:00 2001 From: Fabian Kirchner Date: Fri, 13 Oct 2023 17:00:41 +0200 Subject: install completions for bash, fish and zsh --- default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 88d00fe..02dfde3 100644 --- a/default.nix +++ b/default.nix @@ -8,10 +8,14 @@ let haskellPackages = pkgs.haskellPackages.override { overrides = self: super: { anissue = (super.callCabal2nix "anissue" ./. { }).overrideAttrs (oldAttrs: { + nativeBuildInputs = [ pkgs.installShellFiles ]; postInstall = '' exe=${oldAttrs.pname} - mkdir -p $out/share/bash-completion/completions - $out/bin/$exe --bash-completion-script $exe >$out/share/bash-completion/completions/$exe + + installShellCompletion --cmd $exe \ + --bash <($out/bin/$exe --bash-completion-script $exe) \ + --fish <($out/bin/$exe --fish-completion-script $exe) \ + --zsh <($out/bin/$exe --zsh-completion-script $exe) ''; }); }; -- cgit v1.2.3