Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7 buildPackages,
8}:
9
10buildGoModule rec {
11 pname = "spacectl";
12 version = "1.14.4";
13
14 src = fetchFromGitHub {
15 owner = "spacelift-io";
16 repo = "spacectl";
17 rev = "v${version}";
18 hash = "sha256-l55mkCHx7x4a423u88PfZwXXdfUcdk1PqRfeDYKz1i8=";
19 };
20
21 vendorHash = "sha256-iyB6GFkTa4ci+TC2mDTtkuqCXFBnz3rwLns+3ovkUxg=";
22
23 nativeBuildInputs = [ installShellFiles ];
24
25 postInstall =
26 let
27 emulator = stdenv.hostPlatform.emulator buildPackages;
28 in
29 ''
30 installShellCompletion --cmd spacectl \
31 --bash <(${emulator} $out/bin/spacectl completion bash) \
32 --fish <(${emulator} $out/bin/spacectl completion fish) \
33 --zsh <(${emulator} $out/bin/spacectl completion zsh) \
34 '';
35
36 meta = {
37 homepage = "https://github.com/spacelift-io/spacectl";
38 description = "Spacelift client and CLI";
39 changelog = "https://github.com/spacelift-io/spacectl/releases/tag/v${version}";
40 license = lib.licenses.mit;
41 maintainers = with lib.maintainers; [ kashw2 ];
42 mainProgram = "spacectl";
43 };
44}