containerlab: use finalAttrs
This commit is contained in:
@@ -6,26 +6,29 @@
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "containerlab";
|
||||
version = "0.68.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "srl-labs";
|
||||
repo = "containerlab";
|
||||
rev = "v${version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-x6QDwduAMCD+Trj0awQXW0Tdleb2U6YBi/7mdMB6V/8=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-XRgKfRw6VGg+lkbtPWUVNfAk5a7ZdFwVmhjtM7uSwHs=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
versionCheckHook
|
||||
];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.Version=${version}"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.commit=${src.rev}"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.Version=${finalAttrs.version}"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.commit=${finalAttrs.src.rev}"
|
||||
"-X github.com/srl-labs/containerlab/cmd/version.date=1970-01-01T00:00:00Z"
|
||||
];
|
||||
|
||||
@@ -42,19 +45,16 @@ buildGoModule rec {
|
||||
--zsh <($out/bin/containerlab completion zsh)
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = [
|
||||
versionCheckHook
|
||||
];
|
||||
doInstallCheck = true;
|
||||
versionCheckProgramArg = "version";
|
||||
|
||||
meta = {
|
||||
description = "Container-based networking lab";
|
||||
homepage = "https://containerlab.dev/";
|
||||
changelog = "https://github.com/srl-labs/containerlab/releases/tag/${src.rev}";
|
||||
changelog = "https://github.com/srl-labs/containerlab/releases/tag/v${finalAttrs.version}";
|
||||
license = lib.licenses.bsd3;
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ aaronjheng ];
|
||||
mainProgram = "containerlab";
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user