2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2023-08-10 07:59:29 +00:00
|
|
|
, installShellFiles
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "containerlab";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.46.0";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "srl-labs";
|
|
|
|
repo = "containerlab";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-uBT9whv1qL3yfO6VoeW2SqLIzG11mk+SU09c/xqboM8=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-mkQR0lZXYe6Dz4PngxF7d7Bkr4R3HmL/imQDLridmlA=";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X" "github.com/srl-labs/containerlab/cmd.version=${version}"
|
|
|
|
"-X" "github.com/srl-labs/containerlab/cmd.commit=${src.rev}"
|
|
|
|
"-X" "github.com/srl-labs/containerlab/cmd.date=1970-01-01T00:00:00Z"
|
|
|
|
];
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
postInstall = ''
|
|
|
|
local INSTALL="$out/bin/containerlab"
|
|
|
|
installShellCompletion --cmd containerlab \
|
|
|
|
--bash <($out/bin/containerlab completion bash) \
|
|
|
|
--fish <($out/bin/containerlab completion fish) \
|
|
|
|
--zsh <($out/bin/containerlab completion zsh)
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Container-based networking lab";
|
|
|
|
homepage = "https://containerlab.dev/";
|
|
|
|
changelog = "https://github.com/srl-labs/containerlab/releases/tag/${src.rev}";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ janik ];
|
|
|
|
};
|
|
|
|
}
|