Files
nixpkgs/pkgs/by-name/st/stripe-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

94 lines
2.5 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
stdenv,
}:
buildGoModule rec {
pname = "stripe-cli";
version = "1.30.0";
src = fetchFromGitHub {
owner = "stripe";
repo = "stripe-cli";
rev = "v${version}";
hash = "sha256-qDrEDP3gDHggXxavMVuVitFN+OWz5WlamePS/1/zlq8=";
};
vendorHash = "sha256-EDdRgApJ7gv/4ma/IfaHi+jjpTPegsUfqHbvoFMn048=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X github.com/stripe/stripe-cli/pkg/version.Version=${version}"
];
preCheck = ''
# the tests expect the Version ldflag not to be set
unset ldflags
# requires internet access
rm pkg/cmd/plugin_cmds_test.go
rm pkg/cmd/resources_test.go
rm pkg/cmd/root_test.go
# TODO: no clue why it's broken (1.17.1), remove for now.
rm pkg/login/client_login_test.go
rm pkg/git/editor_test.go
rm pkg/rpcservice/sample_create_test.go
''
+
lib.optionalString
(
# delete plugin tests on all platforms but exact matches
# https://github.com/stripe/stripe-cli/issues/850
!lib.lists.any (platform: lib.meta.platformMatch stdenv.hostPlatform platform) [
"x86_64-linux"
"x86_64-darwin"
]
)
''
rm pkg/plugins/plugin_test.go
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd stripe \
--bash <($out/bin/stripe completion --write-to-stdout --shell bash) \
--zsh <($out/bin/stripe completion --write-to-stdout --shell zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/stripe --help
$out/bin/stripe --version | grep "${version}"
runHook postInstallCheck
'';
meta = {
homepage = "https://stripe.com/docs/stripe-cli";
changelog = "https://github.com/stripe/stripe-cli/releases/tag/v${version}";
description = "Command-line tool for Stripe";
longDescription = ''
The Stripe CLI helps you build, test, and manage your Stripe integration
right from the terminal.
With the CLI, you can:
Securely test webhooks without relying on 3rd party software
Trigger webhook events or resend events for easy testing
Tail your API request logs in real-time
Create, retrieve, update, or delete API objects.
'';
license = with lib.licenses; [ asl20 ];
maintainers = with lib.maintainers; [
RaghavSood
jk
kashw2
];
mainProgram = "stripe";
};
}