mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
54 lines
1.4 KiB
Nix
54 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
installShellFiles,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "containerlab";
|
|
version = "0.59.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "srl-labs";
|
|
repo = "containerlab";
|
|
rev = "v${version}";
|
|
hash = "sha256-4YSnAoQkjDpSRBMqYW8D3TzipE5Co892y5PXkcz+8xA=";
|
|
};
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
vendorHash = "sha256-PJQrQn7QPtUSzdlf2BYY8ARcmH6pzZgpl1oQbc98M4Y=";
|
|
|
|
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"
|
|
];
|
|
|
|
preCheck = ''
|
|
# Fix failed TestLabelsInit test
|
|
export USER="runner"
|
|
'';
|
|
|
|
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)
|
|
'';
|
|
|
|
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; [ aaronjheng ];
|
|
mainProgram = "containerlab";
|
|
};
|
|
}
|