1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 installShellFiles,
6}:
7
8buildGoModule rec {
9 pname = "labctl";
10 version = "0.0.22-unstable-2024-05-10";
11
12 src = fetchFromGitHub {
13 owner = "labctl";
14 repo = "labctl";
15 rev = "1a8b11402def10819d36b9f7f44e82612ef22674";
16 hash = "sha256-px5jrfllo6teJaNrqIQVyqMwArCw625xSVM7V/xW/IA=";
17 };
18
19 nativeBuildInputs = [ installShellFiles ];
20
21 vendorHash = "sha256-Ycr/IZckIFysS9Goes58hhgh96UMRHjYWfWlQU23mXk=";
22
23 ldflags = [
24 "-X=github.com/labctl/labctl/app.version=${version}"
25 "-X=github.com/labctl/labctl/app.commit=${src.rev}"
26 "-X=github.com/labctl/labctl/app.date=1970-01-01T00:00:00Z"
27 ];
28
29 postInstall = ''
30 local INSTALL="$out/bin/labctl"
31 installShellCompletion --cmd labctl \
32 --bash <(echo "complete -C $INSTALL labctl") \
33 --zsh <(echo "complete -o nospace -C $INSTALL labctl")
34 '';
35
36 meta = with lib; {
37 description = "Collection of helper tools for network engineers, while configuring and experimenting with their own network labs";
38 homepage = "https://labctl.net";
39 changelog = "https://github.com/labctl/labctl/releases";
40 license = licenses.asl20;
41 maintainers = [ ];
42 mainProgram = "labctl";
43 };
44}