lol
1{
2 buildGoModule,
3 stdenv,
4 lib,
5 installShellFiles,
6 fetchFromGitHub,
7 nix-update-script,
8}:
9
10buildGoModule rec {
11 pname = "deck";
12 version = "1.51.1";
13
14 src = fetchFromGitHub {
15 owner = "Kong";
16 repo = "deck";
17 tag = "v${version}";
18 hash = "sha256-r7nqPsFXLhTg0gctNc8dYLv5L02J3YWw6AOfqHTsXIw=";
19 };
20
21 nativeBuildInputs = [ installShellFiles ];
22
23 env.CGO_ENABLED = 0;
24
25 ldflags = [
26 "-s -w -X github.com/kong/deck/cmd.VERSION=${version}"
27 "-X github.com/kong/deck/cmd.COMMIT=${src.rev}"
28 ];
29
30 proxyVendor = true; # darwin/linux hash mismatch
31 vendorHash = "sha256-5JSMw73Vo59OMpkQcakYodd9HySmPPaJIi3x85npd6Y=";
32
33 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
34 installShellCompletion --cmd deck \
35 --bash <($out/bin/deck completion bash) \
36 --fish <($out/bin/deck completion fish) \
37 --zsh <($out/bin/deck completion zsh)
38 '';
39
40 passthru.updateScript = nix-update-script { };
41
42 meta = {
43 description = "Configuration management and drift detection tool for Kong";
44 homepage = "https://github.com/Kong/deck";
45 license = lib.licenses.asl20;
46 mainProgram = "deck";
47 maintainers = with lib.maintainers; [ liyangau ];
48 };
49}