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