From da3226176434262cfad48976dde0acfc4c1948bb Mon Sep 17 00:00:00 2001 From: Assistant Date: Wed, 3 Sep 2025 18:54:56 -0400 Subject: [PATCH] twitch-cli: add shell completions --- pkgs/by-name/tw/twitch-cli/package.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/by-name/tw/twitch-cli/package.nix b/pkgs/by-name/tw/twitch-cli/package.nix index 225f33809928..6619393d7451 100644 --- a/pkgs/by-name/tw/twitch-cli/package.nix +++ b/pkgs/by-name/tw/twitch-cli/package.nix @@ -1,6 +1,8 @@ { + stdenv, buildGoModule, fetchFromGitHub, + installShellFiles, lib, testers, twitch-cli, @@ -33,6 +35,18 @@ buildGoModule rec { export HOME=$(mktemp -d) ''; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + $out/bin/twitch-cli completion bash > twitch-cli.bash + $out/bin/twitch-cli completion fish > twitch-cli.fish + $out/bin/twitch-cli completion zsh > _twitch-cli + installShellCompletion --cmd twitch-cli \ + --bash twitch-cli.bash \ + --fish twitch-cli.fish \ + --zsh _twitch-cli + ''; + __darwinAllowLocalNetworking = true; passthru.tests.version = testers.testVersion {