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
51 lines
1.4 KiB
Nix
51 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
gitUpdater,
|
|
installShellFiles,
|
|
rustPlatform,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "jwt-cli";
|
|
version = "6.2.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mike-engel";
|
|
repo = "jwt-cli";
|
|
tag = version;
|
|
hash = "sha256-2pYCNLopvIHcKiN4qewQCdkGWHYQ6vQVCaApxGsRG9E=";
|
|
};
|
|
|
|
cargoHash = "sha256-lp2I5+zvFM46TmejtNn/qgVlAaL+xL9slZHduccO/5Q=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
installShellCompletion --cmd jwt \
|
|
--bash <($out/bin/jwt completion bash) \
|
|
--fish <($out/bin/jwt completion fish) \
|
|
--zsh <($out/bin/jwt completion zsh)
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
$out/bin/jwt --version > /dev/null
|
|
$out/bin/jwt decode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c \
|
|
| grep -q 'John Doe'
|
|
'';
|
|
|
|
passthru.updateScript = gitUpdater { };
|
|
|
|
meta = {
|
|
description = "Super fast CLI tool to decode and encode JWTs";
|
|
homepage = "https://github.com/mike-engel/jwt-cli";
|
|
changelog = "https://github.com/mike-engel/jwt-cli/releases/tag/${version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ rycee ];
|
|
mainProgram = "jwt";
|
|
};
|
|
}
|