Files
nixpkgs/pkgs/by-name/tw/twitch-cli/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

66 lines
1.5 KiB
Nix

{
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
lib,
testers,
twitch-cli,
}:
buildGoModule rec {
pname = "twitch-cli";
version = "1.1.25";
src = fetchFromGitHub {
owner = "twitchdev";
repo = "twitch-cli";
rev = "v${version}";
hash = "sha256-+6/o2vhj1iaT0hkyQRedn7ga1dhNZOupX4lOadnTDU0=";
};
patches = [
./application-name.patch
];
vendorHash = "sha256-LPpUnielSeGE0k68z+M565IqXQUIkAh5xloOqcbfh20=";
ldflags = [
"-s"
"-w"
"-X=main.buildVersion=${version}"
];
preCheck = ''
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 {
package = twitch-cli;
command = "HOME=$(mktemp -d) twitch-cli version";
version = "twitch-cli/${version}";
};
meta = with lib; {
description = "Official Twitch CLI to make developing on Twitch easier";
mainProgram = "twitch-cli";
homepage = "https://github.com/twitchdev/twitch-cli";
license = licenses.asl20;
maintainers = with maintainers; [ benediktbroich ];
};
}