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

47 lines
1.2 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";
version = "0.46.2";
2023-05-28 16:41:26 +02:00
src = fetchFromGitHub {
owner = "srl-labs";
repo = "containerlab";
rev = "v${version}";
hash = "sha256-TzHTiAcN57FDdKBkZq5YwFwjP3s6OmN3431XGoMgnwI=";
2023-05-28 16:41:26 +02:00
};
2023-07-27 14:36:34 +02:00
nativeBuildInputs = [ installShellFiles ];
vendorHash = "sha256-3ALEwpFDnbSoTm3bxHZmRGkw1DeQ4Ikl6PpTosa1S6E=";
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;
maintainers = with maintainers; [ janik ];
};
}