pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / by-name / jc / jcli / package.nix
blob6de7a5096d9aa0cfea01b8eaf5cc3fb7621fe4fc
2   lib,
3   stdenv,
4   buildGoModule,
5   fetchFromGitHub,
6   installShellFiles,
7 }:
9 buildGoModule rec {
10   pname = "jcli";
11   version = "0.0.42";
13   src = fetchFromGitHub {
14     owner = "jenkins-zh";
15     repo = "jenkins-cli";
16     rev = "v${version}";
17     hash = "sha256-t9NE911TjAvoCsmf9F989DNQ+s9GhgUF7cwuyHefWts=";
18   };
20   vendorHash = "sha256-bmPnxFvdKU5zuMsCDboSOxP5f7NnMRwS/gN0sW7eTRA=";
22   ldflags = [
23     "-s"
24     "-w"
25     "-X github.com/linuxsuren/cobra-extension/version.version=${version}"
26   ];
28   doCheck = false;
30   nativeBuildInputs = [ installShellFiles ];
32   postInstall =
33     ''
34       mv $out/bin/{jenkins-cli,jcli}
35     ''
36     + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
37       installShellCompletion --cmd jcli \
38         --bash <($out/bin/jcli completion --type bash) \
39         --zsh <($out/bin/jcli completion --type zsh)
40     '';
42   meta = {
43     description = "Jenkins CLI allows you to manage your Jenkins in an easy way";
44     mainProgram = "jcli";
45     homepage = "https://github.com/jenkins-zh/jenkins-cli";
46     changelog = "https://github.com/jenkins-zh/jenkins-cli/releases/tag/${src.rev}";
47     license = lib.licenses.mit;
48     maintainers = with lib.maintainers; [ sikmir ];
49   };