From 0200335e087166b94428b314ec56e77785aad4cf Mon Sep 17 00:00:00 2001 From: Yechiel Worenklein <41305372+yechielw@users.noreply.github.com> Date: Mon, 19 May 2025 18:06:10 +0300 Subject: [PATCH] bitwarden-cli: add zsh completion --- pkgs/by-name/bi/bitwarden-cli/package.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/bi/bitwarden-cli/package.nix b/pkgs/by-name/bi/bitwarden-cli/package.nix index 5005965cd286..ec936f6a3a8b 100644 --- a/pkgs/by-name/bi/bitwarden-cli/package.nix +++ b/pkgs/by-name/bi/bitwarden-cli/package.nix @@ -74,12 +74,16 @@ buildNpmPackage rec { shopt -u globstar ''; - postInstall = '' - # The @bitwarden modules are actually npm workspaces inside the source tree, which - # leave dangling symlinks behind. They can be safely removed, because their source is - # bundled via webpack and thus not needed at run-time. - rm -rf $out/lib/node_modules/@bitwarden/clients/node_modules/{@bitwarden,.bin} - ''; + postInstall = + '' + # The @bitwarden modules are actually npm workspaces inside the source tree, which + # leave dangling symlinks behind. They can be safely removed, because their source is + # bundled via webpack and thus not needed at run-time. + rm -rf $out/lib/node_modules/@bitwarden/clients/node_modules/{@bitwarden,.bin} + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd bw --zsh <($out/bin/bw completion --shell zsh) + ''; passthru = { tests = {