diff --git a/pkgs/by-name/oh/oha/package.nix b/pkgs/by-name/oh/oha/package.nix index 3f884b8d6b21..33b7d35d2ef6 100644 --- a/pkgs/by-name/oh/oha/package.nix +++ b/pkgs/by-name/oh/oha/package.nix @@ -4,6 +4,7 @@ fetchFromGitHub, stdenv, cacert, + installShellFiles, libredirect, pkg-config, openssl, @@ -29,7 +30,10 @@ rustPlatform.buildRustPackage (finalAttrs: { CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1"; }; - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ + nativeBuildInputs = [ + installShellFiles + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ]; @@ -54,6 +58,12 @@ rustPlatform.buildRustPackage (finalAttrs: { "--skip=test_proxy" ]; + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + for shell in bash fish zsh; do + installShellCompletion --cmd oha --$shell <($out/bin/oha --completions $shell) + done + ''; + nativeInstallCheckInputs = [ versionCheckHook ];