Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.3 KiB
Nix
Raw Normal View History

2023-05-28 16:41:26 +02:00
{ lib
, buildGoModule
, fetchFromGitHub
2023-07-27 14:36:34 +02:00
, installShellFiles
2023-05-28 16:41:26 +02:00
}:
buildGoModule rec {
pname = "containerlab";
2024-06-23 00:44:44 +00:00
version = "0.55.1";
2023-05-28 16:41:26 +02:00
src = fetchFromGitHub {
owner = "srl-labs";
repo = "containerlab";
rev = "v${version}";
2024-06-23 00:44:44 +00:00
hash = "sha256-Dk1so6CXAbnfyWfqHne/mMc8LYS3JqXj6XM53fQKANk=";
2023-05-28 16:41:26 +02:00
};
2023-07-27 14:36:34 +02:00
nativeBuildInputs = [ installShellFiles ];
2024-06-10 15:39:48 +00:00
vendorHash = "sha256-D0nZhw1YY+Ci7g6wTiUoPp8EoKcL0YIfWHsjDlLR/K8=";
2023-05-28 16:41:26 +02: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-07-27 14:36:34 +02: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-05-28 16:41:26 +02: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;
2023-11-15 08:25:23 +00:00
maintainers = with maintainers; [ aaronjheng ];
2024-02-11 03:19:15 +01:00
mainProgram = "containerlab";
2023-05-28 16:41:26 +02:00
};
}