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
48 lines
1.1 KiB
Nix
48 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "leetgo";
|
|
version = "1.4.15";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "j178";
|
|
repo = "leetgo";
|
|
rev = "v${version}";
|
|
hash = "sha256-9GM4V7NOYMsvWwBgJSnGl4/S+UexdlVL/NyIiMRnL8A=";
|
|
};
|
|
|
|
vendorHash = "sha256-I3H2uVIvOGM6aQelM/69LpwJvg3TBZwq3i4R913etH4=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X=github.com/j178/leetgo/constants.Version=${version}"
|
|
];
|
|
|
|
subPackages = [ "." ];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
installShellCompletion --cmd leetgo \
|
|
--bash <($out/bin/leetgo completion bash) \
|
|
--fish <($out/bin/leetgo completion fish) \
|
|
--zsh <($out/bin/leetgo completion zsh)
|
|
'';
|
|
|
|
meta = {
|
|
description = "Command-line tool for LeetCode";
|
|
homepage = "https://github.com/j178/leetgo";
|
|
changelog = "https://github.com/j178/leetgo/releases/tag/v${version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ Ligthiago ];
|
|
mainProgram = "leetgo";
|
|
};
|
|
}
|