From a6a6c79ccbc904fa10020b69172237ee1bc932e4 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Mon, 2 Mar 2026 12:36:28 +0000 Subject: [PATCH] rqbit: Install shell completions --- pkgs/by-name/rq/rqbit/package.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/rq/rqbit/package.nix b/pkgs/by-name/rq/rqbit/package.nix index dfc9286e646b..12f3bd54af0c 100644 --- a/pkgs/by-name/rq/rqbit/package.nix +++ b/pkgs/by-name/rq/rqbit/package.nix @@ -3,6 +3,7 @@ stdenv, rustPlatform, fetchFromGitHub, + installShellFiles, pkg-config, openssl, buildNpmPackage, @@ -47,7 +48,10 @@ rustPlatform.buildRustPackage { cargoHash = "sha256-gYasOjrG0oeT/6Ben57MKAvBtgpoSmZ93RZQqSXAxIc="; - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ]; @@ -62,6 +66,12 @@ rustPlatform.buildRustPackage { rm crates/librqbit/build.rs ''; + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + for shell in bash fish zsh; do + installShellCompletion --cmd rqbit --$shell <($out/bin/rqbit completions $shell) + done + ''; + nativeInstallCheckInputs = [ versionCheckHook ];