From 670565df12bdfdcc45c95d60970da1871d8f0e37 Mon Sep 17 00:00:00 2001 From: magicquark <198001825+magicquark@users.noreply.github.com> Date: Wed, 24 Sep 2025 02:38:47 +0100 Subject: [PATCH] tombi: add shell completions - Version 0.6.9 of `tombi` added the ability to generate completions for shells (see https://github.com/tombi-toml/tombi/releases/tag/v0.6.9). - This commit adds the generated shell completions to the derivation output. - Resolves issue 445228. --- pkgs/by-name/to/tombi/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/to/tombi/package.nix b/pkgs/by-name/to/tombi/package.nix index 1c98e19275f3..09aa173775c2 100644 --- a/pkgs/by-name/to/tombi/package.nix +++ b/pkgs/by-name/to/tombi/package.nix @@ -1,8 +1,10 @@ { + stdenv, lib, rustPlatform, fetchFromGitHub, versionCheckHook, + installShellFiles, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -26,9 +28,19 @@ rustPlatform.buildRustPackage (finalAttrs: { --replace-fail 'version = "0.0.0-dev"' 'version = "${finalAttrs.version}"' ''; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd tombi \ + --bash <($out/bin/tombi completion bash) \ + --fish <($out/bin/tombi completion fish) \ + --zsh <($out/bin/tombi completion zsh) + ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = {