Skip to content

Commit b5e8ee3

Browse files
committed
conduktor-ctl: init at 0.4.0
1 parent c0147bb commit b5e8ee3

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
lib,
3+
buildGoModule,
4+
fetchFromGitHub,
5+
installShellFiles,
6+
stdenv,
7+
versionCheckHook,
8+
}:
9+
buildGoModule rec {
10+
pname = "conduktor-ctl";
11+
version = "0.4.0";
12+
13+
src = fetchFromGitHub {
14+
owner = "conduktor";
15+
repo = "ctl";
16+
rev = "refs/tags/v${version}";
17+
hash = "sha256-NNhaYBhLCCVXBbZKKefPRk1CD8GQm98FvChgeHvPDKs=";
18+
};
19+
20+
vendorHash = "sha256-kPCBzLU6aH6MNlKZcKKFcli99ZmdOtPV5+5gxPs5GH4=";
21+
22+
nativeBuildInputs = [ installShellFiles ];
23+
24+
ldflags = [ "-X github.com/conduktor/ctl/utils.version=${version}" ];
25+
26+
checkPhase = ''
27+
go test ./...
28+
'';
29+
30+
postInstall =
31+
''
32+
mv $out/bin/ctl $out/bin/conduktor
33+
''
34+
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
35+
installShellCompletion --cmd conduktor \
36+
--bash <($out/bin/conduktor completion bash) \
37+
--fish <($out/bin/conduktor completion fish) \
38+
--zsh <($out/bin/conduktor completion zsh)
39+
'';
40+
41+
doInstallCheck = true;
42+
43+
nativeInstallCheckInputs = [ versionCheckHook ];
44+
45+
versionCheckProgram = "${placeholder "out"}/bin/conduktor";
46+
47+
versionCheckProgramArg = "version";
48+
49+
meta = {
50+
description = "CLI tool to interact with the Conduktor Console and Gateway";
51+
mainProgram = "conduktor";
52+
homepage = "https://github.com/conduktor/ctl";
53+
license = lib.licenses.asl20;
54+
maintainers = with lib.maintainers; [
55+
conduktorbot
56+
marnas
57+
];
58+
platforms = lib.platforms.linux ++ lib.platforms.darwin;
59+
};
60+
}

0 commit comments

Comments
 (0)